기능을 실행하는 동안 오이 안드로이드 오류가 발생했습니다
-
21-12-2019 - |
문제
오이 테스트를 통해 Android 프로그램을 테스트하려고합니다.
오류가 있습니다 :
C:\Users\Artem\calabash_habr>cucumber features/my_first.feature
*** WARNING: You must use ANSICON 1.31 or higher (https://github.com/adoxa/ansicon/) to get coloured output on Windows
Feature: Pre-orders feature
# Header
Scenario: open Pre-orders # features\my_first.feature:3
W/asset ( 2200): Asset path is neither a directory nor file (type=1).
ERROR: dump failed because assets could not be loaded 'package' not found in aapt output (RuntimeError)
C:/Ruby193/lib/ruby/gems/1.9.1/gems/calabash-android-0.5.1/lib/calabash-android/helpers.rb:10:in `package_name'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/calabash-android-0.5.1/lib/calabash-android/operations.rb:89:in `uninstall_apps'
C:/Users/Artem/calabash_habr/features/support/app_installation_hooks.rb:22:in `Before'
W/asset ( 8772): Asset path is neither a directory nor file (type=1).
ERROR: dump failed because assets could not be loaded
'package' not found in aapt output (RuntimeError)
C:/Ruby193/lib/ruby/gems/1.9.1/gems/calabash-android-0.5.1/lib/calabash-android/helpers.rb:10:in `package_name'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/calabash-android-0.5.1/lib/calabash-android/operations.rb:508:in `start_test_server_in_background'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/calabash-android-0.5.1/lib/calabash-android/operations.rb:110:in `start_test_server_in_background'
C:/Users/Artem/calabash_habr/features/support/app_life_cycle_hooks.rb:5:in `Before'
When I press the menu key # calabash-android-0.5.1/lib/calabash-android/steps/navigation_steps.rb:5
Could not take screenshot (RuntimeError)
C:/Ruby193/lib/ruby/gems/1.9.1/gems/calabash-android-0.5.1/lib/calabash-android/operations.rb:425:in `screenshot'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/calabash-android-0.5.1/lib/calabash-android/operations.rb:118:in `screenshot_embed'
C:/Users/Artem/calabash_habr/features/support/app_life_cycle_hooks.rb:10:in `After'
Failing Scenarios:
cucumber features\my_first.feature:3 # Scenario: open Pre-orders
1 scenario (1 failed)
1 step (1 skipped)
0m0.217s
.
내 기능은 쉽습니다 :
Feature: Pre-orders feature
# Header
Scenario: open Pre-orders
# Menu press
When I press the menu key
.
데이터를 저장하기를 원하기 때문에 응용 프로그램을 재설치하지 않고 기능을 시작하고 싶습니다.
p.s.Calabash Console을 오류없이 실행할 수 있습니다.
해결책
i app_installation_hooks.rb를 변경하십시오 :
require 'calabash-android/management/app_installation'
AfterConfiguration do |config|
FeatureNameMemory.feature_name = nil
end
Before do |scenario|
@scenario_is_outline = (scenario.class == Cucumber::Ast::OutlineTable::ExampleRow)
if @scenario_is_outline
scenario = scenario.scenario_outline
end
feature_name = scenario.feature.title
if FeatureNameMemory.feature_name != feature_name \
or ENV["RESET_BETWEEN_SCENARIOS"] == "1"
if ENV["RESET_BETWEEN_SCENARIOS"] == "1"
log "New scenario - reinstalling apps"
else
log "First scenario in feature - reinstalling apps"
end
# uninstall_apps
# install_app(ENV["TEST_APP_PATH"])
# install_app(ENV["APP_PATH"])
FeatureNameMemory.feature_name = feature_name
FeatureNameMemory.invocation = 1
else
FeatureNameMemory.invocation += 1
end
end
FeatureNameMemory = Class.new
class << FeatureNameMemory
@feature_name = nil
attr_accessor :feature_name, :invocation
end
.
이제 앱을 실행합니다.
calabash-android run <apk>
. 제휴하지 않습니다 StackOverflow