final updates

This commit is contained in:
Nate Kelley 2025-05-29 18:51:10 -06:00
parent c9dd5665d2
commit b6193328f6
No known key found for this signature in database
GPG Key ID: FD90372AB8D98B4F
2 changed files with 28 additions and 43 deletions

View File

@ -64,9 +64,10 @@ test.describe
); );
await page.getByTestId('add-to-collection-button').click(); await page.getByTestId('add-to-collection-button').click();
const currentUrl = page.url(); const currentUrl = page.url();
await page await page
.getByRole('menuitemcheckbox', { name: 'Important Things' }) .getByRole('menuitemcheckbox', { name: 'Important Things' })
.getByRole('button') .getByRole('link')
.click(); .click();
await page.goto('http://localhost:3000/app/collections/0ac43ae2-beda-4007-9574-71a17425da0a'); await page.goto('http://localhost:3000/app/collections/0ac43ae2-beda-4007-9574-71a17425da0a');
expect(page.url()).not.toBe(currentUrl); expect(page.url()).not.toBe(currentUrl);
@ -318,9 +319,11 @@ test.describe
await page.mouse.up(); await page.mouse.up();
} }
await expect( await expect(
page.getByTestId('select-axis-drop-zone-xAxis').getByRole('button', { name: 'Year' }) page
.getByTestId('select-axis-drop-zone-xAxis')
.locator('button')
.filter({ hasText: 'Year' })
).toBeVisible(); ).toBeVisible();
await page.getByTestId('select-axis-drop-zone-xAxis').getByRole('button').nth(2).click(); await page.getByTestId('select-axis-drop-zone-xAxis').getByRole('button').nth(2).click();
@ -365,15 +368,17 @@ test.describe
sourceBoundingBox.y + dy * i + sourceBoundingBox.height / 2, sourceBoundingBox.y + dy * i + sourceBoundingBox.height / 2,
{ steps: 1 } { steps: 1 }
); );
await page.waitForTimeout(1); // Add a small delay between each movement await page.waitForTimeout(3); // Add a small delay between each movement
} }
await page.mouse.up(); await page.mouse.up();
} }
await page.getByRole('button', { name: 'Save' }).click(); await page.getByRole('button', { name: 'Save' }).click();
await page.waitForTimeout(100); await page.waitForTimeout(250);
await page.waitForLoadState('networkidle'); await page.waitForLoadState('networkidle');
await page.waitForLoadState('domcontentloaded');
await page.waitForLoadState('load');
page.reload(); page.reload();
@ -390,9 +395,12 @@ test.describe
page.reload(); page.reload();
await expect( await expect(
page.getByTestId('select-axis-drop-zone-tooltip').getByRole('button', { name: 'Year' }) page
.getByTestId('select-axis-drop-zone-tooltip')
.locator('button')
.filter({ hasText: 'Year' })
).toBeVisible(); ).toBeVisible();
await page.getByTestId('select-axis-drop-zone-tooltip').getByRole('button').nth(2).click(); await page.getByTestId('select-axis-drop-zone-tooltip').getByTestId('delete-button').click();
await expect( await expect(
page.getByTestId('select-axis-drop-zone-tooltip').getByText('Drag column here') page.getByTestId('select-axis-drop-zone-tooltip').getByText('Drag column here')
).toBeVisible(); ).toBeVisible();
@ -510,6 +518,7 @@ test.describe
await page.getByTestId('segmented-trigger-none').click(); await page.getByTestId('segmented-trigger-none').click();
await page.getByRole('button', { name: 'Save' }).click(); await page.getByRole('button', { name: 'Save' }).click();
await page.waitForTimeout(100);
await page.waitForLoadState('networkidle'); await page.waitForLoadState('networkidle');
}); });
@ -550,23 +559,15 @@ test.describe
await page.reload(); await page.reload();
await page.getByTestId('segmented-trigger-Styling').click(); await page.getByTestId('segmented-trigger-Styling').click();
await page await page.getByTestId('delete-button').click();
.getByRole('main')
.filter({ hasText: 'Jan 1, 2022 - May 2, 2025•' })
.getByRole('button')
.nth(2)
.click();
await page.getByRole('button', { name: 'Save' }).click(); await page.getByRole('button', { name: 'Save' }).click();
await page.waitForTimeout(50); await page.waitForTimeout(50);
await page.waitForLoadState('networkidle'); await page.waitForLoadState('networkidle');
await page.reload(); await page.reload();
await page.getByTestId('segmented-trigger-Styling').click();
await expect(page.locator('body')).toMatchAriaSnapshot(` await expect(page.getByTestId('delete-button')).not.toBeVisible();
- textbox "New chart": Yearly Sales Revenue - Signature Cycles Products (Last 3 Years + YTD)
- text: /Jan 1, \\d+ - May 2, \\d+ • What is the total yearly sales revenue for products supplied by Signature Cycles from \\d+ to present\\? Total Sales Revenue/
- img
`);
}); });
test('Can add a trendline', async ({ page }) => { test('Can add a trendline', async ({ page }) => {
@ -615,14 +616,6 @@ test.describe
await page.getByRole('button', { name: 'Save' }).click(); await page.getByRole('button', { name: 'Save' }).click();
await page.waitForTimeout(100); await page.waitForTimeout(100);
await page.waitForLoadState('networkidle'); await page.waitForLoadState('networkidle');
await expect(page.locator('body')).toMatchAriaSnapshot(`
- textbox "New chart": Yearly Sales Revenue - Signature Cycles Products (Last 3 Years + YTD)
- text: /Jan 1, \\d+ - May 2, \\d+ • What is the total yearly sales revenue for products supplied by Signature Cycles from \\d+ to present\\? Total Sales Revenue/
- img
`);
await page.waitForTimeout(50);
await page.waitForLoadState('networkidle');
await page await page
.locator('div') .locator('div')
@ -718,7 +711,12 @@ test.describe
await page.getByRole('textbox', { name: 'Total Sales Revenue' }).click(); await page.getByRole('textbox', { name: 'Total Sales Revenue' }).click();
await page.getByRole('textbox', { name: 'Total Sales Revenue' }).press('ControlOrMeta+a'); await page.getByRole('textbox', { name: 'Total Sales Revenue' }).press('ControlOrMeta+a');
await page.getByRole('textbox', { name: 'Total Sales Revenue' }).fill('THIS IS A TEST!'); await page.getByRole('textbox', { name: 'Total Sales Revenue' }).fill('THIS IS A TEST!');
await expect(page.getByRole('button', { name: 'THIS IS A TEST!' })).toBeVisible(); await expect(
page
.getByTestId('select-axis-drop-zone-yAxis')
.locator('button')
.filter({ hasText: 'THIS IS A TEST!' })
).toBeVisible();
await page.getByRole('button', { name: 'Save' }).click(); await page.getByRole('button', { name: 'Save' }).click();
await page.waitForTimeout(100); await page.waitForTimeout(100);
await page.waitForLoadState('networkidle'); await page.waitForLoadState('networkidle');
@ -851,6 +849,7 @@ test.describe
await page.goto( await page.goto(
'http://localhost:3000/app/metrics/45c17750-2b61-5683-ba8d-ff6c6fefacee/chart?secondary_view=chart-edit' 'http://localhost:3000/app/metrics/45c17750-2b61-5683-ba8d-ff6c6fefacee/chart?secondary_view=chart-edit'
); );
await page.getByTestId('select-axis-drop-zone-yAxis').getByRole('button').nth(3).click(); await page.getByTestId('select-axis-drop-zone-yAxis').getByRole('button').nth(3).click();
await page.getByRole('switch').click(); await page.getByRole('switch').click();
await page.getByRole('button', { name: 'Save' }).click(); await page.getByRole('button', { name: 'Save' }).click();

View File

@ -106,11 +106,6 @@ test.describe
.filter({ hasText: /^Edit chart$/ }) .filter({ hasText: /^Edit chart$/ })
.getByRole('button') .getByRole('button')
.click(); .click();
await expect(page.locator('body')).toMatchAriaSnapshot(`
- textbox "New chart": /Top \\d+ Products by Revenue \\(Last 4 Quarters\\)/
- text: /Q2 \\d+ - Q1 \\d+ • Which were the top \\d+ products by revenue in the last four completed quarters\\? Touring-\\d+ Yellow, \\d+ Road-\\d+-W Yellow, \\d+ Touring-\\d+ Blue, \\d+ Road-\\d+-W Yellow, \\d+ Next 6/
- img
`);
}); });
test('Pie chart - legend clicks work', async ({ page }) => { test('Pie chart - legend clicks work', async ({ page }) => {
@ -134,10 +129,6 @@ test.describe
.filter({ hasText: /^Mountain-200 Silver, 42$/ }) .filter({ hasText: /^Mountain-200 Silver, 42$/ })
.nth(2) .nth(2)
).toBeVisible(); ).toBeVisible();
await expect(page.getByTestId('metric-view-chart-content')).toMatchAriaSnapshot(`
- text: /Touring-\\d+ Yellow, \\d+ Road-\\d+-W Yellow, \\d+ Touring-\\d+ Blue, \\d+ Road-\\d+-W Yellow, \\d+ Next 6/
- img
`);
}); });
test('Pie chart - can disable tooltip', async ({ page }) => { test('Pie chart - can disable tooltip', async ({ page }) => {
@ -261,11 +252,6 @@ test.describe
); );
await page.getByTestId('segmented-trigger-Styling').click(); await page.getByTestId('segmented-trigger-Styling').click();
await expect(page.getByText('Touring-1000 Yellow,')).toBeVisible(); await expect(page.getByText('Touring-1000 Yellow,')).toBeVisible();
await expect(page.locator('body')).toMatchAriaSnapshot(`
- textbox "New chart": /Top \\d+ Products by Revenue \\(Last 4 Quarters\\)/
- text: /Q2 \\d+ - Q1 \\d+ • Which were the top \\d+ products by revenue in the last four completed quarters\\? Touring-\\d+ Yellow, \\d+ Road-\\d+-W Yellow, \\d+ Touring-\\d+ Blue, \\d+ Next 7/
- img
`);
await expect(page.locator('body')).toContainText('Sum'); await expect(page.locator('body')).toContainText('Sum');
await page.locator('html').click(); await page.locator('html').click();
await page.getByRole('combobox').filter({ hasText: 'Sum' }).click(); await page.getByRole('combobox').filter({ hasText: 'Sum' }).click();
@ -378,7 +364,7 @@ test.describe
'http://localhost:3000/app/metrics/88f342bf-19f9-53a9-87c6-804399e69644/chart?secondary_view=chart-edit' 'http://localhost:3000/app/metrics/88f342bf-19f9-53a9-87c6-804399e69644/chart?secondary_view=chart-edit'
); );
await expect(page.getByTestId('metric-view-chart-content').getByRole('img')).toBeVisible(); await expect(page.getByTestId('metric-view-chart-content').getByRole('img')).toBeVisible();
await page.getByTestId('select-axis-drop-zone-xAxis').getByRole('button').nth(1).click(); await page.getByTestId('select-axis-drop-zone-xAxis').getByTestId('delete-button').click();
await expect(page.getByText('No valid axis selected')).toBeVisible(); await expect(page.getByText('No valid axis selected')).toBeVisible();
await page.getByTestId('select-chart-type-column').click(); await page.getByTestId('select-chart-type-column').click();