tests: Disable Create review from commit flaky e2e test (#9049)

This test fails on unrelated changes (see for instance https://codeberg.org/forgejo/forgejo/actions/runs/98626/jobs/3 or #9047).
This defeats the purpose of such a test and hinders development for all Forgejo contributors, so I am proposing to disable it.

I have notified PR #7155 (which introduced it) about the need to fix it.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9049
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Antonin Delpeuch <antonin@delpeuch.eu>
Co-committed-by: Antonin Delpeuch <antonin@delpeuch.eu>
This commit is contained in:
Antonin Delpeuch 2025-08-28 12:50:23 +02:00 committed by Earl Warren
commit 9d896028bd

View file

@ -30,57 +30,59 @@ test('PR: Create review from files', async ({page}) => {
await save_visual(page); await save_visual(page);
}); });
test('PR: Create review from commit', async ({page}) => { // Test disabled because it is flaky.
const response = await page.goto('/user2/repo1/pulls/3/commits/4a357436d925b5c974181ff12a994538ddc5a269'); // TODO: re-enable it
expect(response?.status()).toBe(200); // test('PR: Create review from commit', async ({page}) => {
// const response = await page.goto('/user2/repo1/pulls/3/commits/4a357436d925b5c974181ff12a994538ddc5a269');
await page.locator('button.add-code-comment').click(); // expect(response?.status()).toBe(200);
const code_comment = page.locator('.comment-code-cloud form textarea.markdown-text-editor'); //
await expect(code_comment).toBeVisible(); // await page.locator('button.add-code-comment').click();
// const code_comment = page.locator('.comment-code-cloud form textarea.markdown-text-editor');
await code_comment.fill('This is a code comment'); // await expect(code_comment).toBeVisible();
await save_visual(page); //
// await code_comment.fill('This is a code comment');
const start_button = page.locator('.comment-code-cloud form button.btn-start-review'); // await save_visual(page);
// Workaround for #7152, where there might already be a pending review state from previous //
// test runs (most likely to happen when debugging tests). // const start_button = page.locator('.comment-code-cloud form button.btn-start-review');
if (await start_button.isVisible({timeout: 100})) { // // Workaround for #7152, where there might already be a pending review state from previous
await start_button.click(); // // test runs (most likely to happen when debugging tests).
} else { // if (await start_button.isVisible({timeout: 100})) {
await page.locator('.comment-code-cloud form button[name="pending_review"]').click(); // await start_button.click();
} // } else {
// await page.locator('.comment-code-cloud form button[name="pending_review"]').click();
await expect(page.locator('.comment-list .comment-container')).toBeVisible(); // }
//
// We need to wait for the review to be processed. Checking the comment counter // await expect(page.locator('.comment-list .comment-container')).toBeVisible();
// conveniently does that. //
await expect(page.locator('#review-box .js-btn-review > span.review-comments-counter')).toHaveText('1'); // // We need to wait for the review to be processed. Checking the comment counter
// // conveniently does that.
await page.locator('#review-box .js-btn-review').click(); // await expect(page.locator('#review-box .js-btn-review > span.review-comments-counter')).toHaveText('1');
await expect(page.locator('.tippy-box .review-box-panel')).toBeVisible(); //
await save_visual(page); // await page.locator('#review-box .js-btn-review').click();
// await expect(page.locator('.tippy-box .review-box-panel')).toBeVisible();
await page.locator('.review-box-panel textarea.markdown-text-editor') // await save_visual(page);
.fill('This is a review'); //
await page.locator('.review-box-panel button.btn-submit[value="approve"]').click(); // await page.locator('.review-box-panel textarea.markdown-text-editor')
await page.waitForURL(/.*\/user2\/repo1\/pulls\/3#issuecomment-\d+/); // .fill('This is a review');
await save_visual(page); // await page.locator('.review-box-panel button.btn-submit[value="approve"]').click();
// await page.waitForURL(/.*\/user2\/repo1\/pulls\/3#issuecomment-\d+/);
// In addition to testing the ability to delete comments, this also // await save_visual(page);
// performs clean up. If tests are run for multiple platforms, the data isn't reset //
// in-between, and subsequent runs of this test would fail, because when there already is // // In addition to testing the ability to delete comments, this also
// a comment, the on-hover button to start a conversation doesn't appear anymore. // // performs clean up. If tests are run for multiple platforms, the data isn't reset
await page.goto('/user2/repo1/pulls/3/commits/4a357436d925b5c974181ff12a994538ddc5a269'); // // in-between, and subsequent runs of this test would fail, because when there already is
await page.locator('.comment-header-right.actions a.context-menu').click(); // // a comment, the on-hover button to start a conversation doesn't appear anymore.
// await page.goto('/user2/repo1/pulls/3/commits/4a357436d925b5c974181ff12a994538ddc5a269');
await expect(page.locator('.comment-header-right.actions div.menu').getByText(/Copy link.*/)).toBeVisible(); // await page.locator('.comment-header-right.actions a.context-menu').click();
// The button to delete a comment will prompt for confirmation using a browser alert. //
page.on('dialog', (dialog) => dialog.accept()); // await expect(page.locator('.comment-header-right.actions div.menu').getByText(/Copy link.*/)).toBeVisible();
await page.locator('.comment-header-right.actions div.menu .delete-comment').click(); // // The button to delete a comment will prompt for confirmation using a browser alert.
// page.on('dialog', (dialog) => dialog.accept());
await expect(page.locator('.comment-list .comment-container')).toBeHidden(); // await page.locator('.comment-header-right.actions div.menu .delete-comment').click();
await save_visual(page); //
}); // await expect(page.locator('.comment-list .comment-container')).toBeHidden();
// await save_visual(page);
// });
test('PR: Navigate by single commit', async ({page}) => { test('PR: Navigate by single commit', async ({page}) => {
const response = await page.goto('/user2/repo1/pulls/3/commits'); const response = await page.goto('/user2/repo1/pulls/3/commits');