Skip to content

Commit b1f5067

Browse files
authored
test(extension): maintenance 16 Jun 2025 (#1906)
* test(extension): block scenario related to LW-13073 * test(extension): add tests for LW-13074 and LW-13075 * test(extension): fix LW-12035, LW-12036, LW-12039, LW-12040
1 parent 1704b5d commit b1f5067

12 files changed

+75
-31
lines changed

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,14 @@ class VotingCenterPageAssert {
1414
: 'browserView.voting-beta.modal.description';
1515
const expectedDescription = (await t(expectedDescriptionKey)).replaceAll('<br /><br />', '\n\n');
1616
expect(await VotingCenterPage.description.getProperty('innerText')).to.equal(expectedDescription);
17-
await VotingCenterPage.govToolButton.waitForClickable();
18-
expect(await VotingCenterPage.govToolButton.getText()).to.equal(await t('browserView.voting-beta.modal.cta'));
17+
await VotingCenterPage.accessGovToolButton.waitForClickable();
18+
expect(await VotingCenterPage.accessGovToolButton.getText()).to.equal(
19+
await t('browserView.voting-beta.modal.govTool.cta')
20+
);
21+
await VotingCenterPage.accessTempoVoteButton.waitForClickable();
22+
expect(await VotingCenterPage.accessTempoVoteButton.getText()).to.equal(
23+
await t('browserView.voting-beta.modal.tempoVote.cta')
24+
);
1925
}
2026
}
2127

packages/e2e-tests/src/assert/multidelegation/DelegateYourVotingPowerBannerAssert.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ class DelegateYourVotingPowerBannerAssert {
1616
.replace('</a>', '');
1717
expect(await DelegateYourVotingPowerBanner.description.getText()).to.equal(expectedDescription);
1818
await DelegateYourVotingPowerBanner.knowMoreLink.waitForDisplayed();
19-
await DelegateYourVotingPowerBanner.registerButton.waitForEnabled();
20-
expect(await DelegateYourVotingPowerBanner.registerButton.getText()).to.equal(
19+
await DelegateYourVotingPowerBanner.registerNowButton.waitForEnabled();
20+
expect(await DelegateYourVotingPowerBanner.registerNowButton.getText()).to.equal(
2121
await t('browserView.staking.stakingInfo.RegisterAsDRepBanner.cta')
2222
);
2323
}

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

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ class VotingCenterPage {
55
private readonly BANNER = '[data-testid="voting-center-banner"]';
66
private readonly TITLE = '[data-testid="voting-center-banner-title"]';
77
private readonly DESCRIPTION = '[data-testid="voting-center-banner-description"]';
8-
private readonly GOV_TOOL_BUTTON = '[data-testid="voting-center-gov-tool-button"]';
8+
private readonly ACCESS_GOV_TOOL_BUTTON = '[data-testid="voting-center-gov-tool-button"]';
9+
private readonly ACCESS_TEMPO_VOTE_BUTTON = '[data-testid="voting-center-tempo-vote-button"]';
910

1011
get banner(): ChainablePromiseElement<WebdriverIO.Element> {
1112
return $(this.BANNER);
@@ -19,13 +20,27 @@ class VotingCenterPage {
1920
return $(this.DESCRIPTION);
2021
}
2122

22-
get govToolButton(): ChainablePromiseElement<WebdriverIO.Element> {
23-
return $(this.GOV_TOOL_BUTTON);
23+
get accessGovToolButton(): ChainablePromiseElement<WebdriverIO.Element> {
24+
return $(this.ACCESS_GOV_TOOL_BUTTON);
2425
}
2526

26-
async clickOnGovToolButton(): Promise<void> {
27-
await this.govToolButton.waitForClickable();
28-
await this.govToolButton.click();
27+
get accessTempoVoteButton(): ChainablePromiseElement<WebdriverIO.Element> {
28+
return $(this.ACCESS_TEMPO_VOTE_BUTTON);
29+
}
30+
31+
async clickOnButton(button: 'Access Gov.tool' | 'Access Tempo.vote'): Promise<void> {
32+
switch (button) {
33+
case 'Access Gov.tool':
34+
await this.accessGovToolButton.waitForClickable();
35+
await this.accessGovToolButton.click();
36+
break;
37+
case 'Access Tempo.vote':
38+
await this.accessTempoVoteButton.waitForClickable();
39+
await this.accessTempoVoteButton.click();
40+
break;
41+
default:
42+
throw new Error(`Unsupported button: ${button}`);
43+
}
2944
}
3045
}
3146

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ class DelegateYourVotingPowerBanner {
66
private BANNER_TITLE = '[data-testid="register-as-drep-banner-title"]';
77
private BANNER_DESCRIPTION = '[data-testid="register-as-drep-banner-description"]';
88
private KNOW_MORE_LINK = '[data-testid="know-more-link"]';
9-
private REGISTER_BUTTON = '[data-testid="register-now-at-gov-tool-button"]';
9+
private REGISTER_NOW_BUTTON = '[data-testid="register-now-button"]';
1010

1111
get container(): ChainablePromiseElement<WebdriverIO.Element> {
1212
return $(this.BANNER_CONTAINER);
@@ -24,17 +24,17 @@ class DelegateYourVotingPowerBanner {
2424
return $(this.KNOW_MORE_LINK);
2525
}
2626

27-
get registerButton(): ChainablePromiseElement<WebdriverIO.Element> {
28-
return $(this.REGISTER_BUTTON);
27+
get registerNowButton(): ChainablePromiseElement<WebdriverIO.Element> {
28+
return $(this.REGISTER_NOW_BUTTON);
2929
}
3030

3131
async clickOnKnowMoreLink(): Promise<void> {
3232
await this.knowMoreLink.click();
3333
}
3434

35-
async clickRegisterButton(): Promise<void> {
36-
await this.registerButton.waitForClickable();
37-
await this.registerButton.click();
35+
async clickRegisterNowButton(): Promise<void> {
36+
await this.registerNowButton.waitForClickable();
37+
await this.registerNowButton.click();
3838
}
3939
}
4040

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Feature: Staking Page - Delegated funds - Multiple pools - Not registered voting
1616
Then I see a "FAQ" article with title "What is the Voltaire GovTool?"
1717

1818
@LW-12039
19-
Scenario: Extended View - "Delegate your voting power" banner - click on "Register now at Gov Tool" button
19+
Scenario: Extended View - "Delegate your voting power" banner - click on "Register now" button
2020
When I navigate to Staking extended page
21-
And I click on "Register now at Gov Tool" button
22-
Then Gov Tool page is displayed in a new tab
21+
And I click on "Register now" button
22+
Then I'm redirected to "Voting Center" page

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Feature: Staking Page - Delegated funds - Multiple pools - Not registered voting
1616
Then I see a "FAQ" article with title "What is the Voltaire GovTool?"
1717

1818
@LW-12040
19-
Scenario: Popup View - "Delegate your voting power" banner - click on "Register now at Gov Tool" button
19+
Scenario: Popup View - "Delegate your voting power" banner - click on "Register now" button
2020
When I navigate to Staking popup page
21-
And I click on "Register now at Gov Tool" button
22-
Then Gov Tool page is displayed in a new tab
21+
And I click on "Register now" button
22+
Then I'm redirected to "Voting Center" page

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,5 +69,5 @@ Feature: LW: Tokens tab - extended view
6969
| Video | Secure self-custody with Lace |
7070
| Video | Connecting to DApps with Lace |
7171
| FAQ | How is the Conway Ledger era (also called governance era) supported by Lace? |
72-
| FAQ | What type of governance features are supported in Lace? |
72+
# | FAQ | What type of governance features are supported in Lace? | # TODO: unblock when LW-13073 is resolved
7373
| FAQ | What type of governance actions are supported by Lace? |

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,13 @@ Feature: Voting Center - Extended View
44
Background:
55
Given Lace is ready for test
66

7-
@LW-12329 @LW-12331
8-
Scenario: Extended view - Voting Center - open and redirect to Gov.tools
7+
@LW-12329 @LW-12331 @LW-13074
8+
Scenario: Extended view - Voting Center - open and redirect to Gov.tools/Tempo.vote
99
When I navigate to Voting extended page
1010
Then I see "Voting Center" banner
1111
And I see "Learn about" widget with all relevant items
1212
When I click on "Access Gov.tool" button
1313
Then New tab with url containing "gov.tools" is opened
14+
When I switch to window with Lace
15+
And I click on "Access Tempo.vote" button
16+
Then New tab with url containing "tempo.vote" is opened

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,12 @@ Feature: Voting Center - Popup View
44
Background:
55
Given Lace is ready for test
66

7-
@LW-12330 @LW-12332
8-
Scenario: Popup view - Voting Center - open and redirect to Gov.tools
7+
@LW-12330 @LW-12332 @LW-13075
8+
Scenario: Popup view - Voting Center - open and redirect to Gov.tools/Tempo.vote
99
When I navigate to Voting popup page
1010
Then I see "Voting Center" banner
1111
When I click on "Access Gov.tool" button
1212
Then New tab with url containing "gov.tools" is opened
13+
When I switch to window with Lace
14+
And I click on "Access Tempo.vote" button
15+
Then New tab with url containing "tempo.vote" is opened

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

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import { Then, When } from '@cucumber/cucumber';
22
import educationalListAssert from '../assert/educationalListAssert';
33
import VotingCenterPageAssert from '../assert/VotingCenterPageAssert';
44
import VotingCenterPage from '../elements/VotingCenterPage';
5+
import { expect } from 'chai';
6+
import { browser } from '@wdio/globals';
57

68
Then(/^I see "Voting Center" banner$/, async () => {
79
await VotingCenterPageAssert.assertSeeVotingCenterBanner();
@@ -11,6 +13,14 @@ Then(/^I see "Learn about" widget with all relevant items$/, async () => {
1113
await educationalListAssert.assertSeeVotingWidget();
1214
});
1315

14-
When(/^I click on "Access Gov.tool" button$/, async () => {
15-
await VotingCenterPage.clickOnGovToolButton();
16+
When(
17+
/^I click on "(Access Gov.tool|Access Tempo.vote)" button$/,
18+
async (button: 'Access Gov.tool' | 'Access Tempo.vote') => {
19+
await VotingCenterPage.clickOnButton(button);
20+
}
21+
);
22+
23+
Then(/^I'm redirected to "Voting Center" page$/, async () => {
24+
expect(await browser.getUrl()).to.contain('/voting');
25+
await VotingCenterPageAssert.assertSeeVotingCenterBanner();
1626
});

0 commit comments

Comments
 (0)