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

Allow to restart app without resetting the app data #4955

Closed
ghost opened this issue Apr 19, 2015 · 16 comments
Closed

Allow to restart app without resetting the app data #4955

ghost opened this issue Apr 19, 2015 · 16 comments
Labels
Android related to Android-native driver(s) Enhancement feature

Comments

@ghost
Copy link

ghost commented Apr 19, 2015

This is a feature request / suggestion to add a restart app command.

Use case:
I want to test that a user, who already has logged in before, sees a specific page when he reopens the app later.

I'm aware of the noReset capability. But I want to have this set to false because each test scenario should start with a clean state. I do this with the reset command.

I already have read the similar issues:

Let me know if this is something that could be added. I can try to implement it.

@triager triager added the Needs Triage bugs which are not yet confirmed label Apr 19, 2015
@jlipps jlipps removed their assignment Apr 22, 2015
@Jonahss
Copy link
Member

Jonahss commented May 8, 2015

Interesting yes. What about a single test, where you first start a driver with no-reset, start the app and immediately end the session. Then start a second driver (still in the same test) and this time no-reset is false so the next test starts fresh?

@ghost
Copy link
Author

ghost commented May 8, 2015

I use Sauce Labs. So I think that I cannot start a new session and use the state of the previous session.

@Jonahss
Copy link
Member

Jonahss commented May 8, 2015

Ah yes, that would certainly be a limitation.
@jlipps what do you think?

@jlipps
Copy link
Member

jlipps commented May 8, 2015

@sanjo can you just use driver.startApp with the package/activity of the home screen? then use it again with your app's package/activity. just wondering if that does the trick.

otherwise i'm wondering how we would restart the app with adb?

@Jonahss
Copy link
Member

Jonahss commented May 8, 2015

You could also press the home button. Then use startApp.

@sebv
Copy link
Member

sebv commented Jun 3, 2015

@sanjo does it answer your question? Or should we put this in new feature?

@sebv sebv added OnGoing and removed Needs Triage bugs which are not yet confirmed labels Jun 3, 2015
@kenkrzeminski
Copy link

This feature would be handy. I often write tests that need a quick way to reset the force quit the app on iOS and re-launch it, without clearing the session. When noReset is set to true, the old session is preserved in simulator. I experimented with various settings and commands including driver.update_settings (I'm using the Ruby lib) but nothing seemed to enable me to create a setup where the session is cleared on initializing the tests while allowing the app to be quit/re-launched during the tests.

Essentially, I need a clean slate at the start of a test run every single time, but the ability to quit and re-launch the app without clearing the session or restarting the simulator. This doesn't seem possible with iOS simulator at the moment.

@jlipps
Copy link
Member

jlipps commented Jun 8, 2015

how would you do this outside of appium?

@sebv
Copy link
Member

sebv commented Jun 12, 2015

Not sure if actionable, but moving to feature.

@sebv sebv added Enhancement feature Android related to Android-native driver(s) and removed OnGoing labels Jun 12, 2015
@sebv sebv added this to the Features milestone Jun 12, 2015
@toejough
Copy link

+1. exactly what @kenkrzeminski said.

In response to @jlipps - I'm not sure how to do it for ios, but for android, you quit the app (list open apps with the squarish icon, swipe your app off the screen), then go into the app menu and re-open your app.

@michaelz-slalom
Copy link

A year later, still looking for this functionality in iOS.

@jlipps jlipps added Enhancement feature and removed Needs Triage bugs which are not yet confirmed Bug a problem that needs fixing Enhancement feature labels Nov 10, 2016
@jlipps jlipps removed this from the Features milestone Nov 10, 2016
@reach2jeyan
Copy link

Is this fixed in android? I would exactly want what @sanjo mentioned in the first comment. Currently, I will have to have this sign up process each time I am running the scenario. no reset = true and full reset = false doesn't seem to help, as appium seems to every time reset the appdata before launching the application

I tried, removing the AppPath and have only the package name and launch activity name in appium, but, that is not closing the application.

I am running the tests with ruby with appium_lib. Is there a way, once I do the sign up, it would start the home page on the rest of my tests each time? This would prevent each time using the sign up account kit activity, plus save a lot of time.

@mayukataoka
Copy link

Noticing the same that @reach2jeyan described in Android.

@reach2jeyan
Copy link

@mayukataoka somehow fixed it with a workaround for now that I got from the appium community..

Force stopping the application with adb and starting it with

  app_hash = {
      app_package: '',
      app_activity: ''
  }
  appium_device.start_activity app_hash
end

So, mentioning this in the hooks.rb After each scenario I force stop the application and launch before each scenario, than reinstalling it.

@jlipps
Copy link
Member

jlipps commented Jul 20, 2017

going to close this as a duplicate of #3743. we already have a startActivity command which solves half of this problem. the other half can be solved by having a command to stop arbitrary apps, which is what #3743 covers.

@jlipps jlipps closed this as completed Jul 20, 2017
@lock
Copy link

lock bot commented Apr 26, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Apr 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Android related to Android-native driver(s) Enhancement feature
Projects
None yet
Development

No branches or pull requests

9 participants