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

@ -1,6 +1,6 @@
import {Frame, Locator, Page} from "@playwright/test";
import {MapArrayType} from "../../../node/types/MapType";
import {randomInt} from "node:crypto";
import {randomUUID} from "node:crypto";
export const getPadOuter = async (page: Page): Promise<Frame> => {
return page.frame('ace_outer')!;
@ -115,7 +115,7 @@ export const appendQueryParams = async (page: Page, queryParameters: MapArrayTyp
export const goToNewPad = async (page: Page) => {
// create a new pad before each test run
const padId = "FRONTEND_TESTS"+randomInt(0, 1000);
const padId = "FRONTEND_TESTS"+randomUUID();
await page.goto('http://localhost:9001/p/'+padId);
await page.waitForSelector('iframe[name="ace_outer"]');
return padId;
@ -128,6 +128,8 @@ export const goToPad = async (page: Page, padId: string) => {
export const clearPadContent = async (page: Page) => {
const body = await getPadBody(page);
await body.click();
await page.keyboard.down('Control');
await page.keyboard.press('A');
await page.keyboard.up('Control');