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>
This commit is contained in:
silverwind
2026-04-19 19:27:23 +02:00
committed by GitHub
parent 284298f2a9
commit b31eef2828
5 changed files with 23 additions and 51 deletions

View File

@@ -1,67 +1,30 @@
import {env} from 'node:process';
import {test, expect} from '@playwright/test';
import {login, apiCreateRepo, apiCreateIssue, apiDeleteRepo, createProjectColumn, randomString, timeoutFactor} from './utils.ts';
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();
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),
));
await apiCreateIssue(page.request, user, repoName, {title: 'Column picker test'});
// Same ceiling as tests/e2e/events.test.ts; Playwright defaults are 5000*factor (see playwright.config.ts).
const slowTimeout = 15_000 * timeoutFactor;
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 Promise.all([
page.waitForResponse(
(resp) => resp.url().includes('/issues/projects') && resp.status() === 200,
{timeout: slowTimeout},
),
page.locator('.sidebar-project-combo .menu .item', {hasText: 'Kanban Board'}).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({timeout: slowTimeout});
await expect(columnCombo).toBeVisible();
await columnCombo.locator('.ui.dropdown').click();
await columnCombo.locator('.menu').waitFor({state: 'visible', timeout: slowTimeout});
const inProgressItem = columnCombo.locator('a.item', {hasText: 'In Progress'});
await expect(inProgressItem).toBeVisible({timeout: slowTimeout});
await inProgressItem.scrollIntoViewIfNeeded();
await Promise.all([
page.waitForResponse(
(resp) =>
resp.request().method() === 'POST' &&
resp.url().includes('/issues/projects/column') &&
resp.ok(),
{timeout: slowTimeout},
),
inProgressItem.click(),
]);
await expect(columnCombo.getByTestId('sidebar-project-column-text')).toContainText('In Progress', {
timeout: slowTimeout,
});
await expect(page.locator('.timeline-item', {hasText: 'moved this to In Progress'})).toBeVisible({
timeout: slowTimeout,
});
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);
});