mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-25 01:46:14 -04:00
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:
parent
db46ffb63b
commit
c2699e4528
40 changed files with 1568 additions and 1285 deletions
59
src/tests/frontend-new/admin-spec/adminsettings.spec.ts
Normal file
59
src/tests/frontend-new/admin-spec/adminsettings.spec.ts
Normal file
|
@ -0,0 +1,59 @@
|
|||
import {expect, test} from "@playwright/test";
|
||||
import {loginToAdmin, restartEtherpad, saveSettings} from "../helper/adminhelper";
|
||||
|
||||
test.beforeEach(async ({ page })=>{
|
||||
await loginToAdmin(page, 'admin', 'changeme1');
|
||||
})
|
||||
|
||||
test.describe('admin settings',()=> {
|
||||
|
||||
|
||||
test('Are Settings visible, populated, does save work', async ({page}) => {
|
||||
await page.goto('http://localhost:9001/admin/settings');
|
||||
await page.waitForSelector('.settings');
|
||||
const settings = page.locator('.settings');
|
||||
await expect(settings).not.toBeEmpty();
|
||||
|
||||
const settingsVal = await settings.inputValue()
|
||||
const settingsLength = settingsVal.length
|
||||
|
||||
await settings.fill(`/* test */\n${settingsVal}`)
|
||||
const newValue = await settings.inputValue()
|
||||
expect(newValue).toContain('/* test */')
|
||||
expect(newValue.length).toEqual(settingsLength+11)
|
||||
await saveSettings(page)
|
||||
|
||||
// Check if the changes were actually saved
|
||||
await page.reload()
|
||||
await page.waitForSelector('.settings');
|
||||
await expect(settings).not.toBeEmpty();
|
||||
|
||||
const newSettings = page.locator('.settings');
|
||||
|
||||
const newSettingsVal = await newSettings.inputValue()
|
||||
expect(newSettingsVal).toContain('/* test */')
|
||||
|
||||
|
||||
// Change back to old settings
|
||||
await newSettings.fill(settingsVal)
|
||||
await saveSettings(page)
|
||||
|
||||
await page.reload()
|
||||
await page.waitForSelector('.settings');
|
||||
await expect(settings).not.toBeEmpty();
|
||||
const oldSettings = page.locator('.settings');
|
||||
const oldSettingsVal = await oldSettings.inputValue()
|
||||
expect(oldSettingsVal).toEqual(settingsVal)
|
||||
expect(oldSettingsVal.length).toEqual(settingsLength)
|
||||
})
|
||||
|
||||
test('restart works', async function ({page}) {
|
||||
await page.goto('http://localhost:9001/admin/settings');
|
||||
await page.waitForSelector('.settings')
|
||||
await restartEtherpad(page)
|
||||
await page.waitForSelector('.settings')
|
||||
const settings = page.locator('.settings');
|
||||
await expect(settings).not.toBeEmpty();
|
||||
await page.waitForSelector('.menu')
|
||||
});
|
||||
})
|
Loading…
Add table
Add a link
Reference in a new issue