mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-12-07 14:09:47 +00:00
Webkit and Mobile safari are comically unreliable, will fail for unexplainable reasons and are very hard to run locally in comparison with the other supported platforms. I do not remember the last time where these two platforms were able to catch a regression where the other platforms did not. I would like to stress, for the historical record, that many hours has been devoted into adjusting the tests and following best practices to make these two platforms more stable but despite those, IMO wasted, efforts these two platforms are causing many hours of wasted CPU time simply because they are flaky and make (new) contributors nervous if their change contains a regression or not. To my knowledge, the tests are not broken for these two platforms. If you go to the issue tracker you will not find issues by users that use these two platforms and report that Forgejo is broken. It does not reflect reality. This is the sunk cost fallacy, bite the bullet and agree that these platforms will not contribute positively to Forgejo's excellent test suite. Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/10103 Reviewed-by: Michael Kriese <michael.kriese@gmx.de> Reviewed-by: Mathieu Fenniak <mfenniak@noreply.codeberg.org> Reviewed-by: 0ko <0ko@noreply.codeberg.org> Co-authored-by: Gusted <postmaster@gusted.xyz> Co-committed-by: Gusted <postmaster@gusted.xyz>
45 lines
1.7 KiB
TypeScript
45 lines
1.7 KiB
TypeScript
// @watch start
|
|
// templates/repo/editor/edit.tmpl
|
|
// templates/repo/editor/patch.tmpl
|
|
// web_src/js/features/repo-editor.js
|
|
// web_src/css/modules/dialog.ts
|
|
// web_src/css/modules/dialog.css
|
|
// @watch end
|
|
|
|
import {expect} from '@playwright/test';
|
|
import {dynamic_id, test} from './utils_e2e.ts';
|
|
import {screenshot} from './shared/screenshots.ts';
|
|
|
|
test.use({user: 'user2'});
|
|
|
|
test('Dialog modal', async ({page}) => {
|
|
let response = await page.goto('/user2/repo1/_new/master', {waitUntil: 'domcontentloaded'});
|
|
expect(response?.status()).toBe(200);
|
|
|
|
const filename = `${dynamic_id()}.md`;
|
|
|
|
await page.getByPlaceholder('Name your fileā¦').fill(filename);
|
|
await page.locator('.monaco-editor').click();
|
|
await page.keyboard.type('Hi, nice to meet you. Can I talk about ');
|
|
|
|
await page.locator('.quick-pull-choice input[value="direct"]').click();
|
|
await page.getByRole('button', {name: 'Commit changes'}).click();
|
|
|
|
response = await page.goto(`/user2/repo1/_edit/master/${filename}`, {waitUntil: 'domcontentloaded'});
|
|
expect(response?.status()).toBe(200);
|
|
|
|
await page.locator('.monaco-editor-container').click();
|
|
await page.keyboard.press('ControlOrMeta+A');
|
|
await page.keyboard.press('Backspace');
|
|
|
|
await page.locator('#commit-button').click();
|
|
await screenshot(page);
|
|
await expect(page.locator('#edit-empty-content-modal')).toBeVisible();
|
|
|
|
await page.locator('#edit-empty-content-modal .cancel').click();
|
|
await expect(page.locator('#edit-empty-content-modal')).toBeHidden();
|
|
|
|
await page.locator('#commit-button').click();
|
|
await page.locator('#edit-empty-content-modal .ok').click();
|
|
await expect(page).toHaveURL(`/user2/repo1/src/branch/master/${filename}`);
|
|
});
|