update tests with new syntax

This commit is contained in:
Nate Kelley 2025-05-09 12:25:55 -06:00
parent f3262a1a3a
commit ad31aa0dda
No known key found for this signature in database
GPG Key ID: FD90372AB8D98B4F
3 changed files with 14 additions and 13 deletions

View File

@ -69,12 +69,9 @@ test.describe.serial('Pie chart styling updates', async () => {
await page.waitForTimeout(55);
await page.getByTestId('edit-chart-button').getByRole('button').click();
await expect(page.getByTestId('metric-view-chart-content').getByRole('img')).toBeVisible();
await page.getByTestId('edit-sql-button').getByRole('button').click();
await page.waitForTimeout(55);
await expect(page.getByText('Copy SQLSaveRun')).toBeVisible();
await page.getByTestId('segmented-trigger-file').click();
await page.waitForTimeout(55);
await expect(page.getByText('Top 10 Products by Revenue (').first()).toBeVisible();
await expect(page.getByRole('textbox', { name: 'New chart' })).toHaveValue(
'Top 10 Products by Revenue (Last 4 Quarters)'
);
await page.getByTestId('edit-chart-button').getByRole('button').click();
await expect(page.getByText('Edit chart')).toBeVisible();
await page

View File

@ -12,12 +12,12 @@ test.describe.serial('Create a scatter plot with a question', () => {
await page.waitForLoadState('networkidle');
await page.waitForLoadState('domcontentloaded');
await expect(page.getByRole('link', { name: 'Reasoning link' })).toBeVisible();
await expect(page.getByTestId('metric-view-chart-content').getByRole('img')).toBeVisible({
timeout: 240000
timeout: 240000 // 4 minutes
});
await expect(page.getByTestId('share-button')).toBeVisible();
await expect(page.getByTestId('save-to-dashboard-button')).toBeVisible();
await expect(page.getByTestId('edit-sql-button').getByRole('button')).toBeVisible();
await expect(page.getByTestId('edit-chart-button').getByRole('button')).toBeVisible();
await page.getByTestId('edit-chart-button').getByRole('button').click();

View File

@ -1,9 +1,9 @@
import { test, expect } from '@playwright/test';
test('Can share a metric', async ({ page }) => {
await page.goto('http://localhost:3000/app/chats');
await page.getByRole('link', { name: 'Revenue Report: Previous Four' }).click();
await page.goto(
'http://localhost:3000/app/chats/865352e8-c327-461d-ae67-9efeb530ff0e/metrics/1e91b291-8883-5451-8b98-89e99071e4f8/chart?metric_version_number=1'
);
await page.getByTestId('share-button').click();
await page.getByRole('textbox', { name: 'Invite others by email...' }).click();
await page.getByRole('textbox', { name: 'Invite others by email...' }).fill('blake@buster.so');
@ -14,11 +14,14 @@ test('Can share a metric', async ({ page }) => {
await page.getByText('Can view').click();
await page.getByRole('menuitemcheckbox', { name: 'Remove' }).click();
await expect(page.getByText('Can view')).toBeHidden();
await page.waitForTimeout(100);
await page.waitForLoadState('networkidle');
});
test('Can publish a metric', async ({ page }) => {
await page.goto('http://localhost:3000/app/chats');
await page.getByRole('link', { name: 'Revenue Report: Previous Four' }).click();
await page.goto(
'http://localhost:3000/app/chats/865352e8-c327-461d-ae67-9efeb530ff0e/metrics/1e91b291-8883-5451-8b98-89e99071e4f8/chart?metric_version_number=1'
);
await page.getByTestId('share-button').click();
await page.getByTestId('segmented-trigger-Publish').click();
await expect(page.getByRole('button', { name: 'Create public link' })).toBeVisible();
@ -34,4 +37,5 @@ test('Can publish a metric', async ({ page }) => {
await page.getByRole('button', { name: 'Unpublish' }).click();
await page.waitForTimeout(50);
await page.waitForLoadState('networkidle');
await expect(page.getByRole('button', { name: 'Create public link' })).toBeVisible();
});