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
65
src/tests/frontend-new/specs/italic.spec.ts
Normal file
65
src/tests/frontend-new/specs/italic.spec.ts
Normal file
|
@ -0,0 +1,65 @@
|
|||
import {expect, test} from "@playwright/test";
|
||||
import {clearPadContent, getPadBody, goToNewPad, writeToPad} from "../helper/padHelper";
|
||||
|
||||
test.beforeEach(async ({ page })=>{
|
||||
await goToNewPad(page);
|
||||
})
|
||||
|
||||
test.describe('italic some text', function () {
|
||||
|
||||
test('makes text italic using button', async function ({page}) {
|
||||
const padBody = await getPadBody(page);
|
||||
await padBody.click()
|
||||
await clearPadContent(page)
|
||||
|
||||
// get the first text element out of the inner iframe
|
||||
const $firstTextElement = padBody.locator('div').first();
|
||||
await $firstTextElement.click()
|
||||
await writeToPad(page, 'Foo')
|
||||
|
||||
// select this text element
|
||||
await padBody.click()
|
||||
await page.keyboard.press('Control+A');
|
||||
|
||||
// get the bold button and click it
|
||||
const $boldButton = page.locator('.buttonicon-italic');
|
||||
await $boldButton.click();
|
||||
|
||||
// ace creates a new dom element when you press a button, just get the first text element again
|
||||
const $newFirstTextElement = padBody.locator('div').first();
|
||||
|
||||
// is there a <i> element now?
|
||||
// expect it to be italic
|
||||
await expect($newFirstTextElement.locator('i')).toHaveCount(1);
|
||||
|
||||
|
||||
// make sure the text hasn't changed
|
||||
expect(await $newFirstTextElement.textContent()).toEqual(await $firstTextElement.textContent());
|
||||
});
|
||||
|
||||
test('makes text italic using keypress', async function ({page}) {
|
||||
const padBody = await getPadBody(page);
|
||||
await padBody.click()
|
||||
await clearPadContent(page)
|
||||
|
||||
// get the first text element out of the inner iframe
|
||||
const $firstTextElement = padBody.locator('div').first();
|
||||
|
||||
// select this text element
|
||||
await writeToPad(page, 'Foo')
|
||||
|
||||
await page.keyboard.press('Control+A');
|
||||
|
||||
await page.keyboard.press('Control+I');
|
||||
|
||||
// ace creates a new dom element when you press a button, just get the first text element again
|
||||
const $newFirstTextElement = padBody.locator('div').first();
|
||||
|
||||
// is there a <i> element now?
|
||||
// expect it to be italic
|
||||
await expect($newFirstTextElement.locator('i')).toHaveCount(1);
|
||||
|
||||
// make sure the text hasn't changed
|
||||
expect(await $newFirstTextElement.textContent()).toBe(await $firstTextElement.textContent());
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue