From d7d87efdcd1d3f5230efef80af9d6443e0426d70 Mon Sep 17 00:00:00 2001 From: Curry Yang <1019yanglu@gmail.com> Date: Wed, 22 Jan 2025 18:29:37 +0800 Subject: [PATCH] fix: dashboard test --- .../tests/smoke/dashboard-interactions.test.ts | 10 +++++----- .../tests/smoke/design-document-naming.test.ts | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/insomnia-smoke-test/tests/smoke/dashboard-interactions.test.ts b/packages/insomnia-smoke-test/tests/smoke/dashboard-interactions.test.ts index 0c5be48efba..88b1ef053ec 100644 --- a/packages/insomnia-smoke-test/tests/smoke/dashboard-interactions.test.ts +++ b/packages/insomnia-smoke-test/tests/smoke/dashboard-interactions.test.ts @@ -99,14 +99,14 @@ test.describe('Dashboard', async () => { await page.getByTestId('project').click(); // Rename document - await page.getByLabel('my-spec.yaml').getByRole('button').click(); + await page.getByLabel('Files').getByLabel('my-spec.yaml').getByRole('button').click(); await page.getByRole('menuitem', { name: 'Rename' }).click(); await page.locator('text=Rename DocumentName Rename >> input[type="text"]').fill('test123'); await page.click('#root button:has-text("Rename")'); await expect(page.locator('.app')).toContainText('test123'); // Duplicate document - await page.getByLabel('test123').getByRole('button').click(); + await page.getByLabel('Files').getByLabel('test123').getByRole('button').click(); await page.getByRole('menuitem', { name: 'Duplicate' }).click(); await page.locator('input[name="name"]').fill('test123-duplicate'); await page.click('[role="dialog"] button:has-text("Duplicate")'); @@ -114,7 +114,7 @@ test.describe('Dashboard', async () => { await page.getByTestId('project').click(); // Delete document - await page.getByLabel('test123-duplicate').getByRole('button').click(); + await page.getByLabel('Files').getByLabel('test123-duplicate').getByRole('button').click(); await page.getByRole('menuitem', { name: 'Delete' }).click(); await page.getByRole('button', { name: 'Delete' }).click(); // @TODO: Re-enable - Requires mocking VCS operations @@ -141,7 +141,7 @@ test.describe('Dashboard', async () => { await expect(page.locator('.app')).toContainText('test123'); // Duplicate collection - await page.getByLabel('test123').getByRole('button').click(); + await page.getByLabel('Files').getByLabel('test123').getByRole('button').click(); await page.getByRole('menuitem', { name: 'Duplicate' }).click(); await page.locator('input[name="name"]').fill('test123-duplicate'); await page.click('[role="dialog"] button:has-text("Duplicate")'); @@ -149,7 +149,7 @@ test.describe('Dashboard', async () => { await page.getByTestId('project').click(); // Delete collection - await page.getByLabel('test123-duplicate').getByRole('button').click(); + await page.getByLabel('Files').getByLabel('test123-duplicate').getByRole('button').click(); await page.getByRole('menuitem', { name: 'Delete' }).click(); await page.getByRole('button', { name: 'Delete' }).click(); // @TODO: Re-enable - Requires mocking VCS operations diff --git a/packages/insomnia-smoke-test/tests/smoke/design-document-naming.test.ts b/packages/insomnia-smoke-test/tests/smoke/design-document-naming.test.ts index 4d3782b3662..4441edf1da2 100644 --- a/packages/insomnia-smoke-test/tests/smoke/design-document-naming.test.ts +++ b/packages/insomnia-smoke-test/tests/smoke/design-document-naming.test.ts @@ -6,7 +6,7 @@ test.describe('design document operations', async () => { await page.getByPlaceholder('my-spec.yaml').fill('jurassic park'); await page.getByPlaceholder('my-spec.yaml').press('Enter'); await page.getByTestId('project').click(); - await page.getByLabel('jurassic park').click(); + await page.getByLabel('Files').getByLabel('jurassic park').click(); }); test('can delete a test suite with confirmation modal', async ({ page }) => {