From e5af9ba6b80b07573376b7d01324551e12516c2f Mon Sep 17 00:00:00 2001 From: kreosus <59621250+kreosus@users.noreply.github.com> Date: Mon, 14 Nov 2022 03:10:19 -0600 Subject: [PATCH] Improve Locators for new create HTTP test (#5406) --- .../tests/prerelease/debug-sidebar-interactions.test.ts | 4 ++-- .../src/ui/components/sidebar/sidebar-create-dropdown.tsx | 6 +++--- .../insomnia/src/ui/components/sidebar/sidebar-filter.tsx | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/insomnia-smoke-test/tests/prerelease/debug-sidebar-interactions.test.ts b/packages/insomnia-smoke-test/tests/prerelease/debug-sidebar-interactions.test.ts index 0351d39de..9a2381fdc 100644 --- a/packages/insomnia-smoke-test/tests/prerelease/debug-sidebar-interactions.test.ts +++ b/packages/insomnia-smoke-test/tests/prerelease/debug-sidebar-interactions.test.ts @@ -84,8 +84,8 @@ test.describe('Debug-Sidebar', async () => { }); test('Create a new HTTP request', async ({ page }) => { - await page.locator('div:nth-child(3) > .btn').click(); - await page.locator('button:has-text("HTTP RequestCtrl + N")').first().click(); + await page.locator('[data-testid="SidebarFilter"] [data-testid="SidebarCreateDropdown"] button').click(); + await page.locator('[data-testid="CreateHttpRequest"]').first().click(); await expect(page.locator('.app')).toContainText('New Request'); }); }); diff --git a/packages/insomnia/src/ui/components/sidebar/sidebar-create-dropdown.tsx b/packages/insomnia/src/ui/components/sidebar/sidebar-create-dropdown.tsx index 63369dd19..b863165c3 100644 --- a/packages/insomnia/src/ui/components/sidebar/sidebar-create-dropdown.tsx +++ b/packages/insomnia/src/ui/components/sidebar/sidebar-create-dropdown.tsx @@ -34,15 +34,15 @@ export const SidebarCreateDropdown: FC = ({ right }) => { createRequestGroup(activeWorkspaceId); }, [activeWorkspaceId]); - + const dataTestId = 'SidebarCreateDropdown'; return ( - + - create('HTTP')}> + create('HTTP')}> HTTP Request diff --git a/packages/insomnia/src/ui/components/sidebar/sidebar-filter.tsx b/packages/insomnia/src/ui/components/sidebar/sidebar-filter.tsx index b1e4b8064..56350afa8 100644 --- a/packages/insomnia/src/ui/components/sidebar/sidebar-filter.tsx +++ b/packages/insomnia/src/ui/components/sidebar/sidebar-filter.tsx @@ -67,9 +67,9 @@ export const SidebarFilter: FC = ({ filter }) => { await db.flushChanges(flushId); } }; - + const dataTestId = 'SidebarFilter'; return ( -
+