Hello,
As I noticed, calabash-android restarts the application between scenarios and clears the data between features. I know there is the possibility to run a command and set the RESET_BETWEEN_SCERNARIOS variable to 1 or 0 but I want a little more J
I took a look over https://github.com/calabash/calabash-android/blob/master/ruby-gem/lib/calabash-android/operations.rb file and noticed some install/reinstall methods.
Questions:
- Is there a way to force calabash for – example - to reinstall the application after a certain scenario? – I have one feature file containing 10 scenarios. Let’s say I want calabash to do a reinstall after scenario no. 6 and NO other reset for the other scenarios. Is this possible to somehow call a method in order to perform the reinstallation?
- I raise the same question regarding the features. I have 10 feature files and I DON’T want to reset the application only after feature no. 6.
Thanks,
Marius
--
You received this message because you are subscribed to the Google Groups "calabash-android" group.
To unsubscribe from this group and stop receiving emails from it, send an email to calabash-andro...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Thanks!
That worked!
From: calabash...@googlegroups.com
[mailto:calabash...@googlegroups.com] On Behalf Of Jonas Maturana
Larsen
Sent: Thursday, April 04, 2013 17:08 PM
To: calabash...@googlegroups.com
Subject: Re: HowTo force calabash to reinstall/or not the application
between scenarios/features?
I think you want to do it before a scenario and not after a scenario since it is a certain scenario that has special pre conditions.
You can add a tag e.g. @reinstall
In the hook you force a reinstall using this check:
if scenario.source_tags_names.include? "@reinstall"
reinstall_apps()
end
On Thursday, April 4, 2013 at 15:32 , Marius Bob wrote:
Hello,
As I noticed, calabash-android restarts the application between scenarios and clears the data between features. I know there is the possibility to run a command and set the RESET_BETWEEN_SCERNARIOS variable to 1 or 0 but I want a little more J
I took a look over https://github.com/calabash/calabash-android/blob/master/ruby-gem/lib/calabash-android/operations.rb file and noticed some install/reinstall methods.
Questions:
Is there a way to force calabash for – example - to reinstall the application after a certain scenario? – I have one feature file containing 10 scenarios. Let’s say I want calabash to do a reinstall after scenario no. 6 and NO other reset for the other scenarios. Is this possible to somehow call a method in order to perform the reinstallation?
I raise the same question regarding the features. I have 10 feature files and I DON’T want to reset the application only after feature no. 6.
Thanks,
Marius
--
You received this message because you are subscribed to the Google Groups "calabash-android" group.
To unsubscribe from this group and stop receiving emails from it, send an email to calabash-andro...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
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/Ql3iluRMijg/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to calabash-andro...@googlegroups.com.
require 'calabash-android/management/app_installation'
AfterConfiguration do |config|
FeatureMemory.feature = nil
end
Before do |scenario|
scenario = scenario.scenario_outline if scenario.respond_to?(:scenario_outline)
feature = scenario.feature
if FeatureMemory.feature != feature || ENV['RESET_BETWEEN_SCENARIOS'] == '1'
if ENV['RESET_BETWEEN_SCENARIOS'] == '1'
log 'New scenario - reinstalling apps'
else
log 'First scenario in feature - reinstalling apps'
end
##uninstall_apps ========> comment or delete this line and save
install_app(ENV['TEST_APP_PATH'])
install_app(ENV['APP_PATH'])
FeatureMemory.feature = feature
FeatureMemory.invocation = 1
else
FeatureMemory.invocation += 1
end
end