mirror of
https://github.com/inventree/InvenTree.git
synced 2026-08-13 00:46:15 +00:00
fix(frontend): Improve flakiness issues (#12617)
* small improvements to reduce flakiness * disable throtteling to fix flaking tests
This commit is contained in:
@@ -32,6 +32,7 @@ env:
|
||||
INVENTREE_STATIC_ROOT: /home/runner/work/InvenTree/test_inventree_static
|
||||
INVENTREE_BACKUP_DIR: /home/runner/work/InvenTree/test_inventree_backup
|
||||
INVENTREE_SITE_URL: http://localhost:8000
|
||||
INVENTREE_LOGIN_ATTEMPTS: 25
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
@@ -108,10 +108,16 @@ test('Transfer Order - Calendar', async ({ browser }) => {
|
||||
await navigate(page, 'stock/location/index/transfer-orders');
|
||||
await activateCalendarView(page);
|
||||
|
||||
// Export calendar data
|
||||
// Export calendar data - assert on download instead of notification
|
||||
await page.getByLabel('calendar-export-data').click();
|
||||
await page.getByRole('button', { name: 'Export', exact: true }).click();
|
||||
await page.getByText('Process completed successfully').waitFor();
|
||||
|
||||
const [download] = await Promise.all([
|
||||
page.waitForEvent('download'),
|
||||
page.getByRole('button', { name: 'Export', exact: true }).click()
|
||||
]);
|
||||
expect(download.suggestedFilename()).toMatch(
|
||||
/InvenTree_TransferOrder.*\.csv$/i
|
||||
);
|
||||
|
||||
// Required because we downloaded a file
|
||||
await page.context().close();
|
||||
|
||||
@@ -14,12 +14,7 @@ import { setSettingState } from './settings';
|
||||
|
||||
// Test hover form action in related fields
|
||||
test('Forms - Hover', async ({ browser }) => {
|
||||
const page = await doCachedLogin(browser, {
|
||||
user: stevenuser,
|
||||
url: 'purchasing/index/purchaseorders'
|
||||
});
|
||||
|
||||
// Patch user settings to ensure we can see "extra model info" on hover
|
||||
// Patch user settings to ensure we can see "extra model info" on hover; done before load to avoid flakiness
|
||||
const api = await createApi({
|
||||
username: stevenuser.username,
|
||||
password: stevenuser.testcred
|
||||
@@ -33,6 +28,11 @@ test('Forms - Hover', async ({ browser }) => {
|
||||
|
||||
expect(response.status()).toBe(200);
|
||||
|
||||
const page = await doCachedLogin(browser, {
|
||||
user: stevenuser,
|
||||
url: 'purchasing/index/purchaseorders'
|
||||
});
|
||||
|
||||
await page
|
||||
.getByRole('button', { name: 'action-button-add-purchase-' })
|
||||
.click();
|
||||
|
||||
@@ -368,17 +368,17 @@ test('Settings - Admin - Background Tasks', async ({ browser }) => {
|
||||
});
|
||||
|
||||
test('Settings - Admin - Barcode History', async ({ browser }) => {
|
||||
// Login with admin credentials
|
||||
const page = await doCachedLogin(browser, {
|
||||
user: adminuser
|
||||
});
|
||||
|
||||
// Ensure that the "save scans" setting is enabled
|
||||
// Ensure that the "save scans" setting is enabled; done before first load of test to reduce flakiness
|
||||
await setSettingState({
|
||||
setting: 'BARCODE_STORE_RESULTS',
|
||||
value: true
|
||||
});
|
||||
|
||||
// Login with admin credentials
|
||||
const page = await doCachedLogin(browser, {
|
||||
user: adminuser
|
||||
});
|
||||
|
||||
// Scan some barcodes (via API calls)
|
||||
const barcodes = ['ABC1234', 'XYZ5678', 'QRS9012'];
|
||||
const api = await createApi({});
|
||||
|
||||
Reference in New Issue
Block a user