Skip to content

Commit

Permalink
Test for search product by name (#1041)
Browse files Browse the repository at this point in the history
Test in front-end for search by inventory name.
  • Loading branch information
Sunveerg authored Nov 12, 2024
1 parent f6ce8c5 commit b9b1598
Showing 1 changed file with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { test, expect } from '@playwright/test';

test('test', async ({ page }) => {
await page.goto('http://localhost:3000/users/login');
await page.getByPlaceholder('Enter your email').click();
await page.getByPlaceholder('Enter your email').fill('[email protected]');
await page.getByPlaceholder('Enter your password').click();
await page.getByPlaceholder('Enter your password').fill('pwd');
await page.getByRole('button', { name: 'Login' }).click();
await page.getByRole('link', { name: 'Inventories' }).click();
await page.getByRole('textbox').first().click();
await page.getByRole('textbox').first().press('CapsLock');
await page.getByRole('textbox').first().fill('M');
await page.getByRole('textbox').first().press('CapsLock');
await page.getByRole('cell', { name: 'M', exact: true }).getByRole('textbox').fill('Medical');
await page.getByRole('button', { name: 'Search' }).click();
await expect(page.getByText('Medical equipment', { exact: true })).toBeVisible();
});

0 comments on commit b9b1598

Please sign in to comment.