Skip to content

Commit

Permalink
Add playwright tests
Browse files Browse the repository at this point in the history
  • Loading branch information
SchrodingersGat committed Nov 12, 2024
1 parent d964a0a commit 26d9cae
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/frontend/src/components/plugins/LocateItemButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export default function LocateItemButton({
{locateForm.modal}
<ActionButton
icon={<IconRadar />}
variant='transparent'
variant='outline'
size='lg'
tooltip={t`Locate Item`}
onClick={locateForm.open}
Expand Down
32 changes: 32 additions & 0 deletions src/frontend/tests/pui_plugins.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,3 +94,35 @@ test('Plugins - Custom Admin', async ({ page, request }) => {
await page.getByText('foo: bar').waitFor();
await page.getByText('hello: world').waitFor();
});

test('Plugins - Locate Item', async ({ page, request }) => {
await doQuickLogin(page, 'admin', 'inventree');

// Ensure that the sample location plugin is enabled
await setPluginState({
request,
plugin: 'samplelocate',
state: true
});

await page.waitForTimeout(500);

// Navigate to the "stock item" page
await page.goto(`${baseUrl}/stock/item/287/`);

// "Locate" this item
await page.getByLabel('action-button-locate-item').click();
await page.getByRole('button', { name: 'Submit' }).click();
await page.getByText('Item location requested').waitFor();

// Show the location
await page.getByLabel('breadcrumb-1-factory').click();
await page.waitForTimeout(500);

await page.getByLabel('action-button-locate-item').click();
await page.getByRole('button', { name: 'Submit' }).click();
await page.getByText('Item location requested').waitFor();

await page.waitForTimeout(2500);
return;
});

0 comments on commit 26d9cae

Please sign in to comment.