Files
gitea/tests/e2e/issue-project.test.ts
silverwind b31eef2828 Stabilize issue-project e2e test, increase timeout factor (#37297)
1. stabilize flaky e2e test from
2f5b5a9e9c
2. increase ci timeout factor to 4 as 3 was not enough
3. add a `e2e` category to files-changed so e2e-test-only changes
trigger ci

---
This PR was written with the help of Claude Opus 4.7

---------

Co-authored-by: Claude (Opus 4.7) <noreply@anthropic.com>
2026-04-19 17:27:23 +00:00

31 lines
1.8 KiB
TypeScript

import {env} from 'node:process';
import {test, expect} from '@playwright/test';
import {login, apiCreateRepo, apiCreateIssue, apiDeleteRepo, createProjectColumn, randomString} from './utils.ts';
test('assign issue to project and change column', async ({page}) => {
const repoName = `e2e-issue-project-${randomString(8)}`;
const user = env.GITEA_TEST_E2E_USER;
await Promise.all([login(page), apiCreateRepo(page.request, {name: repoName})]);
await page.goto(`/${user}/${repoName}/projects/new`);
await page.locator('input[name="title"]').fill('Kanban Board');
await page.getByRole('button', {name: 'Create Project'}).click();
const projectLink = page.locator('.milestone-list a', {hasText: 'Kanban Board'}).first();
await expect(projectLink).toBeVisible();
const href = await projectLink.getAttribute('href');
const projectID = href!.split('/').pop()!;
// columns created via POST because the web UI uses modals that are hard to drive
await Promise.all([
...['Backlog', 'In Progress', 'Done'].map((title) => createProjectColumn(page.request, user, repoName, projectID, title)),
apiCreateIssue(page.request, user, repoName, {title: 'Column picker test'}),
]);
await page.goto(`/${user}/${repoName}/issues/1`);
await page.locator('.sidebar-project-combo .ui.dropdown').click();
await page.locator('.sidebar-project-combo .menu a.item', {hasText: 'Kanban Board'}).click();
const columnCombo = page.locator('.sidebar-project-column-combo');
await expect(columnCombo).toBeVisible();
await columnCombo.locator('.ui.dropdown').click();
await columnCombo.locator('.menu a.item', {hasText: 'In Progress'}).click();
await expect(columnCombo.getByTestId('sidebar-project-column-text')).toHaveText('In Progress');
await apiDeleteRepo(page.request, user, repoName);
});