This repository has been archived by the owner on May 8, 2024. It is now read-only.
This release contains some small but useful improvements:
- all swag screens now make API calls, they are not blocking / erroring, but will show some nice results in the new Sauce Labs Real Devices Network Tab
- The data selected in the app (like sorting, cart content, sign in data, biometrics and so on) will stay in the app between sessions (killing it / removing it from the background and restarting it again). The data will be removed when the app will be removed.
But you might now think, my automated tests will fail if the data is not cleared! Well, we also thought about that. If you do a long press (minimal half a second) on the header icon
the store will be emptied. You can find the automation code on how to empty the store below or in this utils
.
const restartApp = async (): Promise<void> => {
if (!(driver.config as MobileConfig).firstAppStart) {
await driver.reset();
}
// Set the firstAppstart to false to say that the following test can be reset
(driver.config as MobileConfig).firstAppStart = false;
// Wait for the app to be ready and reset the state by clicking on the header image
const headerImage = await $(locatorStrategy('longpress reset app'));
await headerImage.waitForDisplayed();
if (driver.isIOS) {
return driver.execute('mobile: touchAndHold', {
elementId: headerImage.elementId,
duration: 1,
});
}
await driver.execute('mobile: longClickGesture', {
elementId: headerImage.elementId,
duration: 1000,
});
};
Happy Testing!!!