-
Notifications
You must be signed in to change notification settings - Fork 1
feat: add e2e playwright tests #158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
| // If you later want the tests to start the local stack automatically, | ||
| // consider wiring a webServer here (e.g., make -C local up) and a custom | ||
| // timeout/wait condition. For now we expect the target site to be running. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| // If you later want the tests to start the local stack automatically, | |
| // consider wiring a webServer here (e.g., make -C local up) and a custom | |
| // timeout/wait condition. For now we expect the target site to be running. |
e2e/tests/error-pages.spec.ts
Outdated
| }); | ||
|
|
||
| test('admin route is protected (403 or login redirect) for anonymous', async ({ page, context }) => { | ||
| const res = await context.request.get('/admin', { maxRedirects: 0 }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Surely this won't work since we use custom admin paths and the purpose of that is to not reveal them, so we should probably leave this out.
e2e/tests/error-pages.spec.ts
Outdated
| const isLoginRedirect = status >= 300 && status < 400 && /\/user\/login/i.test(location); | ||
| expect(status === 403 || isLoginRedirect).toBeTruthy(); | ||
|
|
||
| await page.goto('/admin'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Surely this won't work since we use custom admin paths and the purpose of that is to not reveal them, so we should probably leave this out.
| expect(canonical, 'canonical link should exist').toBeTruthy(); | ||
|
|
||
| const robots = (await page.locator('meta[name="robots"]').getAttribute('content')) || ''; | ||
| expect(/noindex/i.test(robots)).toBeFalsy(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the README you mention testing against staging but this would fail then.
| - Node.js 18+ (20+ recommended) | ||
| - Browsers for Playwright (`npm run install:browsers`) | ||
| - The target site running locally or accessible via URL | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some of the local set up steps can also be called out as required more clearly, like having db and files in the correct local arrnagment
|
All of the Webkit tests fail for me. Do they work for you? |
| <head> | ||
| <head-placeholder token="{{ placeholder_token }}"> | ||
| <title>{{ head_title|safe_join(' | ') }}</title> | ||
| <meta name="robots" content="index, follow"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the purpose of adding this?
- It is the default behaviour, right?
- I'm just trying to be aware of how this might effect us blocking crawling and indexing of the staging site.
| use: { ...devices['Desktop Firefox'] } | ||
| }, | ||
| { | ||
| name: 'webkit', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Webkit just won't run correctly on my Linux machine. It is valuable to have here but when we push this to CI we might have issues there too, depending what environment we're running in.




PR Checklist
Fixes #123)Summary