Skip to content

Commit

Permalink
playwright test updates
Browse files Browse the repository at this point in the history
  • Loading branch information
SchrodingersGat committed Jun 9, 2024
1 parent 1650597 commit cf19e71
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
2 changes: 2 additions & 0 deletions src/frontend/src/pages/part/pricing/PricingOverviewPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,10 @@ export default function PricingOverviewPanel({
/>
</Stack>
<BarChart
aria-label="pricing-overview-chart"
dataKey="title"
data={overviewData}
title={t`Pricing Overview`}
series={[
{ name: 'min_value', label: t`Minimum Value`, color: 'blue.6' },
{ name: 'max_value', label: t`Maximum Value`, color: 'teal.6' }
Expand Down
16 changes: 8 additions & 8 deletions src/frontend/tests/pages/pui_part.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,25 +29,25 @@ test('PUI - Pages - Part - Pricing (Nothing, BOM)', async ({ page }) => {
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');
});

Expand Down

0 comments on commit cf19e71

Please sign in to comment.