Skip to content

Commit

Permalink
Product Search Bar (#1050)
Browse files Browse the repository at this point in the history
**JIRA:** link to jira ticket
## Context:
What is the ticket about and why are we doing this change.

`Search method. When typing h in the search bar, horse saddle must be
showed. `

Co-authored-by: cgerard321 <[email protected]>
  • Loading branch information
J91-cloud and cgerard321 authored Nov 12, 2024
1 parent 6e3ff59 commit 149897d
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions petclinic-frontend/tests/productspage/searchProduct.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { test, expect } from '@playwright/test';

test('test', async ({ page }) => {
await page.goto('http://localhost:3000/users/login');

await page.waitForSelector('[placeholder="Enter your email"]');
await page.getByPlaceholder('Enter your email').click();
await page.getByPlaceholder('Enter your email').fill('[email protected]');

await page.waitForSelector('[placeholder="Enter your password"]');
await page.getByPlaceholder('Enter your password').click();
await page.getByPlaceholder('Enter your password').fill('pwd');

await page.getByRole('button', { name: 'Login' }).click();

await page.waitForSelector('role=link[name="Shop"]');
await page.getByRole('link', { name: 'Shop' }).click();

await page.waitForSelector('[placeholder="Search for a product..."]');
await page.getByPlaceholder('Search for a product...').click();
await page.getByPlaceholder('Search for a product...').fill('horse');

await page.waitForSelector('role=listitem >> text=Horse Saddle');
await expect(
page.getByRole('listitem').getByText('Horse Saddle')
).toBeVisible();
await page.close();
});

0 comments on commit 149897d

Please sign in to comment.