2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-20 22:06:28 +00:00

Cleanup tests ()

This commit is contained in:
Oliver
2025-04-07 12:12:56 +10:00
committed by GitHub
parent 49680157a8
commit 3cd07c9da9
3 changed files with 11 additions and 5 deletions

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