Calabash-android: `Cucumber :: Ast` no longer exists

I am starting with calabash and I am unable to run the test. The test is very simple, just push one TextView:

Feature: Login feature
    Scenario: Given I am on the Login page 
    touch("TextView id:'com.tae.store:id/option_bag'")

      

But I always have the same error:

Function: input function

  Scenario: Given I am on the Login page # features/my_first.feature:3
      touch("TextView id:'com.tae.store:id/option_bag'")
  `Cucumber::Ast` no longer exists. These classes have moved into the `Cucumber::Core::Ast` namespace, but may not have the same API. (RuntimeError)
  ./features/support/app_installation_hooks.rb:8:in `Before'

Failing Scenarios:
cucumber features/my_first.feature:3 # Scenario: Given I am on the Login page

1 scenario (1 failed)
0 steps
0m6.173s

      

I am using Ruby 1.9.3 (I tried using Ruby 2.0.0 too).

thank

+3


source to share


2 answers


I ran into this issue a couple of times while trying to set up Calabash and Cucumber. I found the problem was with the version of the Cucumber gem that I was using. Several different sources have pointed out that new Calabash stones do not work with Cucumber beta releases (link: https://github.com/calabash/calabash-android/issues/479 )

To solve this problem, I installed the older cucumber pearl and removed the newer one



gem install cucumber -v 1.3.17
gem uninstall cucumber -v 2.0.0.beta.3

      

After that, I was able to run my tests without error. Hope this helps someone else too.

+7


source


If I am not mistaken, you are misunderstanding the structure of Calabash tests. This is how it should look:

In a file features/my_first.feature

(this is the file where you put your user story)

Feature: Login feature
  Scenario: Check login page
    Given I am on the Login page

      



step_definitions/steps.rb

(this is the file where you define the steps used in the files *.feature

)

Given /^I am on the Login page$/ do
  touch "TextView id:'option_bag'"
end

      

I recommend you read the calabash-android wiki here: https://github.com/calabash/calabash-android and the cucumber book: https://pragprog.com/book/hwcuc/the-cucumber-book :)

+1


source







All Articles