calabash / x-platform-example

Example of cross-platform BDD with Cucumber and Calabash
90 stars 60 forks source link

creating new page object gives an error #6

Closed gunesmes closed 4 years ago

gunesmes commented 9 years ago

When I want to create a new page object after opening the application, I get the following error:

  Background: Member should open homepage     # features/M010_filter_product_PS.feature:6
    Given I am on the first experience screen # features/step_definitions/home_page.rb:1
    Given I go to PS page                     # features/step_definitions/ps_page.rb:1
Retrying.. Errno::ECONNREFUSED: (Connection refused - connect(2) (http://localhost:37265))
Retrying.. Errno::ECONNREFUSED: (Connection refused - connect(2) (http://localhost:37265))
Failing... Errno::ECONNREFUSED
Retrying.. Errno::ECONNREFUSED: (Connection refused - connect(2) (http://localhost:37265))
Retrying.. Errno::ECONNREFUSED: (Connection refused - connect(2) (http://localhost:37265))
Failing... Errno::ECONNREFUSED
    Given I open a campaign                   # features/step_definitions/ps_page.rb:5
      Connection refused - connect(2) (http://localhost:37265) (Errno::ECONNREFUSED)
      ./features/support/functions.rb:13:in `touch_item'
      ./features/android/pages/PSPage.rb:10:in `open_product'
      ./features/step_definitions/ps_page.rb:8:in `/^I open a campaign$/'
      features/M010_filter_product_PS.feature:9:in `Given I open a campaign'

my step definition is like following, I am leaving home page and going to PS page then creating PS page object:

Given(/^I am on the first experience screen$/) do
  @current_page = page(HomePage).await(timeout: 30)
end

Given(/^I go to PS page$/) do
  @current_page.go_to_ps()
  @current_page = page(PSPage)
end

what am I missing?

jmoody commented 9 years ago

What is the exact command you are trying to execute?

And what versions of Calabash iOS and Android are you using?

gunesmes commented 9 years ago
calabash-android run prebuilt/app-debug.apk -p android features/M010_filter_product_PS.feature

gem list is:

~/P/m/mobile_app_automation (master ⚡=) gem list

*** LOCAL GEMS ***

actionmailer (4.2.3, 4.2.1)
actionpack (4.2.3, 4.2.1)
actionview (4.2.3, 4.2.1)
activejob (4.2.3, 4.2.1)
activemodel (4.2.1)
activerecord (4.2.1)
activerecord-sqlserver-adapter (4.2.4)
activesupport (4.2.3, 4.2.1)
addressable (2.3.8)
arel (6.0.0)
awesome_print (1.6.1, 1.2.0)
bigdecimal (1.2.0)
builder (3.2.2)
bundler (1.9.9)
calabash-android (0.5.12, 0.5.11, 0.5.7, 0.5.5)
calabash-common (0.0.1)
calabash-cucumber (0.14.3, 0.12.2)
capybara (2.4.4)
capybara-screenshot (1.0.10)
capybara-webkit (1.5.1)
CFPropertyList (2.3.1, 2.2.8)
childprocess (0.5.6)
chronic_duration (0.10.6)
claide (0.8.1)
cliver (0.3.2)
cocoapods (0.37.1)
cocoapods-core (0.37.1)
cocoapods-downloader (0.9.0)
cocoapods-plugins (0.4.2)
cocoapods-trunk (0.6.0)
cocoapods-try (0.4.4)
colored (1.2)
cucumber (1.3.20, 1.3.18)
cucumber-core (1.2.0, 1.1.3)
cucumber-rails (1.4.2, 1.4.0)
dbd-odbc (0.2.5)
dbi (0.4.5)
deprecated (2.0.1)
diff-lcs (1.2.5)
edn (1.0.7, 1.0.6)
erubis (2.7.0)
escape (0.0.4)
ffi (1.9.10, 1.9.8)
fuzzy_match (2.0.4)
geocoder (1.2.9, 1.2.8, 1.2.7)
gherkin (2.12.2)
globalid (0.3.5)
headless (2.1.0)
httpclient (2.6.0.1, 2.3.4.1)
i18n (0.7.0)
io-console (0.4.2)
jquery-rails (4.0.4, 4.0.3)
json (1.8.3, 1.8.2, 1.7.7)
launchy (2.4.3)
libxml-ruby (2.6.0)
loofah (2.0.2)
mail (2.6.3)
mime-types (2.6.1, 2.5, 2.4.3, 1.25.1)
mini_portile (0.6.2)
minitest (5.7.0, 5.6.1, 4.3.2)
molinillo (0.2.3)
multi_json (1.11.2, 1.11.1, 1.11.0, 1.10.1)
multi_test (0.1.2, 0.1.1)
nap (0.8.0)
netrc (0.7.8)
nokogiri (1.6.6.2, 1.5.6)
numerizer (0.1.1)
poltergeist (1.6.0)
power_assert (0.2.3)
psych (2.0.0)
rack (1.6.4, 1.6.2, 1.6.1, 1.6.0)
rack-protection (1.5.3)
rack-test (0.6.3)
rails (4.2.1)
rails-deprecated_sanitizer (1.0.3)
rails-dom-testing (1.0.6)
rails-html-sanitizer (1.0.2)
railties (4.2.3, 4.2.1)
rake (10.4.2, 0.9.6)
rdoc (4.0.0)
rest-client (1.6.9)
retriable (2.0.2, 1.4.1, 1.3.3.1)
rspec (3.3.0)
rspec-core (3.3.1, 3.3.0, 3.2.3)
rspec-expectations (3.3.0, 3.2.1)
rspec-mocks (3.3.1, 3.3.0, 3.2.1)
rspec-rerun (1.1.0)
rspec-support (3.3.0, 3.2.2)
ruby-odbc (0.99997)
rubygems-update (2.4.8)
rubyzip (1.1.7, 1.1.6)
run_loop (1.4.1, 1.4.0, 1.3.3, 1.2.9, 1.2.6)
selenium-webdriver (2.46.2, 2.45.0, 2.44.0)
sim_launcher (0.4.13)
sinatra (1.4.6, 1.4.5)
slowhandcuke (0.0.3)
spec (5.3.4)
spreewald (1.2.6)
sprockets (3.2.0)
sprockets-rails (2.3.1)
sqlite3 (1.3.7)
test-unit (3.1.2, 3.0.9, 2.0.0.0)
thor (0.19.1)
thread_safe (0.3.5)
tilt (2.0.1, 1.4.1)
tzinfo (1.2.2)
unicode_utils (1.4.0)
unirest (1.1.2)
websocket (1.2.2, 1.2.1)
websocket-driver (0.6.0, 0.5.4)
websocket-extensions (0.1.2)
xcodeproj (0.24.1)
xpath (2.0.0)
jmoody commented 9 years ago

@gunesmes The gem list is not helpful in this case.

We need a lot more information to help. What is the Calabash Android version you are using?

It looks like you are trying to connect to an Android emulator? Is that the case?

Can you post your project somewhere?

Since this is not an issue with this repo, it would be better if you posted this question on Stack Overflow or the Calabash Android google group.

gunesmes commented 9 years ago

@jmoody it is 0.5.12

emulator and real device produce same result.

~/P/m/mobile_app_automation (master ⚡=) calabash-android version
0.5.12