Why am I getting uninitialized constant Calabash::ABase (NameError)?

111 Views Asked by At

I'm using Calabash. I ran calabash-android gen as described here. I have a step definition, a page object and a feature. Here's my page object:

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

When I run bundle exec calabash-android run .\app-releaseStaging.apk I get:

uninitialized constant Calabash::ABase (NameError)
1

There are 1 best solutions below

0
Jesus is Lord On BEST ANSWER

Adding require 'calabash-android' to the top of the page object fixed it:

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 is defined here.