Skip to content

Commit 1cbc8cc

Browse files
committed
More updates
1 parent adcbe0a commit 1cbc8cc

File tree

3 files changed

+11
-40
lines changed

3 files changed

+11
-40
lines changed

test/e2e/pages/settings-page.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ export class SettingsPage {
3030
readonly displayNameInput: Locator;
3131
readonly bookingPageURLInput: Locator;
3232
readonly copyLinkBtn: Locator;
33+
readonly copyLinkToolTipText: Locator;
3334
readonly cancelServiceBtn: Locator;
3435
readonly cancelServiceConfirmCancelBtn: Locator;
3536
readonly bookingPageSettingsBtn: Locator;
@@ -68,6 +69,7 @@ export class SettingsPage {
6869
this.displayNameInput = this.page.locator('#booking-page-display-name');
6970
this.bookingPageURLInput = this.page.locator('#booking-page-url');
7071
this.copyLinkBtn = this.page.locator('#copy-booking-page-url-button');
72+
this.copyLinkToolTipText = this.page.locator('#tooltip-body');
7173
this.cancelServiceBtn = this.page.getByRole('button', { name: 'Cancel Service' });
7274
this.cancelServiceConfirmCancelBtn = this.page.getByRole('button', { name: 'Cancel', exact: true });
7375
this.bookingPageSettingsBtn = this.page.getByRole('button', { name: 'Booking Page Settings' });

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

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import {
1212
APPT_MY_SHARE_LINK,
1313
TIMEOUT_1_SECOND,
1414
TIMEOUT_30_SECONDS,
15-
TIMEOUT_3_SECONDS,
1615
} from '../../const/constants';
1716

1817
let settingsPage: SettingsPage;
@@ -46,24 +45,10 @@ test.describe('account settings on desktop browser', {
4645
await settingsPage.bookingPageURLInput.scrollIntoViewIfNeeded();
4746
expect(await settingsPage.bookingPageURLInput.inputValue()).toBe(APPT_MY_SHARE_LINK);
4847

49-
// click copy link button and verify copied link is correct
50-
// note: we can't access clipboard in firefox b/c of security so instead we will:
51-
// - get the contents of the booking page URL input field (correct link)
52-
// - click the copy link button
53-
// - clear the booking page URL input field so it is empty
54-
// - focus on the booking page URL input field
55-
// - do a keyboard paste into the field
56-
// - retrieve the new contents of the booking page url after the paste into that field
57-
// - verify the input field now has the correct link url
58-
const correctBookingUrl = await settingsPage.bookingPageURLInput.inputValue();
48+
// ensure we can click the copy link button; note: we can't access clipboard in firefox b/c of security
49+
await settingsPage.scrollIntoView(settingsPage.copyLinkBtn);
50+
await expect(settingsPage.copyLinkBtn).toBeEnabled();
5951
await settingsPage.copyLinkBtn.click();
60-
await settingsPage.bookingPageURLInput.clear();
61-
await page.waitForTimeout(TIMEOUT_1_SECOND);
62-
await settingsPage.bookingPageURLInput.focus();
63-
await page.keyboard.press('ControlOrMeta+V');
64-
await page.waitForTimeout(TIMEOUT_1_SECOND);
65-
const afterPasteBookingUrl = await settingsPage.bookingPageURLInput.inputValue();
66-
expect(afterPasteBookingUrl).toEqual(correctBookingUrl);
6752

6853
// just ensure the download your data button exists and is enabled as don't want to actually
6954
// download and leave potenial sensitive data on the test instance

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

Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import {
1313
TIMEOUT_1_SECOND,
1414
TIMEOUT_3_SECONDS,
1515
TIMEOUT_30_SECONDS,
16+
TIMEOUT_2_SECONDS,
1617
} from '../../const/constants';
1718

1819
let settingsPage: SettingsPage;
@@ -55,29 +56,12 @@ test.describe('account settings on mobile browser', {
5556
await settingsPage.scrollIntoView(settingsPage.bookingPageURLInput);
5657
expect(await settingsPage.bookingPageURLInput.inputValue()).toBe(APPT_MY_SHARE_LINK);
5758

58-
// click copy link button and verify copied link is correct
59-
// note: we can't access clipboard in firefox b/c of security so instead we will:
60-
// - get the contents of the booking page URL input field (correct link)
61-
// - click the copy link button
62-
// - clear the booking page URL input field so it is empty
63-
// - focus on the booking page URL input field
64-
// - do a keyboard paste into the field
65-
// - retrieve the new contents of the booking page url after the paste into that field
66-
// - verify the input field now has the correct link url
67-
const correctBookingUrl = await settingsPage.bookingPageURLInput.inputValue();
68-
await settingsPage.copyLinkBtn.click();
69-
await settingsPage.bookingPageURLInput.clear();
70-
await page.waitForTimeout(TIMEOUT_1_SECOND);
71-
await settingsPage.bookingPageURLInput.focus();
72-
// paste using keyboard, different command for ios
73-
if (testInfo.project.name.includes('ios')) {
74-
await page.keyboard.press('Meta+V');
75-
} else {
76-
await page.keyboard.press('ControlOrMeta+V');
59+
// ensure we can click the copy link button; note: we can't access clipboard in firefox b/c of security
60+
await settingsPage.scrollIntoView(settingsPage.copyLinkBtn);
61+
if (!testInfo.project.name.includes('ios')) { // 'toBeEnabled' is not supported on BrowserStack for ios at least not yet
62+
await expect(settingsPage.copyLinkBtn).toBeEnabled();
7763
}
78-
await page.waitForTimeout(TIMEOUT_1_SECOND);
79-
const afterPasteBookingUrl = await settingsPage.bookingPageURLInput.inputValue();
80-
expect(afterPasteBookingUrl).toEqual(correctBookingUrl);
64+
await settingsPage.copyLinkBtn.click();
8165

8266
// just ensure the download your data button exists and is enabled as don't want to actually
8367
// download and leave potenial sensitive data on the test instance

0 commit comments

Comments
 (0)