Skip to content

Commit e778f66

Browse files
authored
test(extension): maintenance 21 Feb 2025 (#1734)
* test(extension): unblock tests blocked by LW-11786 * test(extension): unblock tests LW-10262 and LW-10263 * test(extension): unblock tests LW-2554 and LW-2555 * test(extension): unblock tests LW-2542 and LW-2543 * test(extension): replace the wallet for activity page tests
1 parent 9984e61 commit e778f66

15 files changed

+121
-68
lines changed

packages/e2e-tests/src/assert/transactionDetailsAssert.ts

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ export type TransactionData = {
3232

3333
const stakeKeyRegistration = 'Stake Key Registration';
3434
const stakeKeyDeRegistration = 'Stake Key De-Registration';
35+
const selfTransaction = 'Self Transaction';
36+
3537
class TransactionsDetailsAssert {
3638
waitForTransactionsLoaded = async () => {
3739
await browser.waitUntil(async () => (await TransactionsPage.rows).length > 1, {
@@ -115,6 +117,7 @@ class TransactionsDetailsAssert {
115117
expect(actualTickers).to.have.all.members(expectedTickers);
116118
}
117119

120+
// TODO: enhance validation for various TX types
118121
async assertSeeActivityDetailsUnfolded(mode: 'extended' | 'popup') {
119122
await this.waitForTransactionsLoaded();
120123
const rowsNumber = (await TransactionsPage.rows).length;
@@ -127,7 +130,7 @@ class TransactionsDetailsAssert {
127130
await TransactionDetailsPage.transactionDetailsFeeADA.waitForDisplayed();
128131
await TransactionDetailsPage.transactionDetailsFeeFiat.waitForDisplayed();
129132
}
130-
if (txType.includes('Delegation')) {
133+
if (txType === 'Delegation') {
131134
await TransactionDetailsPage.transactionDetailsStakepoolName.waitForDisplayed();
132135
await TransactionDetailsPage.transactionDetailsStakepoolTicker.waitForDisplayed();
133136
await TransactionDetailsPage.transactionDetailsStakePoolId.waitForDisplayed();
@@ -150,6 +153,7 @@ class TransactionsDetailsAssert {
150153

151154
for (let i = 0; i <= rowsNumber && i < 10; i++) {
152155
await TransactionsPage.clickOnTransactionRow(i);
156+
await TransactionDetailsPage.transactionDetailsDescription.waitForStable();
153157
if ((await TransactionDetailsPage.transactionDetailsDescription.getText()) !== 'Rewards') {
154158
await TransactionDetailsPage.transactionDetailsInputsDropdown.waitForStable();
155159
await TransactionDetailsPage.transactionDetailsInputsDropdown.click();
@@ -176,6 +180,7 @@ class TransactionsDetailsAssert {
176180

177181
for (let i = 0; i <= rowsNumber && i < 10; i++) {
178182
await TransactionsPage.clickOnTransactionRow(i);
183+
await TransactionDetailsPage.transactionDetailsDescription.waitForStable();
179184
if ((await TransactionDetailsPage.transactionDetailsDescription.getText()) !== 'Rewards') {
180185
await TransactionDetailsPage.transactionDetailsInputsDropdown.waitForClickable();
181186
await TransactionDetailsPage.transactionDetailsInputsDropdown.click();
@@ -226,10 +231,15 @@ class TransactionsDetailsAssert {
226231
await TransactionsPage.clickOnTransactionRow(i);
227232
await TransactionDetailsPage.transactionDetailsDescription.waitForClickable({ timeout: 15_000 });
228233
if (
229-
// eslint-disable-next-line sonarjs/no-duplicate-string
230-
!['Delegation', 'Stake Key De-Registration', 'Stake Key Registration', 'Self Transaction', 'Rewards'].includes(
231-
transactionType
232-
)
234+
![
235+
'Delegation',
236+
stakeKeyDeRegistration,
237+
stakeKeyRegistration,
238+
selfTransaction,
239+
'Rewards',
240+
'Vote Delegation',
241+
'DRep Registration'
242+
].includes(transactionType)
233243
) {
234244
await TransactionDetailsPage.transactionDetailsSent.waitForDisplayed();
235245
await TransactionDetailsPage.transactionDetailsToAddress(0).waitForDisplayed();
@@ -245,7 +255,7 @@ class TransactionsDetailsAssert {
245255
const maxRowsIterator = mode === 'extended' ? 8 : 6;
246256

247257
for (let i = 0; i <= rowsNumber && i < maxRowsIterator; i++) {
248-
const skippedTransaction = ['Self Transaction', 'Rewards']; // should be covered in separate tests
258+
const skippedTransaction = [selfTransaction, 'Rewards']; // should be covered in separate tests
249259
if (!skippedTransaction.includes(await TransactionsPage.transactionsTableItemType(i).getText())) {
250260
await TransactionsPage.clickOnTransactionRow(i);
251261
await TransactionDetailsPage.transactionDetailsDescription.waitForClickable({ timeout: 15_000 });
@@ -579,7 +589,7 @@ class TransactionsDetailsAssert {
579589
case 'Received':
580590
await this.assertSeeSentReceivedSelfTransactionDetails('Received');
581591
break;
582-
case 'Self Transaction':
592+
case selfTransaction:
583593
await this.assertSeeSentReceivedSelfTransactionDetails('Self');
584594
break;
585595
case 'Delegation':

packages/e2e-tests/src/assert/transactionsPageAssert.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,6 @@ class TransactionsPageAssert {
5050
expect(await TransactionsPage.title.getText()).to.equal(await t('browserView.activity.title'));
5151
};
5252

53-
assertCounterNumberMatchesWalletTransactions = async () => {
54-
const rowsNumber = (await TransactionsPage.rows).length;
55-
const tokensCounterValue = Number((await TransactionsPage.counter.getText()).slice(1, -1));
56-
expect(rowsNumber).to.equal(tokensCounterValue);
57-
};
58-
5953
assertTxsLoaded = async () => {
6054
await (await TransactionsPage.transactionsTableRow(0))?.waitForDisplayed({ timeout: 30_000 });
6155
};
@@ -158,6 +152,7 @@ class TransactionsPageAssert {
158152
}
159153

160154
assertSeeMoreTransactions = async () => {
155+
await browser.pause(1000);
161156
const currentRowsNumber = (await TransactionsPage.rows).length;
162157
expect(currentRowsNumber).to.be.greaterThan(testContext.load('numberOfRows'));
163158
};

packages/e2e-tests/src/elements/transactionsPage.ts

Lines changed: 43 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
/* eslint-disable no-undef */
22
import SectionTitle from './sectionTitle';
3-
import { ChainablePromiseElement } from 'webdriverio';
3+
import type { ChainablePromiseElement } from 'webdriverio';
44
import testContext from '../utils/testContext';
5-
import { ChainablePromiseArray } from 'webdriverio/build/types';
5+
import type { ChainablePromiseArray } from 'webdriverio/build/types';
66
import { browser } from '@wdio/globals';
77
import transactionsPageAssert from '../assert/transactionsPageAssert';
8+
import type { TransactionType } from '../types/transactionType';
89

910
class TransactionsPage {
1011
private TRANSACTIONS_DATE = '[data-testid="transaction-date"]';
@@ -99,15 +100,46 @@ class TransactionsPage {
99100
if (tokensCounterValue > rowsCount.length) await transactionsPageAssert.assertSeeSkeleton(true);
100101
}
101102

102-
async scrollToTheLastRow() {
103-
const tokensCounterValue = Number((await this.counter.getText()).slice(1, -1));
104-
let rowsVisible = 0;
105-
while (rowsVisible < tokensCounterValue && (await this.rows).length < tokensCounterValue) {
106-
rowsVisible = (await this.rows).length;
107-
await this.scrollToTheRow(rowsVisible);
108-
await browser.pause(1000);
109-
}
103+
async scrollToTheBottomOfTheActivityList() {
104+
await browser.waitUntil(
105+
async () => {
106+
if (await this.transactionsInfiniteScroll.isExisting()) {
107+
await this.scrollToTheLastVisibleRow();
108+
}
109+
return !(await this.transactionsInfiniteScroll.isExisting());
110+
},
111+
{
112+
timeout: 2 * 60 * 1000,
113+
interval: 1000
114+
}
115+
);
116+
}
117+
118+
async scrollToTheLastVisibleRow() {
119+
const visibleRows = await this.rows;
120+
await visibleRows[visibleRows.length - 1].scrollIntoView();
121+
}
122+
123+
async findRowByTransactionType(expectedTransactionType: TransactionType): Promise<WebdriverIO.Element | null> {
124+
return await browser.waitUntil(
125+
async () => {
126+
const rows = await $$(this.TRANSACTIONS_TABLE_ROW);
127+
for (const row of rows) {
128+
const currentTransactionType = (await row.$(this.TRANSACTIONS_TABLE_ITEM_TYPE)).getText();
129+
if ((await currentTransactionType) === expectedTransactionType) return row;
130+
}
131+
132+
if (rows.length > 0) await rows[rows.length - 1].scrollIntoView();
133+
/* eslint-disable-next-line unicorn/no-null */
134+
return null;
135+
},
136+
{
137+
timeout: 2 * 60 * 1000,
138+
timeoutMsg: `Could not find row with transaction type: ${expectedTransactionType}`
139+
}
140+
);
110141
}
142+
111143
async getIndexOfTxTypeWithoutScroll(txType: string): Promise<number> {
112144
const txTypes: string[] = [];
113145
const tableItems = await $$(this.TRANSACTIONS_TABLE_ITEM_TYPE);
@@ -118,7 +150,7 @@ class TransactionsPage {
118150
}
119151

120152
async getIndexOfTxTypeWithScroll(txType: string): Promise<number> {
121-
await this.scrollToTheLastRow();
153+
await this.scrollToTheBottomOfTheActivityList();
122154
await this.transactionsInfiniteScroll.waitForDisplayed({ reverse: true, timeout: 10_000 });
123155
return await this.getIndexOfTxTypeWithoutScroll(txType);
124156
}

packages/e2e-tests/src/features/NavigationTopExtended.feature

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,9 @@ Feature: Top Navigation - Extended view
109109
And Local storage appSettings contains info about network: "Preview"
110110

111111
@LW-1717 @LW-5255 @Mainnet @Testnet
112-
@Pending @issue=LW-11786
113112
Scenario: Avatar dropdown displays a valid wallet sync status (syncing) + toast & network pill
114113
Given I close wallet synced toast
115-
When I am in the offline network mode: true
114+
When I am in the offline network mode
116115
Then I see network id with status: offline
117116
And I see a toast with text: "Network Error"
118117
When I click the menu button

packages/e2e-tests/src/features/NavigationTopPopup.feature

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,9 @@ Feature: Top Navigation - Popup view
8181
And Local storage appSettings contains info about network: "Preview"
8282

8383
@LW-4726 @LW-5254 @Mainnet @Testnet
84-
@Pending @issue=LW-11786
8584
Scenario: Avatar dropdown displays a valid wallet sync status (syncing) + toast & network pill
8685
Given I close wallet synced toast
87-
When I am in the offline network mode: true
86+
When I am in the offline network mode
8887
Then I see network id with status: offline
8988
And I see a toast with text: "Network Error"
9089
When I click the menu button

packages/e2e-tests/src/features/OwnTagsExtended.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Feature: Own Tags - Extended View
2525
And I click "Review transaction" button on "Send" page
2626
And The Tx summary screen is displayed for bundles with correct own / foreign tags
2727

28-
@LW-10262 @Testnet @Pending @issue=LW-12099
28+
@LW-10262 @Testnet
2929
Scenario: Extended View - Own Tags / Transaction details - all senders/recipients within the (active account|different account|different wallet) are flagged as: own or foreign
3030
When I navigate to Activity extended page
3131
And I save tx hash value "010403d479efd4824e7f216eabb8c39e7a748dfb80df4c7cc4d4036677affc07"

packages/e2e-tests/src/features/OwnTagsPopup.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Feature: Own Tags - Popup View
1919
| MultiWallet2 | main | own |
2020
| WalletReceiveSimpleTransactionE2E | main | foreign |
2121

22-
@LW-10263 @Testnet @Pending @issue=LW-12099
22+
@LW-10263 @Testnet
2323
Scenario: Popup View - Own Tags / Transaction details - all senders/recipients within the (active account|different account|different wallet) are flagged as: own or foreign
2424
When I navigate to Activity popup page
2525
And I save tx hash value "010403d479efd4824e7f216eabb8c39e7a748dfb80df4c7cc4d4036677affc07"

packages/e2e-tests/src/features/TransactionsExtended.part1.feature

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@Transactions-Extended
1+
@Activity-Extended
22
Feature: Transactions - Extended view
33

44
Background:
@@ -9,13 +9,12 @@ Feature: Transactions - Extended view
99
When I navigate to Activity extended page
1010
Then Activity page is displayed
1111

12-
@LW-2552 @LW-2556 @LW-2555 @Testnet @Pending @issue=LW-12099
13-
Scenario: Extended View - Activity page - Counter matches the number of rows, transactions are loaded and skeleton disappears
12+
@LW-2556 @LW-2555 @Testnet
13+
Scenario: Extended View - Activity page - transactions are loaded and skeleton disappears
1414
When I navigate to Activity extended page
1515
And Activity page is displayed
1616
And I save number of visible rows
1717
And I scroll to the last row
18-
Then a transactions counter that sums up to the total number of all transactions is displayed
1918
And a skeleton is not displayed at the bottom of the page
2019
And more transactions are loaded
2120

@@ -24,11 +23,12 @@ Feature: Transactions - Extended view
2423
When I navigate to Activity extended page
2524
Then all the transactions have a value other than zero
2625

27-
@LW-2554 @Testnet @Pending @issue=LW-12099
26+
@LW-2554 @Testnet
2827
Scenario: Extended View - Infinite scroll
2928
When I navigate to Activity extended page
3029
And Activity page is displayed
31-
And I scroll to the row: 8
30+
And I save number of visible rows
31+
And I scroll to the last visible row on Activity page
3232
Then a skeleton is displayed at the bottom of the page
3333

3434
@LW-2557 @Testnet

packages/e2e-tests/src/features/TransactionsExtended.part2.feature

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@Transactions-Extended
1+
@Activity-Extended
22
Feature: Transactions - Extended view
33

44
Background:
@@ -38,7 +38,7 @@ Feature: Transactions - Extended view
3838
When I click on a transaction: 1
3939
Then The Tx details are displayed as "core.activityDetails.sent" for ADA with value: 24.79 and wallet: "addr_test1qp7vynpwhsyjsqvyw9n8r4uy3uj5hu2arfy94vynvng6556hhqrnhndmg2pntqazt36v700x6kryqjhe75p58v65v6kszx7h3j" address
4040

41-
@LW-9914 @Testnet @Pending @issue=LW-12099
41+
@LW-9914 @Testnet
4242
Scenario Outline: Extended View - transaction list - styling: <styling> applied to tx type: <tx_type>
4343
Given I navigate to Activity extended page
4444
When I scroll to the row with transaction type: <tx_type>
@@ -48,13 +48,12 @@ Feature: Transactions - Extended view
4848
| Sent | default - negative |
4949
| Received | green - positive |
5050
| Self Transaction | default - negative |
51-
# enable rewards type of transaction when it's available
52-
# | Rewards | green - positive |
51+
| Rewards | green - positive |
5352
| Delegation | default - negative |
5453
| Stake Key De-Registration | green - positive |
5554
| Stake Key Registration | default - negative |
5655

57-
@LW-10616 @Testnet @Pending @issue=LW-12099
56+
@LW-10616 @Testnet
5857
Scenario Outline: Extended View - transaction list - details of <tx_type> type of transaction
5958
Given I navigate to Activity extended page
6059
When I scroll to the row with transaction type: <tx_type>
@@ -65,8 +64,7 @@ Feature: Transactions - Extended view
6564
| Sent |
6665
| Received |
6766
| Self Transaction |
68-
# enable rewards type of transaction when it's available
69-
# | Rewards |
67+
| Rewards |
7068
| Delegation |
7169
| Stake Key De-Registration |
7270
| Stake Key Registration |

packages/e2e-tests/src/features/TransactionsPopup.part1.feature

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@Transactions-Popup
1+
@Activity-Popup
22
Feature: Transactions - Popup view
33

44
Background:
@@ -9,21 +9,21 @@ Feature: Transactions - Popup view
99
When I navigate to Activity popup page
1010
Then Activity page is displayed
1111

12-
@LW-2541 @LW-2543 @LW-2544 @Testnet @Pending @issue=LW-12099
13-
Scenario: Popup View - Activity page - Counter matches the number of rows, transactions are loaded and skeleton disappears
12+
@LW-2543 @LW-2544 @Testnet
13+
Scenario: Popup View - Activity page - transactions are loaded and skeleton disappears
1414
When I navigate to Activity popup page
1515
And Activity page is displayed
1616
And I save number of visible rows
1717
And I scroll to the last row
18-
Then a transactions counter that sums up to the total number of all transactions is displayed
1918
And a skeleton is not displayed at the bottom of the page
2019
And more transactions are loaded
2120

22-
@LW-2542 @Testnet @Pending @issue=LW-12099
21+
@LW-2542 @Testnet
2322
Scenario: Popup View - Infinite scroll
2423
When I navigate to Activity popup page
2524
And Activity page is displayed
26-
And I scroll to the row: 7
25+
And I save number of visible rows
26+
And I scroll to the last visible row on Activity page
2727
Then a skeleton is displayed at the bottom of the page
2828

2929
@LW-2545 @Testnet

0 commit comments

Comments
 (0)