-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test for search product by name (#1041)
Test in front-end for search by inventory name.
- Loading branch information
Showing
1 changed file
with
18 additions
and
0 deletions.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
petclinic-frontend/tests/inventoriespage/searchInventoryByName.spec.ts
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,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(); | ||
}); |