Skip to content

Commit f4ca06f

Browse files
authored
playwrightFixes (#368)
1 parent 2d2fdfa commit f4ca06f

File tree

7 files changed

+344
-15
lines changed

7 files changed

+344
-15
lines changed

package-lock.json

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

tests/helpers/auth.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import type { Page } from "@playwright/test";
22

33
export async function login(page: Page) {
44
await page.goto("/");
5-
await page.waitForLoadState("networkidle");
5+
// await page.waitForLoadState("networkidle");
66

77
await page.fill('input[type="email"]', "demo@b1.church");
88
await page.fill('input[type="password"]', "password");

tests/sermons.spec.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,8 @@ test.describe('Sermons Management', () => {
252252
await expect(validatedDeletion).toHaveCount(0);
253253
});
254254

255-
test('should add navigation link', async ({ page }) => {
255+
/* FOLLOWING TESTS NO LONGER NEEDED:
256+
test('should add navigation link', async ({ page }) => {
256257
const settingsBtn = page.locator('[role="tablist"]').getByText('Settings');
257258
await settingsBtn.click();
258259
@@ -317,7 +318,7 @@ test.describe('Sermons Management', () => {
317318
await page.waitForTimeout(500);
318319
const validatedDeletion = page.locator('a').getByText('Harker Betker Fasker Stronker Test');
319320
await expect(validatedDeletion).toHaveCount(0);
320-
});
321+
}); */
321322

322323
test('should add sidebar tab', async ({ page }) => {
323324
const settingsBtn = page.locator('[role="tablist"]').getByText('Settings');
@@ -385,6 +386,7 @@ test.describe('Sermons Management', () => {
385386
await expect(validatedDeletion).toHaveCount(0);
386387
});
387388

389+
/* FOLLOWING TESTS NO LONGER NEEDED:
388390
test('should customize appearance', async ({ page }) => {
389391
const settingsBtn = page.locator('[role="tablist"]').getByText('Settings');
390392
await settingsBtn.click();
@@ -403,9 +405,9 @@ test.describe('Sermons Management', () => {
403405
const editBtn = page.locator('a').getByText('Edit Users');
404406
await editBtn.click();
405407
await expect(page).toHaveURL(/\/settings/);
406-
});
408+
}); */
407409

408-
test('should view your stream', async ({ page, context }) => {
410+
test.skip('should view your stream', async ({ page, context }) => {
409411
const settingsBtn = page.locator('[role="tablist"]').getByText('Settings');
410412
await settingsBtn.click();
411413
await page.waitForTimeout(500);

tests/serving.spec.ts

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -305,14 +305,32 @@ test.describe('Serving Management', () => {
305305
await expect(page).toHaveURL(/\/serving\/planTypes\/[^/]+/);
306306
await page.waitForTimeout(500);
307307

308-
const arrowBtn = page.locator('[d="m7 10 5 5 5-5z"]');
309-
await arrowBtn.click();
310-
const lessonBtn = page.locator('li').getByText('Schedule Lesson');
308+
/* const arrowBtn = page.locator('[d="m7 10 5 5 5-5z"]');
309+
await arrowBtn.click(); */
310+
const lessonBtn = page.locator('button').getByText('Schedule Lesson');
311311
await lessonBtn.click();
312-
await page.waitForTimeout(2500);
312+
/* await page.waitForTimeout(2500);
313313
const date = page.locator('[type="date"]');
314314
await date.fill('2025-03-01');
315-
await page.waitForTimeout(1000);
315+
await page.waitForTimeout(1000); */
316+
const selectBtn = page.locator('button [d="M21 5c-1.11-.35-2.33-.5-3.5-.5-1.95 0-4.05.4-5.5 1.5-1.45-1.1-3.55-1.5-5.5-1.5S2.45 4.9 1 6v14.65c0 .25.25.5.5.5.1 0 .15-.05.25-.05C3.1 20.45 5.05 20 6.5 20c1.95 0 4.05.4 5.5 1.5 1.35-.85 3.8-1.5 5.5-1.5 1.65 0 3.35.3 4.75 1.05.1.05.15.05.25.05.25 0 .5-.25.5-.5V6c-.6-.45-1.25-.75-2-1m0 13.5c-1.1-.35-2.3-.5-3.5-.5-1.7 0-4.15.65-5.5 1.5V8c1.35-.85 3.8-1.5 5.5-1.5 1.2 0 2.4.15 3.5.5z"]');
317+
await selectBtn.click();
318+
const moreContBtn = page.locator('div span').getByText('Lessons.church');
319+
await moreContBtn.click();
320+
const lessonsBtn = page.locator('[title="Lessons"]');
321+
await lessonsBtn.click();
322+
const arkPlan = page.locator('[title="Ark Kids Junior"]');
323+
await arkPlan.click();
324+
await page.waitForTimeout(500);
325+
const firstPlan = page.locator('[alt="Summer to the Max"]');
326+
await firstPlan.click();
327+
const firstLesson = page.locator('[title="Summer to the Max Week 1"]');
328+
await firstLesson.click();
329+
// await page.waitForTimeout(500);
330+
const group = page.locator('div p').getByText('Large Group');
331+
await group.click();
332+
const associateBtn = page.locator('button').getByText('Associate Lesson');
333+
await associateBtn.click();
316334
const saveBtn = page.locator('button').getByText('Save');
317335
await saveBtn.click();
318336
await page.waitForTimeout(1000);
@@ -940,11 +958,12 @@ test.describe('Serving Management', () => {
940958

941959
const song = page.locator('a').getByText('Frolic');
942960
await song.click();
943-
const addKeyBtn = page.locator('[role="tab"]');
961+
const addKeyBtn = page.locator('[role="tab"]').getByText('Add');
944962
await addKeyBtn.click();
945963
const saveBtn = page.locator('button').getByText('Save');
946964
await saveBtn.click();
947-
await expect(addKeyBtn).toHaveCount(2);
965+
const verifiedKeys = page.locator('[role="tab"]');
966+
await expect(verifiedKeys).toHaveCount(3);
948967
});
949968

950969
test('should add link from song key menu', async ({ page }) => {

tests/settings.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ test.describe('Settings Management', () => {
205205
});
206206

207207
test('should edit form', async ({ page }) => {
208-
const editBtn = page.locator('button').getByText('edit');
208+
const editBtn = page.locator('button').getByText('edit').last();
209209
await editBtn.click();
210210
await page.waitForTimeout(2000);
211211
const formName = page.locator('[name="name"]');
@@ -341,7 +341,7 @@ test.describe('Settings Management', () => {
341341
expect(dialog.message()).toContain('Are you sure');
342342
await dialog.accept();
343343
});
344-
344+
await page.waitForTimeout(500);
345345
const editBtn = page.locator('button').getByText('edit');
346346
await editBtn.click();
347347
await page.waitForTimeout(2000);

tests/website.spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ test.describe('Website Management', () => {
173173
await typeSelect.click();
174174
const saveBtn = page.locator('button').getByText('Save');
175175
await saveBtn.click();
176+
await page.waitForTimeout(500);
176177
const validatedBlock = page.locator('td').getByText('Octavian Test Block');
177178
await expect(validatedBlock).toHaveCount(1);
178179
});
@@ -427,7 +428,7 @@ test.describe('Website Management', () => {
427428

428429
const editBtn = page.locator('[aria-label="Manage Events"]').last();
429430
await editBtn.click();
430-
const removeBtn = page.locator('[aria-label="Adult Bible Class"]');
431+
const removeBtn = page.locator('[d="M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zM19 4h-3.5l-1-1h-5l-1 1H5v2h14z"]').first();
431432
await removeBtn.click();
432433
const validatedDeletion = page.locator('td').getByText('Adult Bible Class');
433434
await expect(validatedDeletion).toHaveCount(0);

0 commit comments

Comments
 (0)