|
1 | 1 | import { test, expect } from '@playwright/test'; |
2 | 2 |
|
3 | | -// Use a new context for these tests without the stored auth state |
4 | | -test.use({ storageState: { cookies: [], origins: [] } }); |
5 | | - |
6 | | -test.beforeEach(async ({ page }) => { |
7 | | - await page.goto(process.env.REACT_APP_PLAYWRIGHT_URL); |
8 | | - await page.waitForLoadState('networkidle'); |
9 | | - await expect(page).toHaveTitle(/MapRoulette/); |
10 | | -}); |
11 | | - |
12 | | -test('should load find challenges page', async ({ page }) => { |
13 | | - await page.getByRole('navigation').getByRole('link', { name: 'Find Challenges' }).click(); |
14 | | - await expect(page.getByRole('heading', { name: 'Challenges' }).locator('span')).toBeVisible(); |
15 | | - await expect(page.locator('a').filter({ hasText: 'Sign in' })).toBeVisible(); |
16 | | -}); |
17 | | - |
18 | | -test('should load leaderboard page', async ({ page }) => { |
19 | | - await page.getByRole('navigation').getByRole('link', { name: 'Leaderboard' }).click(); |
20 | | - await page.waitForLoadState('networkidle'); |
21 | | -}); |
22 | | - |
23 | | -test('should load learn page', async ({ page }) => { |
24 | | - await page.getByRole('navigation').getByRole('link', { name: 'Learn' }).click(); |
25 | | - await page.waitForLoadState('networkidle'); |
26 | | -}); |
27 | | - |
28 | | -test('should load blog page', async ({ page }) => { |
29 | | - await page.getByRole('navigation').getByRole('link', { name: 'Blog' }).click(); |
30 | | - await page.waitForLoadState('networkidle'); |
31 | | -}); |
32 | | - |
33 | | -test('should load donate page', async ({ page }) => { |
34 | | - await page.getByRole('navigation').getByRole('link', { name: 'Donate' }).click(); |
35 | | - await page.waitForLoadState('networkidle'); |
| 3 | +// Create a new test fixture that doesn't use the stored auth state |
| 4 | +test.describe('Logged out navigation', () => { |
| 5 | + // Use a new context for these tests without the stored auth state |
| 6 | + test.use({ storageState: { cookies: [], origins: [] } }); |
| 7 | + |
| 8 | + test.beforeEach(async ({ page }) => { |
| 9 | + await page.goto(process.env.REACT_APP_PLAYWRIGHT_URL); |
| 10 | + await page.waitForLoadState('networkidle'); |
| 11 | + await expect(page).toHaveTitle(/MapRoulette/); |
| 12 | + }); |
| 13 | + |
| 14 | + test('should load find challenges page', async ({ page }) => { |
| 15 | + await page.getByRole('navigation').getByRole('link', { name: 'Find Challenges' }).click(); |
| 16 | + await expect(page.getByRole('heading', { name: 'Challenges' }).locator('span')).toBeVisible(); |
| 17 | + await expect(page.locator('a').filter({ hasText: 'Sign in' })).toBeVisible(); |
| 18 | + }); |
| 19 | + |
| 20 | + test('should load leaderboard page', async ({ page }) => { |
| 21 | + await page.getByRole('navigation').getByRole('link', { name: 'Leaderboard' }).click(); |
| 22 | + await page.waitForLoadState('networkidle'); |
| 23 | + }); |
| 24 | + |
| 25 | + test('should load learn page', async ({ page }) => { |
| 26 | + await page.getByRole('navigation').getByRole('link', { name: 'Learn' }).click(); |
| 27 | + await page.waitForLoadState('networkidle'); |
| 28 | + }); |
| 29 | + |
| 30 | + test('should load blog page', async ({ page }) => { |
| 31 | + await page.getByRole('navigation').getByRole('link', { name: 'Blog' }).click(); |
| 32 | + await page.waitForLoadState('networkidle'); |
| 33 | + }); |
| 34 | + |
| 35 | + test('should load donate page', async ({ page }) => { |
| 36 | + await page.getByRole('navigation').getByRole('link', { name: 'Donate' }).click(); |
| 37 | + await page.waitForLoadState('networkidle'); |
| 38 | + }); |
36 | 39 | }); |
37 | 40 |
|
0 commit comments