Skip to content

Commit f80e041

Browse files
davinotdavidrwood-moz
authored andcommitted
Skip E2E calendar connection tests for now (#1447)
1 parent b788784 commit f80e041

File tree

7 files changed

+137
-138
lines changed

7 files changed

+137
-138
lines changed

test/e2e/package-lock.json

Lines changed: 89 additions & 60 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/e2e/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
"@playwright/test": "1.56.1",
2727
"@types/node": "^24.1.0",
2828
"browserstack-node-sdk": "^1.40.8",
29-
"dotenv": "^17.2.1"
29+
"dotenv": "^17.2.1",
30+
"date-fns": "4.1.0"
3031
}
3132
}

test/e2e/pages/booking-page.ts

Lines changed: 10 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -144,48 +144,33 @@ export class BookingPage {
144144
await this.bookApptBtn.click();
145145
}
146146

147-
/**
148-
* Verify the given appointment time slot text is displayed in the current page
149-
* @param expSlotDateStr Expected slot date string formatted as 'Friday, January 10, 2025'
150-
* @param expSlotTimeStr Expected time slot time string formatted as '14:30 PM AMERICA/TORONTO'
151-
*/
152-
async verifyRequestedSlotTextDisplayed(expSlotDateStr: string, expSlotTimeStr: string) {
153-
const slotDateDisplayText: Locator = this.page.getByText(expSlotDateStr);
154-
await expect(slotDateDisplayText).toBeVisible({ timeout: TIMEOUT_30_SECONDS });
155-
const slotTimeDisplayText: Locator = this.page.getByText(`${expSlotTimeStr}`);
156-
await expect(slotTimeDisplayText).toBeVisible();
157-
const slotTimezoneDisplayText: Locator = this.page.getByText(APPT_TIMEZONE_SETTING_PRIMARY);
158-
await expect(slotTimezoneDisplayText).toBeVisible();
159-
}
160-
161147
/**
162148
* Utility to return a string containing the date abstracted from a given time slot string
163149
* @param timeSlotString Slot string read from DOM (ie. 'event-2025-01-14 14:30')
164-
* @returns Formatted date string (ie. 'January 14, 2025')
150+
* @returns Formatted date string month and day only (ie. 'Jan 14')
165151
*/
166152
async getDateFromSlotString(timeSlotString: string): Promise<string> {
167153
const selectedSlotDateTime = new Date(timeSlotString.substring(6));
168154

169155
const options:Intl.DateTimeFormatOptions = {
170-
year: "numeric",
171-
month: "long",
156+
month: "short",
172157
day: "numeric",
173158
};
174159

175160
return selectedSlotDateTime.toLocaleDateString('default', options);
176161
}
177162

178163
/**
179-
* Utility to return a string containg the time abstracted from a given time slot string.
180-
* The time in the given time slot string is in 24 hour format (i.e. 14:30), but we want
181-
* it to be like '02:30 PM'
164+
* Utility to return a string containing the event start time abstracted from a
165+
* given time slot string.
182166
* @param timeSlotString Slot string read from DOM (ie. 'event-2025-01-14 14:30')
183-
* @returns Formatted time string (ie. '02:30 PM')
167+
* @returns Formatted event start time string (ie. '02:30pm')
184168
*/
185-
async getTimeFromSlotString(timeSlotString: string): Promise<string> {
169+
async getStartTimeFromSlotString(timeSlotString: string): Promise<string> {
186170
const selectedSlotDateTime = new Date(timeSlotString.substring(6));
187-
const expTimeStr = selectedSlotDateTime.toLocaleTimeString('default', { hour12: true, hour: '2-digit', minute: '2-digit' });
188-
// now expTimeStr looks like this, for example: '04:30 p.m.' but need it to be like '04:30 PM'
189-
return expTimeStr.toUpperCase().replace('.', '').replace('.', '');
171+
var startTimeStr = selectedSlotDateTime.toLocaleTimeString('default', { hour12: true, hour: '2-digit', minute: '2-digit' });
172+
// now startTimeStr looks like this, for example: '04:30 p.m.' but need it to be like '04:30pm'
173+
startTimeStr = startTimeStr.replace(' ', '').replace('.', '').replace('.', '');
174+
return startTimeStr
190175
}
191176
}

0 commit comments

Comments
 (0)