Skip to content

Commit 6f63086

Browse files
committed
Fix e2e tests
1 parent d493aa9 commit 6f63086

2 files changed

Lines changed: 16 additions & 20 deletions

File tree

e2e/hero-header.spec.ts

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,19 @@ test.beforeEach(async ({ page }) => {
55
});
66

77
test.describe('Test Hero Header Navigation Links', () => {
8-
test('About us link should navigate to about us section', async ({
9-
page,
10-
}) => {
11-
await page.getByRole('link', { name: 'About us' }).click();
12-
await expect(page).toHaveURL('/#about-us');
8+
test('About us link should navigate to about us page', async ({ page }) => {
9+
await page.getByRole('link', { name: 'About Us' }).click();
10+
await expect(page).toHaveURL('/about');
1311
});
1412

15-
test('Events link should navigate to Events section', async ({ page }) => {
16-
await page.getByRole('link', { name: 'Events', exact: true }).click();
17-
await expect(page).toHaveURL('/#events');
13+
test('Events link should navigate to Events page', async ({ page }) => {
14+
await page.getByRole('link', { name: 'Workshops & Events' }).click();
15+
await expect(page).toHaveURL('/events');
1816
});
1917

20-
test('Contact link should navigate to Contact Us section', async ({
21-
page,
22-
}) => {
23-
await page.getByRole('link', { name: 'Contact' }).click();
24-
await expect(page).toHaveURL('/#contact-us');
18+
test('Community link should navigate to Community page', async ({ page }) => {
19+
await page.getByRole('link', { name: 'Community', exact: true }).click();
20+
await expect(page).toHaveURL('/community');
2521
});
2622

2723
test('Join Community link should open google form in new tab', async ({
@@ -31,11 +27,11 @@ test.describe('Test Hero Header Navigation Links', () => {
3127
const [newPage] = await Promise.all([
3228
context.waitForEvent('page'),
3329
page.waitForLoadState(),
34-
page.getByRole('link', { name: 'Join Community' }).click(),
30+
page.getByRole('link', { name: 'Join the Community' }).click(),
3531
]);
3632
await newPage.waitForLoadState('load');
37-
// Accept either the shortlink (bit.ly) or the final Google Forms URL
38-
expect(newPage.url()).toMatch(/^(https:\/\/)?(bit\.ly|docs\.google\.com)/);
33+
// Accept bit.ly shortlink, docs.google.com, or forms.gle redirect destinations
34+
expect(newPage.url()).toMatch(/^(https:\/\/)?(bit\.ly|docs\.google\.com|forms\.gle)/);
3935
});
4036

4137
test('Join ReactDevsKe link should open google form in new tab', async ({
@@ -48,7 +44,7 @@ test.describe('Test Hero Header Navigation Links', () => {
4844
page.getByRole('link', { name: 'Join ReactDevsKe' }).click(),
4945
]);
5046
await newPage.waitForLoadState('load');
51-
// Accept either the shortlink (bit.ly) or the final Google Forms URL
52-
expect(newPage.url()).toMatch(/^(https:\/\/)?(bit\.ly|docs\.google\.com)/);
47+
// Accept bit.ly shortlink, docs.google.com, or forms.gle redirect destinations
48+
expect(newPage.url()).toMatch(/^(https:\/\/)?(bit\.ly|docs\.google\.com|forms\.gle)/);
5349
});
5450
});

e2e/home.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ test.describe('Home page tests', () => {
1111
).toBeVisible();
1212
});
1313

14-
test("should show 'Join Community' button", async ({ page }) => {
14+
test("should show 'Join the Community' button", async ({ page }) => {
1515
await expect(
16-
page.getByRole('link', { name: 'Join Community' })
16+
page.getByRole('link', { name: 'Join the Community' })
1717
).toBeVisible();
1818
});
1919

0 commit comments

Comments
 (0)