forgejo/tests/e2e/org-settings.test.e2e.ts
Gusted 0737196842 chore: remove webkit and mobile safari from playwright (#10103)
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>
2025-11-13 17:23:08 +01:00

61 lines
2.4 KiB
TypeScript

// @watch start
// templates/org/team/new.tmpl
// web_src/css/form.css
// web_src/js/features/org-team.js
// @watch end
import {expect} from '@playwright/test';
import {test} from './utils_e2e.ts';
import {screenshot} from './shared/screenshots.ts';
import {validate_form} from './shared/forms.ts';
test.use({user: 'user2'});
test('org team settings', async ({page}) => {
const response = await page.goto('/org/org3/teams/team1/edit');
expect(response?.status()).toBe(200);
await page.locator('input[name="permission"][value="admin"]').click();
await expect(page.locator('.hide-unless-checked')).toBeHidden();
await screenshot(page);
await page.locator('input[name="permission"][value="read"]').click();
await expect(page.locator('.hide-unless-checked')).toBeVisible();
await screenshot(page);
// we are validating the form here to include the part that could be hidden
await validate_form({page});
});
test('org add and remove team repositories', async ({page}) => {
const response = await page.goto('/org/org3/teams/team1/repositories');
expect(response?.status()).toBe(200);
// As this is a shared state between multiple runs, always add repo3 to have some initial state.
await page.getByPlaceholder('Search repos…').fill('repo3');
await page.getByRole('button', {name: 'Add', exact: true}).click();
await expect(page.getByText('org3/repo3')).toBeVisible();
// Open remove all dialog.
await page.getByRole('button', {name: 'Remove all'}).click();
await expect(page.locator('#removeall-repos-modal')).toBeVisible();
await screenshot(page, page.locator('#removeall-repos-modal'));
// Remove all repositories.
await page.getByRole('button', {name: 'Yes'}).click();
// Check that all repositories are removed.
await expect(page.getByText('No repositories could be accessed by this team.')).toBeVisible();
// Open add all dialog.
await page.getByRole('button', {name: 'Add all'}).click();
await expect(page.locator('#addall-repos-modal')).toBeVisible();
await screenshot(page, page.locator('#addall-repos-modal'));
// Addd all repositories.
await page.getByRole('button', {name: 'Yes'}).click();
// Check that there are three repositories.
await expect(page.getByText('No repositories could be accessed by this team.')).toBeHidden();
await expect(page.getByText('org3/repo3')).toBeVisible();
await expect(page.getByText('org3/repo21')).toBeVisible();
await expect(page.getByText('org3/repo5')).toBeVisible();
});