Ported more tests to playwright. (#6214)

* Ported more tests to playwright.

* Added language test.

* Fixed failing tests. Moved another test.

* Removed frontend tests.

* Splitted runners.

* Fixed runners.

* Split up into the different browser environments.

* Added github reporter.

* Added change user color test.
This commit is contained in:
SamTV12345 2024-03-12 17:45:47 +01:00 committed by GitHub
parent 19ee8c2afa
commit 078324c0d1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
35 changed files with 1702 additions and 1229 deletions

View file

@ -0,0 +1,51 @@
import {expect, test} from "@playwright/test";
import {clearPadContent, getPadBody, goToNewPad, writeToPad} from "../helper/padHelper";
test.beforeEach(async ({ page })=>{
await goToNewPad(page);
})
test.describe('entering a URL makes a link', function () {
for (const url of ['https://etherpad.org', 'www.etherpad.org', 'https://www.etherpad.org']) {
test(url, async function ({page}) {
const padBody = await getPadBody(page);
await clearPadContent(page)
const url = 'https://etherpad.org';
await writeToPad(page, url);
await expect(padBody.locator('div').first()).toHaveText(url);
await expect(padBody.locator('a')).toHaveText(url);
await expect(padBody.locator('a')).toHaveAttribute('href', url);
});
}
});
test.describe('special characters inside URL', async function () {
for (const char of '-:@_.,~%+/?=&#!;()[]$\'*') {
const url = `https://etherpad.org/${char}foo`;
test(url, async function ({page}) {
const padBody = await getPadBody(page);
await clearPadContent(page)
await padBody.click()
await clearPadContent(page)
await writeToPad(page, url);
await expect(padBody.locator('div').first()).toHaveText(url);
await expect(padBody.locator('a')).toHaveText(url);
await expect(padBody.locator('a')).toHaveAttribute('href', url);
});
}
});
test.describe('punctuation after URL is ignored', ()=> {
for (const char of ':.,;?!)]\'*') {
const want = 'https://etherpad.org';
const input = want + char;
test(input, async function ({page}) {
const padBody = await getPadBody(page);
await clearPadContent(page)
await writeToPad(page, input);
await expect(padBody.locator('a')).toHaveCount(1);
await expect(padBody.locator('a')).toHaveAttribute('href', want);
});
}
});