Thanks a lot so far, but I have a question: Where should I define those adb commands? Not in calabash_steps.rb file? And if they should be defined there should I just copy paste your code written bellow and it should work?
Thanks
--
You received this message because you are subscribed to a topic in the Google Groups "calabash-android" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/calabash-android/4wevkFdFcC0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to calabash-andro...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Sorry for bothering you so much but it simply just don’t workL.
In another rb file I’ve defined my adb commands like this:
def when_send_app_to_background
ADB.send_to_background
end
def when_bring_app_to_foreground
ADB.bring_to_foreground('com.voalte.voalteone/.activity.MainVoalteOneActivity')
end
def then_app_in_background
wait_for { app_in_background? }
end
def then_app_in_foreground
wait_for { !app_in_background? }
end
def app_in_background?
currentApp = `adb shell dumpsys window windows | grep -E 'mCurrentFocus'`
!currentApp.include?('APP-PACKAGE-NAME')
end
After that in the calabash-steps.rb file I’ve defined:
Given /^I send app$/ do
when_send_app_to_background
end
Andafter all those things I’e tried to run the Script my_first_feature.feature which contains:
Feature: Successfully Log In
Scenario: Log in
And I wait for 2 seconds
Given I send app (the defined step)
And I receive in the cmd console the following error message, note that the app and scripts didn’t even start:
undefined method `last' for #<Enumerator:0x2e6bc00> (NoMethodError)
C:/Ruby193/lib/ruby/gems/1.9.1/gems/calabash-android-0.5.5/lib/calabash-androi
d/operations.rb:306:in `install_app'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/calabash-android-0.5.5/lib/calabash-androi
d/operations.rb:96:in `install_app'
C:/Voalte/features/support/app_installation_hooks.rb:24:in `Before'
Will not start test server because of previous failures. (RuntimeError)
C:/Ruby193/lib/ruby/gems/1.9.1/gems/calabash-android-0.5.5/lib/calabash-androi
d/operations.rb:579:in `start_test_server_in_background'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/calabash-android-0.5.5/lib/calabash-androi
d/operations.rb:125:in `start_test_server_in_background'
C:/Voalte/features/support/app_life_cycle_hooks.rb:5:in `Before'
Failing Scenarios:
cucumber features\Configuring servers\Setting_server_to_st675.feature:2 # Scenar
io: Configuration
1 scenario (1 failed)
0 steps
0m33.126s
Any thoughts?
Sorry again, but do you think that you can give me your skype id? It would be much easier to talk and end this.
Thanks.
From: Paul Lonean [mailto:paul....@softvision.ro]
Sent: Wednesday, December 17, 2014 12:16 PM
To: 'calabash...@googlegroups.com'
Subject: RE: Resuming an app
Sorry for bothering you so much but it simply just don’t workL.
In another rb file I’ve defined my adb commands like this:
def when_send_app_to_background
ADB.send_to_background
end
def when_bring_app_to_foreground
ADB.bring_to_foreground('com.voalte.voalteone/.activity.MainVoalteOneActivity')
end
def then_app_in_background
wait_for { app_in_background? }
end
def then_app_in_foreground
wait_for { !app_in_background? }
end
def app_in_background?
currentApp = `adb shell dumpsys window windows | grep -E 'mCurrentFocus'`
!currentApp.include?('APP-PACKAGE-NAME')
end
After that in the calabash-steps.rb file I’ve defined:
From: calabash...@googlegroups.com [mailto:calabash...@googlegroups.com] On Behalf Of Jani Jegoroff
Sent: Wednesday, December 17, 2014 11:56 AM
I’ve added you on skype, but for any edge case my Skype id is en_plonean