Skip to content

How to always restart app between each individual UI test? #20

@skha83

Description

@skha83

By looking at the code and behavior of this library, it seems like it is designed to run every test using the same app instance and navigate between different test pages. Is it possible to achieve, that it restarts the app between every test? Atm. if I close the app after each test it will make an assert in the teardown method here

[TearDown]
public void UITestBaseTearDown()
{
if (App.AppState == ApplicationState.NotRunning)
{
SaveDeviceDiagnosticInfo();
Reset();
FixtureSetup();
// Assert.Fail will immediately exit the test which is desirable as the app is not
// running anymore so we can't capture any UI structures or any screenshots
Assert.Fail("The app was expected to be running still, investigate as possible crash");
}
because it expect the app has unexpectedly crashed and then it tries to restart the app and fails the given test because of the assert.

I'm pretty new to using Appium UI tests as I'm only starting to migrate our existing UI tests from Xamarin.UITest so I might have missed something

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions