From 953f95f601bc7211ef68d36d8e6e8c24d4f402f8 Mon Sep 17 00:00:00 2001 From: Hichem Date: Mon, 11 Nov 2024 17:41:53 -0500 Subject: [PATCH] Successful test in downloading a bill in PDF format --- petclinic-frontend/tests/billspage/test-1.spec.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 petclinic-frontend/tests/billspage/test-1.spec.ts diff --git a/petclinic-frontend/tests/billspage/test-1.spec.ts b/petclinic-frontend/tests/billspage/test-1.spec.ts new file mode 100644 index 000000000..4a2d43b2f --- /dev/null +++ b/petclinic-frontend/tests/billspage/test-1.spec.ts @@ -0,0 +1,14 @@ +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('george@email.com'); + await page.getByPlaceholder('Enter your email').press('Tab'); + await page.getByPlaceholder('Enter your password').fill('pwd'); + await page.getByRole('button', { name: 'Login' }).click(); + await page.getByRole('link', { name: 'Bills' }).click(); + const downloadPromise = page.waitForEvent('download'); + await page.getByRole('row', { name: 'a7c71008-30d9-4166-8344-' }).getByRole('button').click(); + const download = await downloadPromise; +}); \ No newline at end of file