1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2025-08-02 16:35:19 +02:00

tests(e2e): Generate more screenshots

- create screenshots on tests that create a custom page
- skip screenshot on a page that uses the default page (it is added
  automatically and already exists)
- replace a useless response wait and assert the correct page style
  instead
This commit is contained in:
Otto Richter 2024-12-07 18:38:06 +01:00
parent 5929b330e4
commit 840605cc75
14 changed files with 50 additions and 22 deletions

View file

@ -5,7 +5,7 @@
// @watch end
import {expect, type Page} from '@playwright/test';
import {test, login_user, login} from './utils_e2e.ts';
import {test, save_visual, login_user, login} from './utils_e2e.ts';
import {accessibilityCheck} from './shared/accessibility.ts';
test.beforeAll(async ({browser}, workerInfo) => {
@ -89,10 +89,12 @@ test('Username highlighted in commits', async ({browser}, workerInfo) => {
await expect(page.getByRole('link', {name: '@user2'})).toHaveCSS('background-color', /(.*)/);
await expect(page.getByRole('link', {name: '@user1'})).toHaveCSS('background-color', 'rgba(0, 0, 0, 0)');
await accessibilityCheck({page}, ['.commit-header'], [], []);
await save_visual(page);
// check second commit
await page.goto('/user2/mentions-highlighted/commits/branch/main');
await page.locator('tbody').getByRole('link', {name: 'Another commit which mentions'}).click();
await expect(page.getByRole('link', {name: '@user2'})).toHaveCSS('background-color', /(.*)/);
await expect(page.getByRole('link', {name: '@user1'})).toHaveCSS('background-color', 'rgba(0, 0, 0, 0)');
await accessibilityCheck({page}, ['.commit-header'], [], []);
await save_visual(page);
});