From 4a04ac3a27ea8c4332d2169fa95cd29414865a34 Mon Sep 17 00:00:00 2001 From: Nate Kelley Date: Thu, 29 May 2025 19:21:28 -0600 Subject: [PATCH] more attempts for stable tests --- .../bar-chart-updates.test.ts | 5 +-- .../line-chart-axis-tests.spec.ts | 4 +++ .../question-helpers/question-config.ts | 35 ------------------- 3 files changed, 7 insertions(+), 37 deletions(-) delete mode 100644 web/playwright-tests/question-helpers/question-config.ts diff --git a/web/playwright-tests/bar-chart-updates.test.ts b/web/playwright-tests/bar-chart-updates.test.ts index 4e5fd55a0..cb419dd54 100644 --- a/web/playwright-tests/bar-chart-updates.test.ts +++ b/web/playwright-tests/bar-chart-updates.test.ts @@ -275,7 +275,8 @@ test.describe //can remove x axis from bar chart await page.getByTestId('edit-chart-button').getByRole('button').click(); - await page.locator('.relative > button').first().click(); + + await page.getByTestId('select-axis-drop-zone-xAxis').getByTestId('delete-button').click(); await expect(page.getByText('No valid axis selected')).toBeVisible(); //can drag a numeric column to x axis @@ -326,7 +327,7 @@ test.describe .filter({ hasText: 'Year' }) ).toBeVisible(); - await page.getByTestId('select-axis-drop-zone-xAxis').getByRole('button').nth(2).click(); + await page.getByTestId('select-axis-drop-zone-xAxis').getByTestId('delete-button').click(); await expect(page.getByRole('button', { name: 'Reset' })).toBeVisible(); await page.getByRole('button', { name: 'Reset' }).click(); await expect(page.getByRole('button', { name: 'Reset' })).not.toBeVisible(); diff --git a/web/playwright-tests/line-chart-axis-tests.spec.ts b/web/playwright-tests/line-chart-axis-tests.spec.ts index a42725488..cbaa50d7e 100644 --- a/web/playwright-tests/line-chart-axis-tests.spec.ts +++ b/web/playwright-tests/line-chart-axis-tests.spec.ts @@ -230,6 +230,10 @@ test.describe 'http://localhost:3000/app/metrics/635d9b06-afb1-5b05-8130-03c0b7a04bcb/chart?secondary_view=chart-edit' ); await page.getByTestId('segmented-trigger-Styling').click(); + await page.waitForTimeout(100); + await page.waitForLoadState('networkidle'); + await page.waitForLoadState('domcontentloaded'); + await page.waitForLoadState('load'); await page .locator('div') .filter({ hasText: /^Dot on lines$/ }) diff --git a/web/playwright-tests/question-helpers/question-config.ts b/web/playwright-tests/question-helpers/question-config.ts deleted file mode 100644 index c5d06ab7c..000000000 --- a/web/playwright-tests/question-helpers/question-config.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { ChartType } from '@/api/asset_interfaces'; - -type QuestionConfig = { - version: number; - selectedChartType: ChartType; - id: string; - description: string; -}; - -export const metricConfig: Record = { - 'Total Unique Products Sold': { - version: 1, - selectedChartType: ChartType.Metric, - id: '5316b39f-54ca-59b4-9102-9f581e1fa680', - description: 'Basic metric chart' - }, - 'Yearly Sales Revenue - Signature Cycles Products (Last 3 Years + YTD)': { - version: 1, - selectedChartType: ChartType.Bar, - id: '45c17750-2b61-5683-ba8d-ff6c6fefacee', - description: 'Bar chart with 1 dataset and 2 data points' - }, - 'Top 10 Most Active Vendors by Purchase Order Count (Last 3 Years)': { - version: 1, - selectedChartType: ChartType.Bar, - id: 'b401778a-bd93-53f4-b884-236aaf62c9a8', - description: 'Bar chart with 1 dataset and 2 data points it is horizontal' - }, - 'Yearly Sales Revenue by Product - Signature Cycles (2022-Present)': { - version: 1, - selectedChartType: ChartType.Bar, - id: '2b569e92-229b-5cad-b312-b09c751c544d', - description: 'Bar chart with 2 datasets and 2 data points it is vertical' - } -};