我用的是葫芦。我按照此处所述运行了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)
将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
这里定义了CCD_ 4。