From 6e3ff59a537c545d099fa2f590f4c8bab41c1d47 Mon Sep 17 00:00:00 2001 From: Edward <101204772+Edwxd@users.noreply.github.com> Date: Tue, 12 Nov 2024 12:29:17 -0500 Subject: [PATCH] e2etest/invt-ilyassg: Added E2E test for deleting supplies in inventories (#1048) Added E2E test for deleting supplies in inventories (Ilyass) Co-authored-by: Ilyass Gouriny <101289749+igouriny@users.noreply.github.com> Co-authored-by: Jessy Gjerek <118135201+J91-cloud@users.noreply.github.com> Co-authored-by: cgerard321 <57333167+cgerard321@users.noreply.github.com> --- .../deleteProductsInInventory.spec.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 petclinic-frontend/tests/inventoriespage/deleteProductsInInventory.spec.ts diff --git a/petclinic-frontend/tests/inventoriespage/deleteProductsInInventory.spec.ts b/petclinic-frontend/tests/inventoriespage/deleteProductsInInventory.spec.ts new file mode 100644 index 000000000..de41b7925 --- /dev/null +++ b/petclinic-frontend/tests/inventoriespage/deleteProductsInInventory.spec.ts @@ -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('admin@admin.com'); + await page.getByPlaceholder('Enter your password').click(); + await page.getByPlaceholder('Enter your password').fill('pwd'); + await expect(page.getByRole('button', { name: 'Login' })).toBeVisible(); + await page.getByRole('button', { name: 'Login' }).click(); + await expect(page.getByRole('link', { name: 'Inventories' })).toBeVisible(); + await page.getByRole('link', { name: 'Inventories' }).click(); + await page.getByText('Vaccines').click(); + await expect(page.getByRole('button', { name: 'Delete' }).first()).toBeVisible(); + await page.getByRole('button', { name: 'Delete' }).first().click(); + await expect(page.getByRole('button', { name: 'Confirm' })).toBeVisible(); + await page.getByRole('button', { name: 'Confirm' }).click(); +}); \ No newline at end of file