Added playwright tests. (#6212)

* Added playwright tests.

* Added clear authorship color.

* Ported enter ts.

* Ported more tests.

* Commented helper tests.

* Fixed admin tests.

* Fixed.

* Fixed admin pages not there.

* Fixed waiting.

* Upload playwright report.

* Remove saucelabs

* Fixed waiting.

* Fixed upload artifact.

* Also install deps.

* Added retry mechanism.

* Added timeout for restart etherpad server.

* Fixed tests.

* Added frontend playwright tests.
This commit is contained in:
SamTV12345 2024-03-10 23:18:50 +01:00 committed by GitHub
parent db46ffb63b
commit c2699e4528
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
40 changed files with 1568 additions and 1285 deletions

View file

@ -0,0 +1,35 @@
import {Page} from "@playwright/test";
export const isSettingsShown = async (page: Page) => {
const classes = await page.locator('#settings').getAttribute('class')
return classes && classes.includes('popup-show')
}
export const showSettings = async (page: Page) => {
if(await isSettingsShown(page)) return
await page.locator("button[data-l10n-id='pad.toolbar.settings.title']").click()
await page.waitForFunction(`document.querySelector('#settings').classList.contains('popup-show')`)
}
export const hideSettings = async (page: Page) => {
if(!await isSettingsShown(page)) return
await page.locator("button[data-l10n-id='pad.toolbar.settings.title']").click()
await page.waitForFunction(`!document.querySelector('#settings').classList.contains('popup-show')`)
}
export const enableStickyChatviaSettings = async (page: Page) => {
const stickyChat = page.locator('#options-stickychat')
const checked = await stickyChat.isChecked()
if(checked) return
await stickyChat.check({force: true})
await page.waitForSelector('#options-stickychat:checked')
}
export const disableStickyChat = async (page: Page) => {
const stickyChat = page.locator('#options-stickychat')
const checked = await stickyChat.isChecked()
if(!checked) return
await stickyChat.uncheck({force: true})
await page.waitForSelector('#options-stickychat:not(:checked)')
}