From f0ef632d1301a7163c2d31db47316f266226c762 Mon Sep 17 00:00:00 2001 From: Dominik Guzei Date: Thu, 2 May 2024 14:10:47 +0200 Subject: [PATCH 1/3] fix(extension): pass tx in/out type to transaction details LW-9741 (#1112) The current code resulted in a bug due to just comparing a translated string to a string literal 'sent' to determine if the transaction was going in or out which failed for the "sending" state (and wouldnt work for other languages anyway) --- .../activity/components/ActivityDetail.tsx | 16 +++++++++------- .../ActivityDetail/TransactionDetailAsset.ts | 3 +++ .../ActivityDetail/TransactionDetails.tsx | 5 +++-- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/apps/browser-extension-wallet/src/views/browser-view/features/activity/components/ActivityDetail.tsx b/apps/browser-extension-wallet/src/views/browser-view/features/activity/components/ActivityDetail.tsx index a4da64474..a59640ea7 100644 --- a/apps/browser-extension-wallet/src/views/browser-view/features/activity/components/ActivityDetail.tsx +++ b/apps/browser-extension-wallet/src/views/browser-view/features/activity/components/ActivityDetail.tsx @@ -3,16 +3,16 @@ import uniq from 'lodash/uniq'; import flatMap from 'lodash/flatMap'; import { Skeleton } from 'antd'; import { Wallet } from '@lace/cardano'; +import type { ActivityType } from '@lace/core'; import { - AssetActivityListProps, ActivityStatus, - TxOutputInput, - TxSummary, + AssetActivityListProps, + DelegationActivityType, RewardsDetails, TransactionActivityType, - DelegationActivityType + TxOutputInput, + TxSummary } from '@lace/core'; -import type { ActivityType } from '@lace/core'; import { PriceResult } from '@hooks'; import { useWalletStore } from '@stores'; import { ActivityDetail as ActivityDetailType } from '@src/types'; @@ -54,7 +54,8 @@ export const getTransactionData = ({ return outputData.map((output) => ({ ...output, // Show up to 5 addresses below multiple addresses (see LW-4040) - addr: addrs.slice(0, MAX_SUMMARY_ADDRESSES) + addr: addrs.slice(0, MAX_SUMMARY_ADDRESSES), + type: TransactionActivityType.incoming })); } @@ -63,7 +64,8 @@ export const getTransactionData = ({ .filter((output) => !walletAddresses.includes(output.addr)) .map((output) => ({ ...output, - ...(!Array.isArray(output.addr) && { addr: [output.addr] }) + ...(!Array.isArray(output.addr) && { addr: [output.addr] }), + type: TransactionActivityType.outgoing })); }; diff --git a/packages/core/src/ui/components/ActivityDetail/TransactionDetailAsset.ts b/packages/core/src/ui/components/ActivityDetail/TransactionDetailAsset.ts index e0693757d..bd00d0813 100644 --- a/packages/core/src/ui/components/ActivityDetail/TransactionDetailAsset.ts +++ b/packages/core/src/ui/components/ActivityDetail/TransactionDetailAsset.ts @@ -1,3 +1,5 @@ +import { TransactionActivityType } from '@ui/components/ActivityDetail/types'; + export interface TransactionDetailAsset { icon?: string; title: string; @@ -22,6 +24,7 @@ export interface TxOutputInput { export interface TxSummary extends Omit { addr: string[]; + type: TransactionActivityType; } interface TxMetadata { diff --git a/packages/core/src/ui/components/ActivityDetail/TransactionDetails.tsx b/packages/core/src/ui/components/ActivityDetail/TransactionDetails.tsx index de57022d3..89f3f1787 100644 --- a/packages/core/src/ui/components/ActivityDetail/TransactionDetails.tsx +++ b/packages/core/src/ui/components/ActivityDetail/TransactionDetails.tsx @@ -20,7 +20,8 @@ import { TxDetailsProposalProceduresTitles, TxDetailsCertificateTitles, TxDetails, - TxDetail + TxDetail, + TransactionActivityType } from './types'; import { Collateral, CollateralStatus } from './Collateral'; @@ -345,7 +346,7 @@ export const TransactionDetails = ({
- {t(`core.activityDetails.${name.toLowerCase() === 'sent' ? 'to' : 'from'}`)} + {t(`core.activityDetails.${summary.type === TransactionActivityType.outgoing ? 'to' : 'from'}`)}
{summary.addr.length > 1 && ( From ccba1464204fae5a5f6cf94f56a2ebb8028b4c00 Mon Sep 17 00:00:00 2001 From: Lukasz Jagiela <12641433+ljagiela@users.noreply.github.com> Date: Thu, 2 May 2024 15:29:58 +0200 Subject: [PATCH 2/3] test(extension): test maintenance 2 May (#1123) --- .../src/assert/drawerSendExtendedAssert.ts | 1 + .../transaction/transactionBundleAssert.ts | 1 + .../src/features/AdaHandleExtended.feature | 4 ++++ .../src/features/AdaHandlePopup.feature | 4 ++++ .../src/features/AdaHandleSendExtended.feature | 1 + .../src/features/CollateralPopup.feature | 2 ++ .../SendTransactionBundlesExtended.feature | 2 +- .../SendTransactionSimpleExtended.part1.feature | 2 +- .../features/e2e/SendTransactionDappE2E.feature | 16 ++++++++-------- packages/e2e-tests/src/steps/commonSteps.ts | 3 ++- .../e2e-tests/src/steps/dAppConnectorSteps.ts | 2 +- .../e2e-tests/src/utils/dappConnectorUtils.ts | 4 ++-- 12 files changed, 28 insertions(+), 14 deletions(-) diff --git a/packages/e2e-tests/src/assert/drawerSendExtendedAssert.ts b/packages/e2e-tests/src/assert/drawerSendExtendedAssert.ts index 48aeadf0b..2d7803d9a 100644 --- a/packages/e2e-tests/src/assert/drawerSendExtendedAssert.ts +++ b/packages/e2e-tests/src/assert/drawerSendExtendedAssert.ts @@ -20,6 +20,7 @@ class DrawerSendExtendedAssert { assertSeeSendDrawer = async (mode: 'extended' | 'popup') => { await this.assertSeeDrawerTitle(mode === 'extended'); const addressInput = new AddressInput(); + await addressInput.input.waitForStable(); await addressInput.input.waitForDisplayed(); await addressInput.label.waitForDisplayed(); expect(await addressInput.label.getText()).to.equal(await t('core.destinationAddressInput.recipientAddress')); diff --git a/packages/e2e-tests/src/assert/transaction/transactionBundleAssert.ts b/packages/e2e-tests/src/assert/transaction/transactionBundleAssert.ts index 7750423c1..3b0cd168d 100644 --- a/packages/e2e-tests/src/assert/transaction/transactionBundleAssert.ts +++ b/packages/e2e-tests/src/assert/transaction/transactionBundleAssert.ts @@ -12,6 +12,7 @@ class TransactionBundleAssert { for (let i = 1; i <= expectedNumberOfBundles; i++) { const bundle = new TransactionBundle(i); if (expectedNumberOfBundles > 1) { + await bundle.bundleTitle.waitForStable(); await bundle.bundleTitle.waitForDisplayed(); expect(await bundle.bundleTitle.getText()).to.equal(`${await t('core.outputSummaryList.output')} ${i}`); await bundle.bundleRemoveButton.waitForDisplayed(); diff --git a/packages/e2e-tests/src/features/AdaHandleExtended.feature b/packages/e2e-tests/src/features/AdaHandleExtended.feature index f92dede50..ffee87e95 100644 --- a/packages/e2e-tests/src/features/AdaHandleExtended.feature +++ b/packages/e2e-tests/src/features/AdaHandleExtended.feature @@ -99,6 +99,7 @@ Feature: ADA handle - extended view And Clipboard contains text: "$test_handle_3" @LW-7427 @LW-7426 + @Pending @issue=LW-10444 Scenario: Extended View - Validate custom ADA handle image on the wallet address/NFTs/NFT details page When I click "Receive" button on page header Then I see ADA handle with custom image on the "Wallet Address" page @@ -109,6 +110,7 @@ Feature: ADA handle - extended view Then I see ADA handle NFT details page with custom image in extended mode @LW-7430 + @Pending @issue=LW-10444 Scenario: Extended View - Validate custom ADA handle image on the send/coin selector page When I click "Send" button on page header And I click "Add token or NFT" button for bundle 1 @@ -119,6 +121,7 @@ Feature: ADA handle - extended view Then the "$test_handle_1" asset is displayed in bundle 1 @LW-7429 + @Pending @issue=LW-10444 Scenario: Extended View - Validate custom ADA handle image on the NFT folder thumbnail/page Given I navigate to NFTs extended page And I click "Receive" button on page header @@ -136,6 +139,7 @@ Feature: ADA handle - extended view Then I see ADA handle NFT with custom image on the NFT folder page @LW-7428 + @Pending @issue=LW-10444 Scenario: Extended View - Validate custom ADA handle image on the "Select NFT" (folder) screen Given I navigate to NFTs extended page And I click "Receive" button on page header diff --git a/packages/e2e-tests/src/features/AdaHandlePopup.feature b/packages/e2e-tests/src/features/AdaHandlePopup.feature index 21807257e..c7012506e 100644 --- a/packages/e2e-tests/src/features/AdaHandlePopup.feature +++ b/packages/e2e-tests/src/features/AdaHandlePopup.feature @@ -98,6 +98,7 @@ Feature: ADA handle - popup view And Clipboard contains text: "$test_handle_3" @LW-7435 @LW-7436 + @Pending @issue=LW-10444 Scenario: Popup View - Validate custom ADA handle image on the wallet address/NFTs/NFT details page And I click "Receive" button on Tokens page in popup mode Then I see ADA handle with custom image on the "Wallet Address" page @@ -108,6 +109,7 @@ Feature: ADA handle - popup view Then I see ADA handle NFT details page with custom image in popup mode @LW-7432 + @Pending @issue=LW-10444 Scenario: Popup View - Validate custom ADA handle image on the send/coin selector page When I click "Send" button on Tokens page in popup mode And I click "Add token or NFT" button for bundle 1 @@ -118,6 +120,7 @@ Feature: ADA handle - popup view Then the "$test_hand..." asset is displayed in bundle 1 @LW-7434 + @Pending @issue=LW-10444 Scenario: Popup View - Validate custom ADA handle image on the NFT folder thumbnail/page Given I click "Receive" button on Tokens page in popup mode And I see handles listed on the "Receive" screen @@ -134,6 +137,7 @@ Feature: ADA handle - popup view Then I see ADA handle NFT with custom image on the NFT folder page @LW-7433 + @Pending @issue=LW-10444 Scenario: Popup View - Validate custom image from a handle on the "Select NFT" (folder) screen Given I click "Receive" button on Tokens page in popup mode And I see handles listed on the "Receive" screen diff --git a/packages/e2e-tests/src/features/AdaHandleSendExtended.feature b/packages/e2e-tests/src/features/AdaHandleSendExtended.feature index 811b1116e..b06079a23 100644 --- a/packages/e2e-tests/src/features/AdaHandleSendExtended.feature +++ b/packages/e2e-tests/src/features/AdaHandleSendExtended.feature @@ -8,6 +8,7 @@ Feature: ADA handle - extended view And I use a wallet with ADA handle "$handletosend" NFT in extended mode @LW-7073 + @Pending @issue=LW-10445 Scenario: Extended view - Ada handle transfer e2e, review flow Given I validate that handle: "$handletosend" is listed on the Receive screen And I add address with name: "$handletosend" and address: "$handletosend" to address book in extended mode diff --git a/packages/e2e-tests/src/features/CollateralPopup.feature b/packages/e2e-tests/src/features/CollateralPopup.feature index f1bb314d1..bc50558a8 100644 --- a/packages/e2e-tests/src/features/CollateralPopup.feature +++ b/packages/e2e-tests/src/features/CollateralPopup.feature @@ -27,6 +27,8 @@ Feature: Collateral - popup view When I click on "Collateral" setting And I fill correct password and confirm collateral Then I see collateral as: "Active" in settings + And I see a toast with text: "Collateral added" + And I close a toast message And I navigate to Transactions popup page And I can see transaction 1 with type "Self Transaction" When I switch network to: "Preview" in popup mode diff --git a/packages/e2e-tests/src/features/SendTransactionBundlesExtended.feature b/packages/e2e-tests/src/features/SendTransactionBundlesExtended.feature index 7322f3a6b..1b7f8a1bc 100644 --- a/packages/e2e-tests/src/features/SendTransactionBundlesExtended.feature +++ b/packages/e2e-tests/src/features/SendTransactionBundlesExtended.feature @@ -139,7 +139,7 @@ Feature: Send - Extended Browser View (Advanced Tx) And click on the coin selector for "tADA" asset in bundle 2 And click on an token with name: "LaceCoin" And I enter a value of: 1 to the "LaceCoin1" asset in bundle 2 - Then transaction fee is around 0.26 ADA and Ada allocation cost is around 1.07 ADA + Then transaction fee is around 0.20 ADA and Ada allocation cost is around 1.07 ADA @LW-4505 Scenario: Extended-view - Cancel transaction with multiple bundles on Summary page diff --git a/packages/e2e-tests/src/features/SendTransactionSimpleExtended.part1.feature b/packages/e2e-tests/src/features/SendTransactionSimpleExtended.part1.feature index 50132b38f..bc800bb19 100644 --- a/packages/e2e-tests/src/features/SendTransactionSimpleExtended.part1.feature +++ b/packages/e2e-tests/src/features/SendTransactionSimpleExtended.part1.feature @@ -190,7 +190,7 @@ Feature: LW-484: Send & Receive - Extended Browser View (Simple Tx) Then I verify transaction costs amount is around 0.00 ADA And I enter a valid "shelley" address in the bundle 1 recipient's address When I enter a value of: 2 to the "tADA" asset - Then I verify transaction costs amount is around 0.25 ADA + Then I verify transaction costs amount is around 0.17 ADA @LW-2370 @Testnet @Mainnet Scenario: Extended-view - Tx summary page is displayed diff --git a/packages/e2e-tests/src/features/e2e/SendTransactionDappE2E.feature b/packages/e2e-tests/src/features/e2e/SendTransactionDappE2E.feature index d54705a36..312fe851e 100644 --- a/packages/e2e-tests/src/features/e2e/SendTransactionDappE2E.feature +++ b/packages/e2e-tests/src/features/e2e/SendTransactionDappE2E.feature @@ -47,16 +47,16 @@ Feature: Send Transactions from Dapp - E2E | -2 LaceCoin2 | And I expand "From address" section in DApp transaction window And I see DApp connector "Confirm transaction" page "From address" section with following data: - | Address WalletSendDappTransactionE2E | - | Tokens -2 item(s) | - | -1.38 tADA - FEE | - | -2 LaceCoin2 | + | Address WalletSendDappTransactionE2E own | + | Tokens -2 item(s) | + | -1.38 tADA - FEE | + | -2 LaceCoin2 | And I expand "To address" section in DApp transaction window And I see DApp connector "Confirm transaction" page "To address" section with following data: - | Address WalletReceiveDappTransactionE2E | - | Tokens 2 item(s) | - | 1.38 tADA | - | 2 LaceCoin2 | + | Address WalletReceiveDappTransactionE2E foreign | + | Tokens 2 item(s) | + | 1.38 tADA | + | 2 LaceCoin2 | And I save fee value on DApp "Confirm transaction" page And I click "Confirm" button on "Confirm transaction" page And I see DApp connector "Sign transaction" page diff --git a/packages/e2e-tests/src/steps/commonSteps.ts b/packages/e2e-tests/src/steps/commonSteps.ts index c8ceba419..5d6f73f06 100755 --- a/packages/e2e-tests/src/steps/commonSteps.ts +++ b/packages/e2e-tests/src/steps/commonSteps.ts @@ -152,7 +152,8 @@ Then(/^I (see|don't see) a toast with text: "([^"]*)"$/, async (shouldSee: strin 'Given name already exists': 'addressBook.errors.givenNameAlreadyExist', 'Switched network': 'browserView.settings.wallet.network.networkSwitched', 'Network Error': 'general.errors.networkError', - 'Copied to clipboard': 'general.clipboard.copiedToClipboard' + 'Copied to clipboard': 'general.clipboard.copiedToClipboard', + 'Collateral added': 'browserView.settings.wallet.collateral.toast.add' }; const translationKey = toastTextToTranslationKeyMap[toastText]; diff --git a/packages/e2e-tests/src/steps/dAppConnectorSteps.ts b/packages/e2e-tests/src/steps/dAppConnectorSteps.ts index b92b465e9..3d5ec850e 100755 --- a/packages/e2e-tests/src/steps/dAppConnectorSteps.ts +++ b/packages/e2e-tests/src/steps/dAppConnectorSteps.ts @@ -95,7 +95,7 @@ Then( const defaultDAppTransactionData: ExpectedTransactionData = { typeOfTransaction: 'Send', - assetsDetails: ['-3 tADA'] + assetsDetails: ['-3 tADA - FEE'] }; switch (expectedPage) { diff --git a/packages/e2e-tests/src/utils/dappConnectorUtils.ts b/packages/e2e-tests/src/utils/dappConnectorUtils.ts index 0da82b0a1..7a2563f2a 100644 --- a/packages/e2e-tests/src/utils/dappConnectorUtils.ts +++ b/packages/e2e-tests/src/utils/dappConnectorUtils.ts @@ -9,9 +9,9 @@ const subtractFeeFromCucumberListElement = async (entry: string) => { }; const shortenAddressFromCucumberListElement = (wallet: string) => { - const [addressLabel, walletValue] = wallet.split(' '); + const [addressLabel, walletValue, source] = wallet.split(' '); const fullAddress = String(getTestWallet(walletValue).address); - return `${addressLabel} ${fullAddress.slice(0, 8)}...${fullAddress.slice(-8)}`; + return `${addressLabel} ${fullAddress.slice(0, 8)}...${fullAddress.slice(-8)} ${source}`; }; export const parseDappCucumberAssetList = async (assetsList: string[]): Promise => From eebf8f34167e23d1f71c64eebffcec90b465334b Mon Sep 17 00:00:00 2001 From: bslabiak <112852128+bslabiak@users.noreply.github.com> Date: Thu, 2 May 2024 17:22:40 +0200 Subject: [PATCH 3/3] test(extension): fix out of memory error / allure publsher for e2e (#1124) * test(extension): increase node memory for e2e tests / bump publisher * test(extension): add quotes for publisher * test(extension): add base url to regression runners * test(extension): change path --- .github/workflows/e2e-tests-linux.yml | 8 +++++--- .github/workflows/e2e-tests-win.yml | 5 +++-- .github/workflows/smoke-tests.yml | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/e2e-tests-linux.yml b/.github/workflows/e2e-tests-linux.yml index 2c97d3b8d..15bb6603c 100644 --- a/.github/workflows/e2e-tests-linux.yml +++ b/.github/workflows/e2e-tests-linux.yml @@ -34,6 +34,7 @@ env: NETWORK: ${{ github.event.inputs.network || 'preprod' }} RUN: ${{ github.run_number }} DISPLAY: ':99.0' + NODE_OPTIONS: --max-old-space-size=16384 jobs: tests: @@ -73,7 +74,7 @@ jobs: eval "$runCommand"; - name: Create allure properties if: always() - working-directory: ./packages/e2e-tests/reports/allure/results + working-directory: './packages/e2e-tests/reports/allure/results' run: | echo " env=${NETWORK} @@ -82,7 +83,7 @@ jobs: platform=Linux " > environment.properties - name: Publish allure report to S3 - uses: andrcuns/allure-publish-action@v1.0.1 + uses: andrcuns/allure-publish-action@v2.6.0 if: always() env: GITHUB_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -90,11 +91,12 @@ jobs: AWS_SECRET_ACCESS_KEY: ${{ secrets.E2E_AWS_SECRET_ACCESS_KEY }} with: storageType: s3 - resultsGlob: './packages/e2e-tests/reports/allure/results/*' + resultsGlob: './packages/e2e-tests/reports/allure/results' bucket: lace-e2e-test-results prefix: 'all/linux/${BROWSER}/${RUN}' copyLatest: true ignoreMissingResults: true + baseUrl: 'https://${{ secrets.E2E_REPORTS_USER }}:${{ secrets.E2E_REPORTS_PASSWORD }}@${{ secrets.E2E_REPORTS_URL }}' - name: Publish artifacts (logs, reports, screenshots) uses: actions/upload-artifact@v4 if: always() diff --git a/.github/workflows/e2e-tests-win.yml b/.github/workflows/e2e-tests-win.yml index b71c3a80d..5a9ace3a0 100644 --- a/.github/workflows/e2e-tests-win.yml +++ b/.github/workflows/e2e-tests-win.yml @@ -154,7 +154,7 @@ jobs: name: test-artifacts path: ./packages/e2e-tests - name: Publish allure report to S3 - uses: andrcuns/allure-publish-action@v1.0.1 + uses: andrcuns/allure-publish-action@v2.6.0 if: always() env: GITHUB_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -162,11 +162,12 @@ jobs: AWS_SECRET_ACCESS_KEY: ${{ secrets.E2E_AWS_SECRET_ACCESS_KEY }} with: storageType: s3 - resultsGlob: './packages/e2e-tests/reports/allure/results/*' + resultsGlob: './packages/e2e-tests/reports/allure/results' bucket: lace-e2e-test-results prefix: 'all/windows/${BROWSER}/${RUN}' copyLatest: true ignoreMissingResults: true + baseUrl: 'https://${{ secrets.E2E_REPORTS_USER }}:${{ secrets.E2E_REPORTS_PASSWORD }}@${{ secrets.E2E_REPORTS_URL }}' - name: Add link to summary if: always() run: | diff --git a/.github/workflows/smoke-tests.yml b/.github/workflows/smoke-tests.yml index 3d7a2ca2b..08ab7a955 100644 --- a/.github/workflows/smoke-tests.yml +++ b/.github/workflows/smoke-tests.yml @@ -57,7 +57,7 @@ jobs: platform=Linux " > environment.properties - name: Publish allure report to S3 - uses: andrcuns/allure-publish-action@v2.4.0 + uses: andrcuns/allure-publish-action@v2.6.0 if: always() env: GITHUB_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}