From d275d8c9bb6a1914ffd3b94e7e41e956c7fb2035 Mon Sep 17 00:00:00 2001 From: Fara Woolf Date: Wed, 6 Dec 2023 17:09:55 -0600 Subject: [PATCH] fix: selecting testnet in tests --- src/app/features/theme-drawer/theme-list.tsx | 2 - .../components/network-list-item.layout.tsx | 47 +++++++++---------- tests/page-object-models/home.page.ts | 3 +- tests/specs/rpc-sign-psbt/sign-psbt.spec.ts | 1 + 4 files changed, 24 insertions(+), 29 deletions(-) diff --git a/src/app/features/theme-drawer/theme-list.tsx b/src/app/features/theme-drawer/theme-list.tsx index 7c8a4ccdf00..4cdd87616e7 100644 --- a/src/app/features/theme-drawer/theme-list.tsx +++ b/src/app/features/theme-drawer/theme-list.tsx @@ -1,6 +1,5 @@ import { useCallback } from 'react'; -import { SettingsSelectors } from '@tests/selectors/settings.selectors'; import { Flex, FlexProps } from 'leather-styles/jsx'; import { useAnalytics } from '@app/common/hooks/analytics/use-analytics'; @@ -30,7 +29,6 @@ export function ThemeList(props: FlexProps) { {themes.map(theme => ( - - + + + {network.name} @@ -76,7 +71,7 @@ export function NetworkListItemLayout({ )} - - + + ); } diff --git a/tests/page-object-models/home.page.ts b/tests/page-object-models/home.page.ts index b7d22ea65c0..a613ed74d40 100644 --- a/tests/page-object-models/home.page.ts +++ b/tests/page-object-models/home.page.ts @@ -99,9 +99,10 @@ export class HomePage { async enableTestMode() { await this.page.getByTestId(SettingsSelectors.SettingsMenuBtn).click(); await this.page.getByTestId(SettingsSelectors.ChangeNetworkAction).click(); + await this.page.waitForTimeout(1000); await ( await this.page.waitForSelector(this.testNetworkSelector, { timeout: 30000 }) - ).isEnabled(); + ).isVisible(); await this.page.getByTestId(WalletDefaultNetworkConfigurationIds.testnet).click(); } diff --git a/tests/specs/rpc-sign-psbt/sign-psbt.spec.ts b/tests/specs/rpc-sign-psbt/sign-psbt.spec.ts index 8f0bca29968..c5acef3aed0 100644 --- a/tests/specs/rpc-sign-psbt/sign-psbt.spec.ts +++ b/tests/specs/rpc-sign-psbt/sign-psbt.spec.ts @@ -26,6 +26,7 @@ test.describe('Sign PSBT', () => { function clickActionButton(context: BrowserContext) { return async (buttonToPress: 'Cancel' | 'Confirm') => { const popup = await context.waitForEvent('page'); + await popup.waitForTimeout(1000); const btn = popup.locator(`text="${buttonToPress}"`); await btn.click(); };