From 342ebfc25095841677c14d7c9de09ec9fd78164d Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Thu, 18 Apr 2024 00:44:26 +0200 Subject: [PATCH] add internal pricing test --- src/frontend/tests/pages/pui_part.spec.ts | 26 +++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/frontend/tests/pages/pui_part.spec.ts b/src/frontend/tests/pages/pui_part.spec.ts index b7a44697ea..7a151d90aa 100644 --- a/src/frontend/tests/pages/pui_part.spec.ts +++ b/src/frontend/tests/pages/pui_part.spec.ts @@ -77,3 +77,29 @@ test('PUI - Pages - Part - Pricing (Supplier)', async ({ page }) => { await target.click(); await page.waitForURL('**/purchasing/supplier-part/697/'); }); + +test('PUI - Pages - Part - Pricing (Internal)', async ({ page }) => { + await doQuickLogin(page); + + // Part + await page.goto(`${baseUrl}/part/65/pricing`); + await page.getByText('Part: M2x4 SHCS').waitFor(); + await page.getByRole('tab', { name: 'Part Pricing' }).click(); + await page.getByLabel('Part Pricing').getByText('Part Pricing').waitFor(); + await page.getByRole('button', { name: 'Pricing Overview' }).waitFor(); + await page.getByText('Last Updated').waitFor(); + await page.getByRole('button', { name: 'Purchase History' }).isDisabled(); + await page.getByRole('button', { name: 'Internal Pricing' }).isEnabled(); + await page.getByRole('button', { name: 'Supplier Pricing' }).isDisabled(); + + // Internal Pricing + await page.getByRole('button', { name: 'Internal Pricing' }).click(); + await page.getByRole('button', { name: 'Price Break Not sorted' }).waitFor(); + + // Internal Pricing - editing + await page.getByRole('row', { name: '1 NZ$' }).getByRole('button').click(); + await page.getByRole('menuitem', { name: 'Edit' }).click(); + await page.getByText('Part *M2x4 SHCSSocket head').click(); + await page.getByText('Part *M2x4 SHCSSocket head').click(); + await page.getByRole('button', { name: 'Submit' }).click(); +});