2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-16 12:05:53 +00:00

add testing for new commands

This commit is contained in:
Matthias Mair
2024-04-09 22:20:10 +02:00
parent 58f4ef21cb
commit 968d4ba2b7

View File

@ -0,0 +1,36 @@
import { expect, test } from '@playwright/test';
test('test', async ({ page }) => {
await page.goto('./platform/');
await expect(page).toHaveTitle('InvenTree');
await page.waitForURL('**/platform/');
await page.getByLabel('username').fill('allaccess');
await page.getByLabel('password').fill('nolimits');
await page.getByRole('button', { name: 'Log in' }).click();
await page.waitForURL('**/platform');
await page.goto('./platform/');
await expect(page).toHaveTitle('InvenTree');
await page.waitForURL('**/platform/');
// wait for the page to load - 0.5s
await page.waitForTimeout(500);
// Open Spotlight with Keyboard Shortcut
await page.keyboard.press('Meta+K');
await page
.getByRole('button', { name: 'Dashboard Go to the InvenTree' })
.click();
await page
.locator('div')
.filter({ hasText: /^Dashboard$/ })
.click();
await page.waitForURL('**/platform/dashboard');
// Open Spotlight with Button
await page.getByRole('button', { name: 'Open spotlight' }).click();
await page.getByRole('button', { name: 'Home Go to the home page' }).click();
await page
.getByRole('heading', { name: 'Welcome to your Dashboard,' })
.click();
await page.waitForURL('**/platform');
});