Skip to content

Commit 7239eed

Browse files
authored
test: fix multidelegation tests (#1971)
1 parent 0c77c98 commit 7239eed

6 files changed

+25
-8
lines changed

packages/e2e-tests/src/elements/multidelegation/MultidelegationPage.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -547,6 +547,13 @@ class MultidelegationPage {
547547
});
548548
}
549549

550+
async waitForStakePoolGridToLoad() {
551+
await browser.waitUntil(async () => (await this.displayedCards).length > 1, {
552+
timeout: 30_000,
553+
timeoutMsg: 'failed while waiting for stake pool grid to load'
554+
});
555+
}
556+
550557
async clickManageButton() {
551558
await this.manageBtn.waitForClickable();
552559
await this.manageBtn.click();

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ Feature: Staking Page - Extended View
3737
And (if applicable) first stake pool search result has "<stake_pool_ticker>" ticker
3838
Examples:
3939
| stake_pool_search_term | number_of_results | stake_pool_ticker |
40-
| a Ocean | 3 | OCEAN |
41-
| a ocean | 3 | OCEAN |
40+
| a Capital | 2 | ADACT |
41+
| a capital | 2 | ADACT |
4242
| ABC# | 0 | |
4343
| HUA | 2 | HUADA |
4444
| 123456 | 0 | |

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,6 @@ Feature: Staking Page - Extended View
9696
And I am on Staking extended page
9797
And I open Browse pools tab
9898
And I switch to list view on "Browse pools" tab
99-
And I wait for stake pool list to be populated
100-
When I scroll down 500 pixels
10199
Then stake pool list row skeleton is displayed
102100
When I wait 500 milliseconds
103101
Then stake pool list row skeleton is not displayed
@@ -107,8 +105,6 @@ Feature: Staking Page - Extended View
107105
And I am on Staking extended page
108106
And I open Browse pools tab
109107
And I switch to grid view on "Browse pools" tab
110-
When I scroll down 500 pixels
111-
And I scroll down 500 pixels
112108
Then stake pool grid card skeleton is displayed
113109
When I wait 500 milliseconds
114110
Then stake pool grid card skeleton is not displayed

packages/e2e-tests/src/features/MultiDelegationPageExtended.part3.feature

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ Feature: Staking Page - Extended View
102102
Given I reset default behaviour for modal about issues with multi-delegation and DApps
103103
When I navigate to Staking extended page
104104
And I open Browse pools tab
105+
And I wait for stake pool grid to be populated
105106
And I click on a random stake pool from the grid
106107
And I click on "Stake all on this pool" button on stake pool details drawer
107108
And I click "Add stake pool" button
@@ -117,6 +118,7 @@ Feature: Staking Page - Extended View
117118
When I navigate to Staking extended page
118119
And I open Browse pools tab
119120
And I switch to list view on "Browse pools" tab
121+
And I wait for stake pool list to be populated
120122
And I click on a random stake pool from the list
121123
And I click on "Stake all on this pool" button on stake pool details drawer
122124
And I click "Add stake pool" button
@@ -131,6 +133,7 @@ Feature: Staking Page - Extended View
131133
Given I reset default behaviour for modal about issues with multi-delegation and DApps
132134
When I navigate to Staking extended page
133135
And I open Browse pools tab
136+
And I wait for stake pool grid to be populated
134137
And I click on a random stake pool from the grid
135138
And I click on "Select pool for multi-staking" button on stake pool details drawer
136139
Then I see the modal about issues with multi-delegation and DApps

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ Feature: Staking Page - Delegated funds - Single pool - Extended View
130130
When I navigate to Staking extended page
131131
And I open Browse pools tab
132132
And I switch to list view on "Browse pools" tab
133+
And I wait for stake pool list to be populated
133134
And I click on a random stake pool from the list
134135
And I click on "Stake all on this pool" button on stake pool details drawer
135136
And I click "Fine by me" button on "Changing staking preferences?" modal
@@ -145,6 +146,7 @@ Feature: Staking Page - Delegated funds - Single pool - Extended View
145146
Given I reset default behaviour for modal about issues with multi-delegation and DApps
146147
When I navigate to Staking extended page
147148
And I open Browse pools tab
149+
And I wait for stake pool grid to be populated
148150
And I click on a random stake pool from the grid
149151
And I click on "Select pool for multi-staking" button on stake pool details drawer
150152
Then I see the modal about issues with multi-delegation and DApps

packages/e2e-tests/src/steps/multidelegationSteps.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -360,8 +360,17 @@ Given(/^I click "Expand view" on Start Staking page$/, async () => {
360360
await StartStakingPage.clickExpandedViewBannerButton();
361361
});
362362

363-
When(/^I wait for stake pool list to be populated$/, async () => {
364-
await MultidelegationPage.waitForStakePoolListToLoad();
363+
When(/^I wait for stake pool (grid|list) to be populated$/, async (view: 'grid' | 'list') => {
364+
switch (view) {
365+
case 'grid':
366+
await MultidelegationPage.waitForStakePoolGridToLoad();
367+
break;
368+
case 'list':
369+
await MultidelegationPage.waitForStakePoolListToLoad();
370+
break;
371+
default:
372+
throw new Error(`Unsupported stake pool display view: ${view}`);
373+
}
365374
});
366375

367376
Then(

0 commit comments

Comments
 (0)