Skip to content

Commit 2104fe6

Browse files
committed
test(appium): disable noReset on Browserstack
1 parent a52237d commit 2104fe6

3 files changed

Lines changed: 16 additions & 2 deletions

File tree

appium/wdio.android.conf.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@ export const config: WebdriverIO.Config = {
1313
'appium:automationName': 'UiAutomator2',
1414
...(process.env.BUNDLE_ID ? { 'appium:appPackage': process.env.BUNDLE_ID } : {}),
1515
'appium:autoGrantPermissions': true,
16-
'appium:noReset': true,
16+
17+
// Browserstack doesn't allow acceptAlerts and noReset at the same time
18+
'appium:noReset': isLocal,
19+
1720
...(isLocal ? {} : { 'bstack:options': bstackOptions }),
1821

1922
// Disable ID locator autocompletion to avoid Flutter's Semantics(container:true) wrapping inputs in a View.

appium/wdio.ios.conf.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@ export const config: WebdriverIO.Config = {
1313
'appium:automationName': 'XCUITest',
1414
...(process.env.BUNDLE_ID ? { 'appium:bundleId': process.env.BUNDLE_ID } : {}),
1515
'appium:autoAcceptAlerts': true,
16-
'appium:noReset': true,
16+
17+
// Browserstack doesn't allow acceptAlerts and noReset at the same time
18+
'appium:noReset': isLocal,
19+
1720
...(isLocal ? {} : { 'bstack:options': bstackOptions }),
1821

1922
// Hide keyboard during session

appium/wdio.shared.conf.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,14 @@ export const sharedConfig: WebdriverIO.Config = {
5959
const externalId = sdkType === platform ? `appium-${sdkType}` : `appium-${sdkType}-${platform}`;
6060
await deleteUser(externalId);
6161
},
62+
after: async function (result) {
63+
const status = result === 0 ? 'passed' : 'failed';
64+
const reason = result === 0 ? 'All tests passed' : 'Test failures';
65+
await browser.executeScript(
66+
`browserstack_executor: ${JSON.stringify({ action: 'setSessionStatus', arguments: { status, reason } })}`,
67+
[],
68+
);
69+
},
6270
};
6371

6472
export { bstackOptions };

0 commit comments

Comments
 (0)