我正在使用葫芦。我按照here的描述运行了calabash-android gen
。我有一个步骤定义,一个页面对象和一个功能。这是我的页面对象:
class LocationScanPage < Calabash::ABase
LIST_BUTTON_QUERY="com.facebook.react.views.text.ReactTextView marked:'List'"
def trait
LIST_BUTTON_QUERY
end
def await(opts={})
wait_for_elements_exist([trait])
self
end
end
运行bundle exec calabash-android run .\app-releaseStaging.apk
会得到:
uninitialized constant Calabash::ABase (NameError)
答案 0 :(得分:0)
将require 'calabash-android'
添加到页面对象的顶部即可解决此问题:
require 'calabash-android'
class LocationScanPage < Calabash::ABase
LIST_BUTTON_QUERY="com.facebook.react.views.text.ReactTextView marked:'List'"
def trait
LIST_BUTTON_QUERY
end
def await(opts={})
wait_for_elements_exist([trait])
self
end
end
Calabash::ABase
被定义为here。