2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-04-27 19:16:44 +00:00

Cleanup tests (#9470)

This commit is contained in:
Oliver 2025-04-07 12:12:56 +10:00 committed by GitHub
parent 49680157a8
commit 3cd07c9da9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 11 additions and 5 deletions

View File

@ -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'
}
}
});

View File

@ -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);
};

View File

@ -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