mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-27 02:46:15 -04:00
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:
parent
19ee8c2afa
commit
078324c0d1
35 changed files with 1702 additions and 1229 deletions
51
src/tests/frontend-new/specs/urls_become_clickable.spec.ts
Normal file
51
src/tests/frontend-new/specs/urls_become_clickable.spec.ts
Normal 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);
|
||||
});
|
||||
}
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue