diff --git a/src/playwright.config.ts b/src/playwright.config.ts index 0592b63c6..f5a103ce6 100644 --- a/src/playwright.config.ts +++ b/src/playwright.config.ts @@ -10,9 +10,9 @@ export default defineConfig({ /* Run tests in files in parallel */ fullyParallel: true, /* Fail the build on CI if you accidentally left test.only in the source code. */ - forbidOnly: !!process.env.CI, /* Reporter to use. See https://playwright.dev/docs/test-reporters */ reporter: 'html', + retries: 3, /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */ use: { /* Base URL to use in actions like `await page.goto('/')`. */ diff --git a/src/tests/frontend-new/admin-spec/adminsettings.spec.ts b/src/tests/frontend-new/admin-spec/adminsettings.spec.ts index 035d9caa0..b9e581725 100644 --- a/src/tests/frontend-new/admin-spec/adminsettings.spec.ts +++ b/src/tests/frontend-new/admin-spec/adminsettings.spec.ts @@ -53,5 +53,6 @@ test.describe('admin settings',()=> { await page.waitForSelector('.settings') const settings = page.locator('.settings'); await expect(settings).not.toBeEmpty(); + await page.waitForTimeout(1000) }); }) diff --git a/src/tests/frontend-new/admin-spec/adminupdateplugins.spec.ts b/src/tests/frontend-new/admin-spec/adminupdateplugins.spec.ts index a85aa950d..591448636 100644 --- a/src/tests/frontend-new/admin-spec/adminupdateplugins.spec.ts +++ b/src/tests/frontend-new/admin-spec/adminupdateplugins.spec.ts @@ -31,7 +31,9 @@ test.describe('Plugins page', ()=> { test('Attempt to Install and Uninstall a plugin', async ({page}) => { await page.waitForSelector('.search-field'); const pluginTable = page.locator('table tbody').nth(1); - await expect(pluginTable).not.toBeEmpty() + await expect(pluginTable).not.toBeEmpty({ + timeout: 15000 + }) const plugins = await pluginTable.locator('tr').count() expect(plugins).toBeGreaterThan(10) diff --git a/src/tests/frontend-new/helper/adminhelper.ts b/src/tests/frontend-new/helper/adminhelper.ts index 1e85038e4..66bb5336f 100644 --- a/src/tests/frontend-new/helper/adminhelper.ts +++ b/src/tests/frontend-new/helper/adminhelper.ts @@ -6,18 +6,9 @@ export const goToAdminPage = async (page: Page) => { export const loginToAdmin = async (page: Page, username: string, password: string) => { - const maxAttempts = 10; - let currentAttempt = 0; - let success = false; - while (!success && currentAttempt < maxAttempts) { - try { - await page.goto('http://localhost:9001/admin'); - success = true; // If the page loads successfully, set success to true - } catch (error) { - currentAttempt++; - } - } + await page.goto('http://localhost:9001/admin/'); + await page.waitForSelector('input[name="username"]'); await page.fill('input[name="username"]', username); await page.fill('input[name="password"]', password);