diff --git a/src/frontend/playwright.config.ts b/src/frontend/playwright.config.ts index 44ebbede66..e84e49110c 100644 --- a/src/frontend/playwright.config.ts +++ b/src/frontend/playwright.config.ts @@ -94,6 +94,9 @@ export default defineConfig({ use: { baseURL: 'http://localhost:5173', headless: IS_CI ? true : undefined, - trace: 'on-first-retry' + trace: 'on-first-retry', + contextOptions: { + reducedMotion: 'reduce' + } } }); diff --git a/src/frontend/tests/helpers.ts b/src/frontend/tests/helpers.ts index fb7b322840..443eff8dee 100644 --- a/src/frontend/tests/helpers.ts +++ b/src/frontend/tests/helpers.ts @@ -55,6 +55,7 @@ export const setTableChoiceFilter = async (page, filter, value) => { await page.getByPlaceholder('Select filter value').click(); await page.getByRole('option', { name: value }).click(); + await page.waitForLoadState('networkidle'); await closeFilterDrawer(page); }; diff --git a/src/frontend/tests/pui_plugins.spec.ts b/src/frontend/tests/pui_plugins.spec.ts index 228309cf0a..91402f20d2 100644 --- a/src/frontend/tests/pui_plugins.spec.ts +++ b/src/frontend/tests/pui_plugins.spec.ts @@ -4,7 +4,8 @@ import { clearTableFilters, clickOnRowMenu, loadTab, - navigate + navigate, + setTableChoiceFilter } from './helpers.js'; import { doCachedLogin } from './login.js'; import { setPluginState, setSettingState } from './settings.js'; @@ -68,20 +69,21 @@ test('Plugins - Functionality', async ({ browser }) => { url: 'settings/admin/plugin/' }); + // Filter plugins first await clearTableFilters(page); - await page.getByPlaceholder('Search').fill('sample'); - await page.waitForLoadState('networkidle'); + await setTableChoiceFilter(page, 'Sample', 'Yes'); + await setTableChoiceFilter(page, 'Builtin', 'No'); // Activate the plugin const cell = await page.getByText('Sample API Caller', { exact: true }); await clickOnRowMenu(cell); - await page.waitForTimeout(100); // Activate the plugin (unless already activated) if ((await page.getByRole('menuitem', { name: 'Deactivate' }).count()) == 0) { await page.getByRole('menuitem', { name: 'Activate' }).click(); await page.getByRole('button', { name: 'Submit' }).click(); await page.getByText('The plugin was activated').waitFor(); + await page.waitForTimeout(250); } // Deactivate the plugin again