1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2025-08-01 17:38:33 +00: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} from '@playwright/test';
import {test, login_user, load_logged_in_context} from './utils_e2e.ts';
import {test, save_visual, login_user, load_logged_in_context} from './utils_e2e.ts';
test('Follow actions', async ({browser}, workerInfo) => {
await login_user(browser, workerInfo, 'user2');
@ -29,6 +29,7 @@ test('Follow actions', async ({browser}, workerInfo) => {
await page.locator('.block').click();
await expect(page.locator('#block-user')).toBeVisible();
await save_visual(page);
await page.locator('#block-user .ok').click();
await expect(page.locator('.block')).toContainText('Unblock');
await expect(page.locator('#block-user')).toBeHidden();
@ -38,6 +39,7 @@ test('Follow actions', async ({browser}, workerInfo) => {
const flashMessage = page.locator('#flash-message');
await expect(flashMessage).toBeVisible();
await expect(flashMessage).toContainText('You cannot follow this user because you have blocked this user or this user has blocked you.');
await save_visual(page);
// Unblock interaction.
await page.locator('.block').click();