Skip to content

Commit

Permalink
test(extension): add test lw-10998 (#1306)
Browse files Browse the repository at this point in the history
  • Loading branch information
oldGreg5 authored Jul 19, 2024
1 parent 8d8cbb0 commit e34dee5
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 0 deletions.
24 changes: 24 additions & 0 deletions packages/e2e-tests/src/assert/switchingPoolsModalAssert.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { expect } from 'chai';
import { t } from '../utils/translationService';
import SwitchingStakePoolModal from '../elements/multidelegation/SwitchingStakePoolModal';

class SwitchingPoolsModalAssert {
async assertSeeSwitchingToLessPoolsModal() {
await SwitchingStakePoolModal.title.waitForDisplayed();
expect(await SwitchingStakePoolModal.title.getText()).to.equal(await t('modals.poolsManagement.title'));
await SwitchingStakePoolModal.description.waitForDisplayed();
expect(await SwitchingStakePoolModal.description.getText()).to.equal(
await t('modals.poolsManagement.description.reduction')
);
await SwitchingStakePoolModal.fineByMeButton.waitForDisplayed();
expect(await SwitchingStakePoolModal.fineByMeButton.getText()).to.equal(
await t('modals.poolsManagement.buttons.confirm')
);
await SwitchingStakePoolModal.cancelButton.waitForDisplayed();
expect(await SwitchingStakePoolModal.cancelButton.getText()).to.equal(
await t('modals.poolsManagement.buttons.cancel')
);
}
}

export default new SwitchingPoolsModalAssert();
Original file line number Diff line number Diff line change
Expand Up @@ -180,3 +180,23 @@ Feature: Staking Page - Delegated funds - Multiple pools - Extended View
When I press keyboard Escape button
# When I press keyboard Enter button
Then Drawer is not displayed

@LW-10998
Scenario Outline: Extended View - Multidelegation - 'Switching pool' modal displayed while reducing number of staked pools, click <action>
When I navigate to Staking extended page
And I open Overview tab
And I click Manage button
Then I see Manage delegation drawer
When I expand all pools details
And I remove "1" pools from delegation portfolio
And I input 20% ratio for pool 1
Then "Confirm new portfolio" button is enabled
When I click "Confirm new portfolio" button
And I click on "Next" button on staking confirmation drawer
Then I see "Switching to less pools" modal
And I click "<action>" button on "Switching pool?" modal
Then <nextStep>
Examples:
| action | nextStep |
| Cancel | I see Manage delegation drawer Confirmation page |
| Fine by me | staking password drawer is displayed |
5 changes: 5 additions & 0 deletions packages/e2e-tests/src/steps/multidelegationSteps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import StakingInfoCard from '../elements/multidelegation/StakingInfoCard';
import StakingExitModal from '../elements/multidelegation/StakingExitModal';
import StakingExitModalAssert from '../assert/multidelegation/StakingExitModalAssert';
import StakingErrorDrawerAssert from '../assert/multidelegation/StakingErrorDrawerAssert';
import SwitchingPoolsModalAssert from '../assert/switchingPoolsModalAssert';

const validPassword = 'N_8J@bne87A';

Expand Down Expand Up @@ -662,3 +663,7 @@ When(/^I click "(Cancel|Fine by me)" button on "Switching pool\?" modal$/, async
Then(/^the staking error screen is displayed$/, async () => {
await StakingErrorDrawerAssert.assertSeeStakingError();
});

Then(/^I see "Switching to less pools" modal$/, async () => {
await SwitchingPoolsModalAssert.assertSeeSwitchingToLessPoolsModal();
});

0 comments on commit e34dee5

Please sign in to comment.