mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-05-05 14:47:12 -04:00
Fixed tests.
This commit is contained in:
parent
6fa9e1e673
commit
2ef1bba203
5 changed files with 14 additions and 11 deletions
1
.github/workflows/frontend-admin-tests.yml
vendored
1
.github/workflows/frontend-admin-tests.yml
vendored
|
@ -137,7 +137,6 @@ jobs:
|
|||
pnpm exec playwright install
|
||||
pnpm exec playwright install-deps
|
||||
pnpm run test-admin
|
||||
- uses: actions/upload-artifact@v4
|
||||
- uses: actions/upload-artifact@v4
|
||||
if: always()
|
||||
with:
|
||||
|
|
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -27,3 +27,4 @@ pnpm-lock.yaml
|
|||
/src/templates/admin
|
||||
/src/test-results
|
||||
playwright-report
|
||||
state.json
|
||||
|
|
|
@ -5,7 +5,7 @@ export const LoadingScreen = ()=>{
|
|||
const showLoading = useStore(state => state.showLoading)
|
||||
|
||||
return <Dialog.Root open={showLoading}><Dialog.Portal>
|
||||
<Dialog.Overlay className="fixed inset-0 bg-black bg-opacity-50 z-50 dialog-overlay" />
|
||||
<Dialog.Overlay className="loading-screen fixed inset-0 bg-black bg-opacity-50 z-50 dialog-overlay" />
|
||||
<Dialog.Content className="fixed top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 z-50 dialog-content">
|
||||
<div className="flex flex-col items-center">
|
||||
<div className="animate-spin w-16 h-16 border-t-2 border-b-2 border-[--fg-color] rounded-full"></div>
|
||||
|
|
|
@ -49,10 +49,11 @@ test.describe('admin settings',()=> {
|
|||
|
||||
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.waitForTimeout(1000)
|
||||
await page.waitForSelector('.menu')
|
||||
});
|
||||
})
|
||||
|
|
|
@ -1,9 +1,4 @@
|
|||
import {Page} from "@playwright/test";
|
||||
|
||||
export const goToAdminPage = async (page: Page) => {
|
||||
|
||||
}
|
||||
|
||||
import {expect, Page} from "@playwright/test";
|
||||
|
||||
export const loginToAdmin = async (page: Page, username: string, password: string) => {
|
||||
|
||||
|
@ -24,7 +19,14 @@ export const saveSettings = async (page: Page) => {
|
|||
|
||||
export const restartEtherpad = async (page: Page) => {
|
||||
// Click restart
|
||||
await page.locator('.settings-button-bar').locator('button').nth(1).click()
|
||||
await page.waitForTimeout(100)
|
||||
const restartButton = page.locator('.settings-button-bar').locator('.settingsButton').nth(1)
|
||||
const settings = page.locator('.settings');
|
||||
await expect(settings).not.toBeEmpty();
|
||||
await expect(restartButton).toBeVisible()
|
||||
await page.locator('.settings-button-bar')
|
||||
.locator('.settingsButton')
|
||||
.nth(1)
|
||||
.click()
|
||||
await page.waitForTimeout(500)
|
||||
await page.waitForSelector('.settings')
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue