-
-
Notifications
You must be signed in to change notification settings - Fork 799
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add spotlight * [PUI] Quick commands pallet Fixes #5888 * add testing for new commands * add text input testing * only test backend if code changed * add trans files * fix testing text * always push coverage * add nav state to manage navigation state * add navigation action and test * make test faster * fix typo * use texts instead * fix tests for linux * use var to determine action key * Revert "use texts instead" This reverts commit 7771189. * add wait for input * split out keyboard based tests * split ou test * add upload * revert assert change * adjust reporting settings * ignore error code * fix reporter config * add full info suit (+tests) * make tests more accurate * license modal fixes * unify icons * add custom actions registering with removal on page refresh * only upload report data if the tests failed * Revert "add trans files" This reverts commit 28d96e0. * adjust url that iw waited for * try an await and body locator for keypresses * test registering addition actions * extend testing for actions * add doclink and test * merge tests * add modals test * use quick login * reduce diff * fix test * open packages too * expand to frontend * rnsure keys are unique * ensure no errors in console * add QR code modal too
- Loading branch information
Showing
3 changed files
with
79 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
import { test } from './baseFixtures.js'; | ||
import { doQuickLogin } from './login.js'; | ||
|
||
test('PUI - Modals as admin', async ({ page }) => { | ||
await doQuickLogin(page, 'admin', 'inventree'); | ||
|
||
// Fail on console error | ||
await page.on('console', (msg) => { | ||
if (msg.type() === 'error') test.fail(); | ||
}); | ||
|
||
// use server info | ||
await page.getByRole('button', { name: 'Open spotlight' }).click(); | ||
await page | ||
.getByRole('button', { | ||
name: 'Server Information About this Inventree instance' | ||
}) | ||
.click(); | ||
await page.getByRole('cell', { name: 'Instance Name' }).waitFor(); | ||
await page.getByRole('button', { name: 'Dismiss' }).click(); | ||
|
||
await page.waitForURL('**/platform/home'); | ||
|
||
// use license info | ||
await page.getByRole('button', { name: 'Open spotlight' }).click(); | ||
await page | ||
.getByRole('button', { | ||
name: 'License Information Licenses for dependencies of the service' | ||
}) | ||
.click(); | ||
await page.getByText('License Information').first().waitFor(); | ||
await page.getByRole('tab', { name: 'backend Packages' }).click(); | ||
await page.getByRole('button', { name: 'Babel BSD License' }).click(); | ||
await page.getByText('Copyright (c) 2013-2023 by').waitFor(); | ||
|
||
await page.getByRole('tab', { name: 'frontend Packages' }).click(); | ||
await page.getByRole('button', { name: '@sentry/utils MIT' }).click(); | ||
await page | ||
.getByLabel('@sentry/utilsMIT7.109.0') | ||
.getByText('Copyright (c) 2019 Sentry (') | ||
.waitFor(); | ||
|
||
await page | ||
.getByLabel('License Information') | ||
.getByRole('button') | ||
.first() | ||
.click(); | ||
|
||
// use about | ||
await page.getByRole('button', { name: 'Open spotlight' }).click(); | ||
await page | ||
.getByRole('button', { name: 'About InvenTree About the InvenTree org' }) | ||
.click(); | ||
await page.getByRole('cell', { name: 'InvenTree Version' }).click(); | ||
|
||
await page.goto('./platform/'); | ||
|
||
// qr code modal | ||
await page.getByRole('button', { name: 'Open QR code scanner' }).click(); | ||
await page | ||
.locator('div') | ||
.filter({ hasText: /^Scan QR code$/ }) | ||
.getByRole('button') | ||
.click(); | ||
await page.getByRole('button', { name: 'Open QR code scanner' }).click(); | ||
await page.getByRole('button', { name: 'Close modal' }).click(); | ||
await page.getByRole('button', { name: 'Open QR code scanner' }).click(); | ||
await page.waitForTimeout(500); | ||
await page | ||
.locator('div') | ||
.filter({ hasText: /^Scan QR code$/ }) | ||
.getByRole('button') | ||
.click(); | ||
}); |