From b64115c8384f95a26a65ca534d964cfddb9fff38 Mon Sep 17 00:00:00 2001 From: Alex Date: Thu, 12 Oct 2023 13:24:52 +0300 Subject: [PATCH] TW-884: [e2e] Home hape. Fix some testId --- e2e/src/page-objects/pages/home.page.ts | 10 +++++++--- src/app/atoms/Checkbox.tsx | 3 +-- src/app/atoms/Money.tsx | 4 ++-- src/app/pages/Home/OtherComponents/Tokens/Tokens.tsx | 3 ++- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/e2e/src/page-objects/pages/home.page.ts b/e2e/src/page-objects/pages/home.page.ts index c1d08a0be..8fa39776c 100644 --- a/e2e/src/page-objects/pages/home.page.ts +++ b/e2e/src/page-objects/pages/home.page.ts @@ -55,12 +55,16 @@ export class HomePage extends Page { } async isZeroBalanceHidden() { - const tokenList = await findElements(AssetsSelectors.assetItemCryptoBalanceButton); + const balancesElems = await findElements(AssetsSelectors.assetItemCryptoBalanceButton); /* Begin from second index (third token in the list) because first two tokens won't be hidden after clicking on 'hide 0 balances' */ - for (let i = 2; i < tokenList.length; i++) { - const tokenBalance = await getElementText(tokenList[i]); + for (let i = 2; i < balancesElems.length; i++) { + const balanceElem = balancesElems[i]; + const fullValueElem = await balanceElem.$(':scope > input'); + if (!fullValueElem) throw new Error('Cannot read full token balance value'); + + const tokenBalance = await getElementText(fullValueElem); if (Number(tokenBalance) === 0) { throw new Error(`Token with zero balance is not hidden`); diff --git a/src/app/atoms/Checkbox.tsx b/src/app/atoms/Checkbox.tsx index 4bd597b31..fbefb25b2 100644 --- a/src/app/atoms/Checkbox.tsx +++ b/src/app/atoms/Checkbox.tsx @@ -88,7 +88,7 @@ const Checkbox = forwardRef( ); return ( -
+
( onChange={handleChange} onFocus={handleFocus} onBlur={handleBlur} - {...setTestID(testID)} {...rest} /> diff --git a/src/app/atoms/Money.tsx b/src/app/atoms/Money.tsx index ae3b92db4..27ea0cbbb 100644 --- a/src/app/atoms/Money.tsx +++ b/src/app/atoms/Money.tsx @@ -297,11 +297,11 @@ const FullAmountTippy: FC = ({ ); return ( -
+
{enabled ? ( <> - + ) : ( diff --git a/src/app/pages/Home/OtherComponents/Tokens/Tokens.tsx b/src/app/pages/Home/OtherComponents/Tokens/Tokens.tsx index b6dfe1a43..955817ad8 100644 --- a/src/app/pages/Home/OtherComponents/Tokens/Tokens.tsx +++ b/src/app/pages/Home/OtherComponents/Tokens/Tokens.tsx @@ -242,11 +242,12 @@ const ManageButtonDropdown: FC = ({ -