mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-02-01 18:15:06 -05:00
68d690b6b9
Replaced manual login and context loading across tests with Playwright's `test.use` configuration for user authentication. This simplifies test setup, improves readability, and reduces repetition. For #6362 Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6400 Reviewed-by: Gusted <gusted@noreply.codeberg.org> Co-authored-by: Julian Schlarb <julian.schlarb@denktmit.de> Co-committed-by: Julian Schlarb <julian.schlarb@denktmit.de>
27 lines
904 B
TypeScript
27 lines
904 B
TypeScript
// @ts-check
|
|
import {expect} from '@playwright/test';
|
|
import {save_visual, test} from './utils_e2e.ts';
|
|
|
|
test.use({user: 'user2'});
|
|
|
|
test('Change git note', async ({page}) => {
|
|
let response = await page.goto('/user2/repo1/commit/65f1bf27bc3bf70f64657658635e66094edbcb4d');
|
|
expect(response?.status()).toBe(200);
|
|
|
|
await page.locator('#commit-notes-edit-button').click();
|
|
|
|
let textarea = page.locator('textarea[name="notes"]');
|
|
await expect(textarea).toBeVisible();
|
|
await textarea.fill('This is a new note');
|
|
await save_visual(page);
|
|
|
|
await page.locator('#notes-save-button').click();
|
|
await save_visual(page);
|
|
|
|
response = await page.goto('/user2/repo1/commit/65f1bf27bc3bf70f64657658635e66094edbcb4d');
|
|
expect(response?.status()).toBe(200);
|
|
|
|
textarea = page.locator('textarea[name="notes"]');
|
|
await expect(textarea).toHaveText('This is a new note');
|
|
await save_visual(page);
|
|
});
|