Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RESET_BETWEEN_SCENARIOS flag does not work #376

Closed
nemesis opened this issue May 14, 2014 · 7 comments
Closed

RESET_BETWEEN_SCENARIOS flag does not work #376

nemesis opened this issue May 14, 2014 · 7 comments

Comments

@nemesis
Copy link

nemesis commented May 14, 2014

Hello everyone, and first of all thank you for all the work you've put into this project.

I've tried launching cucumber with the RESET_BETWEEN_SCENARIOS=1 environment variable, but it clearly does not reset the device between scenarios.
I would like to know if there is anything I can do about it.

Also, as a workaround - is there a possibility to call set_user_pref within a scenario hook? I've tried including the Calabash::Cucumber::Operations module but the method names seem to be clashing with other ones, thus, stopping the execution. (tap is an example)

Thanks

Costea

@jmoody
Copy link
Member

jmoody commented Jun 4, 2014

@nemesis

does not reset the device between scenarios.

You mention device. Did you mean simulator?

Resetting between scenarios is only available on the simulator.

@nemesis
Copy link
Author

nemesis commented Jun 4, 2014

@jmoody Yes, I mentioned the simulator. For now I have actually written a shell script that deletes the NSUserDefaults file.

@jarrodrobins
Copy link

Can anyone suggest a version of Calabash where resetting works or can provide a real workaround?

Unfortunately there's little point for me using this framework if I can't reset the application state between tests.

@jmoody
Copy link
Member

jmoody commented Jun 17, 2014

@jarrodrobins

I still have not been able to reproduce this locally. I am on vacation until June 27th. I've marked this a bug that needs attention.

Maybe someone can reproduce and submit a fix before then?

@jmoody
Copy link
Member

jmoody commented Jul 3, 2014

Sorry for the delay. I have been on vacation.

I have verified that the application content and settings are deleted when RESET_BETWEEN_SCENARIOS is set.

I think the problem is one of semantics and expectations.

@nemesis , @jarrodrobins

I think what you really want is the for the iOS Simulator Content and Settings to be reset.

Is this the case? You want the simulator to be reset?

If so, then call: reset_simulator_content_and_settings - this will simulate touching the iOS Simulator Menu Item.

I can see how this is confusing - the variable name matches a Menu Item in the iOS Simulator.

See this SO post for an example of how to reset either the application or the simulator.

http://stackoverflow.com/questions/24493634/reset-ios-app-in-calabash-ios/

In the course of investigating, I noticed some obvious bugs in the reset_app_jail implementation and some missing behaviors in the Calabash::Cucumber::Launcher class.

I will be submitting a pull request to address these.

@jmoody
Copy link
Member

jmoody commented Jul 20, 2014

UPDATE: I found a significant bug in reset_app_jail (now reset_app_sandbox): only apps with the latest SDK are reset. Working on a fix.

@jmoody
Copy link
Member

jmoody commented Sep 11, 2014

Fixed in 0.10.0.

@jmoody jmoody closed this as completed Sep 11, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants