Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

E2E testing Add Review Customer #1055

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions petclinic-frontend/tests/CustomerAddReview.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
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: 'Visits' }).click();
await page.getByRole('button', { name: 'Leave a Review' }).click();
await page.getByRole('spinbutton').click();
await page.getByRole('spinbutton').fill('5');
await page.locator('input[name="reviewerName"]').click();
await page.locator('input[name="reviewerName"]').press('CapsLock');
await page.locator('input[name="reviewerName"]').fill('B');
await page.locator('input[name="reviewerName"]').press('CapsLock');
await page.locator('input[name="reviewerName"]').fill('Betty');
await page.locator('textarea[name="review"]').click();
await page.locator('textarea[name="review"]').press('CapsLock');
await page.locator('textarea[name="review"]').fill('V');
await page.locator('textarea[name="review"]').press('CapsLock');
await page.getByText('V', { exact: true }).fill('Very good!');
await page.getByRole('button', { name: 'Submit Review' }).click();
});
Loading