Skip to content

Commit adcbe0a

Browse files
committed
Post-review updates
1 parent 17072d8 commit adcbe0a

File tree

8 files changed

+37
-21
lines changed

8 files changed

+37
-21
lines changed

test/e2e/pages/settings-page.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import {
99
TIMEOUT_30_SECONDS,
1010
APPT_LANGUAGE_SETTING_EN,
1111
} from '../const/constants';
12-
import test from 'node:test';
1312

1413

1514
export class SettingsPage {
@@ -205,7 +204,7 @@ export class SettingsPage {
205204
* Change the start of week setting
206205
*/
207206
async changeStartOfWeekSetting(startOfWeek: string) {
208-
await this.startOfWeekMondayBtn
207+
await this.scrollIntoView(this.startOfWeekMondayBtn);
209208
await this.page.waitForTimeout(TIMEOUT_1_SECOND);
210209
if (startOfWeek == 'M') {
211210
await this.startOfWeekMondayBtn.click({ timeout: TIMEOUT_30_SECONDS });

test/e2e/tests/mobile/settings-account.spec.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,11 @@ test.describe('account settings on mobile browser', {
9898
await expect(availabilityPage.setAvailabilityText).toBeVisible();
9999
});
100100

101-
test.afterAll(async ({ browser }) => {
102-
// close the browser when we're done, BrowserStack needs this or may report BROWSERSTACK_IDLE_TIMEOUT
103-
await browser.close();
101+
test.afterAll(async ({ browser }, testInfo) => {
102+
// close the browser when we're done (good practice for BrowserStack); only do this for BrowserStack,
103+
// because if we do this when running on a local playwright mobile viewport the tests will fail
104+
if (!testInfo.project.name.includes('View')) {
105+
await browser.close();
106+
}
104107
});
105108
});

test/e2e/tests/mobile/settings-connected-apps.spec.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,11 @@ test.describe('settings - connected applications on mobile browser', {
7171
await settingsPage.gotoConnectedAppSettings();
7272
});
7373

74-
test.afterAll(async ({ browser }) => {
75-
// close the browser when we're done, BrowserStack needs this or may report BROWSERSTACK_IDLE_TIMEOUT
76-
await browser.close();
74+
test.afterAll(async ({ browser }, testInfo) => {
75+
// close the browser when we're done (good practice for BrowserStack); only do this for BrowserStack,
76+
// because if we do this when running on a local playwright mobile viewport the tests will fail
77+
if (!testInfo.project.name.includes('View')) {
78+
await browser.close();
79+
}
7780
});
7881
});

test/e2e/tests/mobile/settings-language.spec.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,11 @@ test.describe('settings - language on mobile browser', {
6060
expect(localStore['language']).toBe(APPT_BROWSER_STORE_LANGUAGE_EN);
6161
});
6262

63-
test.afterAll(async ({ browser }) => {
64-
// close the browser when we're done, BrowserStack needs this or may report BROWSERSTACK_IDLE_TIMEOUT
65-
await browser.close();
63+
test.afterAll(async ({ browser }, testInfo) => {
64+
// close the browser when we're done (good practice for BrowserStack); only do this for BrowserStack,
65+
// because if we do this when running on a local playwright mobile viewport the tests will fail
66+
if (!testInfo.project.name.includes('View')) {
67+
await browser.close();
68+
}
6669
});
6770
});

test/e2e/tests/mobile/settings-start-of-week.spec.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,11 @@ test.describe('settings - start of week on mobile browser', {
5858
expect(localStore['startOfWeek']).toBe(APPT_BROWSER_STORE_START_WEEK_SUN);
5959
});
6060

61-
test.afterAll(async ({ browser }) => {
62-
// close the browser when we're done, BrowserStack needs this or may report BROWSERSTACK_IDLE_TIMEOUT
63-
await browser.close();
61+
test.afterAll(async ({ browser }, testInfo) => {
62+
// close the browser when we're done (good practice for BrowserStack); only do this for BrowserStack,
63+
// because if we do this when running on a local playwright mobile viewport the tests will fail
64+
if (!testInfo.project.name.includes('View')) {
65+
await browser.close();
66+
}
6467
});
6568
});

test/e2e/tests/mobile/settings-theme.spec.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,11 @@ test.describe('settings - theme on mobile browser', {
6060
expect(localStore['colourScheme']).toBe(APPT_BROWSER_STORE_THEME_LIGHT);
6161
});
6262

63-
test.afterAll(async ({ browser }) => {
64-
// close the browser when we're done, BrowserStack needs this or may report BROWSERSTACK_IDLE_TIMEOUT
65-
await browser.close();
63+
test.afterAll(async ({ browser }, testInfo) => {
64+
// close the browser when we're done (good practice for BrowserStack); only do this for BrowserStack,
65+
// because if we do this when running on a local playwright mobile viewport the tests will fail
66+
if (!testInfo.project.name.includes('View')) {
67+
await browser.close();
68+
}
6669
});
6770
});

test/e2e/tests/mobile/settings-timezone.spec.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,11 @@ test.describe('settings - timezone on mobile browser', {
5656
expect(localStore['timezone']).toBe(APPT_TIMEZONE_SETTING_PRIMARY);
5757
});
5858

59-
test.afterAll(async ({ browser }) => {
60-
// close the browser when we're done, BrowserStack needs this or may report BROWSERSTACK_IDLE_TIMEOUT
61-
await browser.close();
59+
test.afterAll(async ({ browser }, testInfo) => {
60+
// close the browser when we're done (good practice for BrowserStack); only do this for BrowserStack,
61+
// because if we do this when running on a local playwright mobile viewport the tests will fail
62+
if (!testInfo.project.name.includes('View')) {
63+
await browser.close();
64+
}
6265
});
6366
});

test/e2e/utils/utils.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import {
1919
TIMEOUT_5_SECONDS,
2020
TIMEOUT_60_SECONDS,
2121
} from "../const/constants";
22-
import { createDecipheriv } from "crypto";
2322

2423
const authFile = path.join(__dirname, '../test-results/.auth/user.json');
2524

0 commit comments

Comments
 (0)