From cf19e7112013e8b43575f188768560846539892c Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Sun, 9 Jun 2024 17:20:38 +1000 Subject: [PATCH] playwright test updates --- .../pages/part/pricing/PricingOverviewPanel.tsx | 2 ++ src/frontend/tests/pages/pui_part.spec.ts | 16 ++++++++-------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/frontend/src/pages/part/pricing/PricingOverviewPanel.tsx b/src/frontend/src/pages/part/pricing/PricingOverviewPanel.tsx index 80e220b79e9a..3d3c5b571b41 100644 --- a/src/frontend/src/pages/part/pricing/PricingOverviewPanel.tsx +++ b/src/frontend/src/pages/part/pricing/PricingOverviewPanel.tsx @@ -184,8 +184,10 @@ export default function PricingOverviewPanel({ /> { await page.getByRole('button', { name: 'BOM Pricing' }).isEnabled(); // Overview Graph - let graph = page.locator('#pricing-overview-chart'); + let graph = page.getByLabel('pricing-overview-chart'); await graph.waitFor(); await graph.getByText('$60').waitFor(); - await graph.getByText('BOM Pricing').waitFor(); - await graph.getByText('Overall Pricing').waitFor(); - await graph.locator('path').nth(1).hover(); - await page.getByText('min_value : $50').waitFor(); + await graph.locator('tspan').filter({ hasText: 'BOM Pricing' }).waitFor(); + await graph.locator('tspan').filter({ hasText: 'Overall Pricing' }).waitFor(); // BOM Pricing await page.getByRole('button', { name: 'BOM Pricing' }).click(); await page.getByText('Bar Chart').click(); - await page.getByText('total_price_min').waitFor(); await page.getByText('Pie Chart').click(); await page.getByRole('button', { name: 'Quantity Not sorted' }).waitFor(); await page.getByRole('button', { name: 'Unit Price Not sorted' }).waitFor(); // BOM Pricing - linkjumping - await page.getByText('Wood Screw').waitFor(); - await page.getByText('Wood Screw').click(); + await page + .getByLabel('BOM Pricing') + .getByRole('table') + .getByText('Wood Screw') + .click(); await page.waitForURL('**/part/98/pricing'); });