Skip to content

Commit

Permalink
test/maintenance-05-Jul-2023 (#222)
Browse files Browse the repository at this point in the history
* test(extension): fix LW-4806

* test(extension): update LW-4743

* test(extension): fix LW-2662

* test(extension): add waiting for main loader to disappear

* test(extension): adjust stake pool search handling

(cherry picked from commit fa0c58e)
  • Loading branch information
wklos-iohk authored and danielmain committed Jul 7, 2023
1 parent 2b88df6 commit 5b86ff5
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ export const MainLoader = ({ text }: MainLoaderProps): React.ReactElement => {

return (
<div className={styles.loaderContainer} data-testid="main-loader">
<Loader className={styles.loader} />
<p>{text ?? t('general.loading')}</p>
<Loader className={styles.loader} data-testid="main-loader-image" />
<p data-testid="main-loader-text">{text ?? t('general.loading')}</p>
</div>
);
};
19 changes: 19 additions & 0 deletions packages/e2e-tests/src/elements/MainLoader.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
class MainLoader {
private MAIN_LOADER_COMPONENT = '[data-testid="main-loader"]';
private MAIN_LOADER_IMAGE = '[data-testid="main-image"]';
private MAIN_LOADER_TEXT = '[data-testid="main-text"]';

get component() {
return $(this.MAIN_LOADER_COMPONENT);
}

get image() {
return $(this.MAIN_LOADER_IMAGE);
}

get text() {
return $(this.MAIN_LOADER_TEXT);
}
}

export default new MainLoader();
Original file line number Diff line number Diff line change
Expand Up @@ -309,9 +309,11 @@ Feature: Onboarding - Restore wallet
@LW-4743
Scenario: Restore wallet - Enter and Escape buttons support
Given I click "Restore" button on wallet setup page
And "Restoring a multi-address wallet?" modal is displayed
When I press keyboard Escape button
Then "Get started" page is displayed
Given I click "Restore" button on wallet setup page
And "Restoring a multi-address wallet?" modal is displayed
When I press keyboard Enter button
Then "Legal page" is displayed
When I press keyboard Enter button
Expand Down
4 changes: 2 additions & 2 deletions packages/e2e-tests/src/features/SettingsPagePopup.feature
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ Feature: General Settings - Popup View
And I see address count: 3
When I switch network to: "Mainnet" in popup mode
And I open address book in popup mode
Then I see information about empty address book
Then I see empty address book
When I switch network to: "Preprod" in popup mode
And I open address book in popup mode
Then I see address count: 3
Expand All @@ -204,7 +204,7 @@ Feature: General Settings - Popup View
And I see address count: 3
When I switch network to: "Preprod" in popup mode
And I open address book in popup mode
Then I see information about empty address book
Then I see empty address book
@LW-5472 @Testnet
Scenario: Popup View - Settings - Addresses entered in Preprod context are not available when switching to Preview
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Feature: Staking Page - Extended Browser View
| NED# | 0 | | |
| PAN | 1 | PANL Stake Pool (Pre-Production) | PANL |
| 123456 | 0 | | |
| LB | 2 | LBCrypt Preview/Preprod Pool | LBCT2 |
| AZ | 2 | AzureADA | AZUR |
| £££ | 0 | | |
| Amso | 0 | | |

Expand Down
3 changes: 2 additions & 1 deletion packages/e2e-tests/src/pageobject/stakingPageObject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ class StakingPageObject {
async fillSearch(term: string) {
await StakingPage.stakingPageSearchInput.waitForEnabled();
await StakingPage.stakingPageSearchInput.scrollIntoView();
await StakingPage.stakingPageSearchInput.setValue(term);
await StakingPage.stakingPageSearchInput.click();
await browser.keys([...term]);
await browser.pause(500);
}

Expand Down
3 changes: 3 additions & 0 deletions packages/e2e-tests/src/steps/onboardingSteps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import TokensPageAssert from '../assert/tokensPageAssert';
import TopNavigationAssert from '../assert/topNavigationAssert';
import testContext from '../utils/testContext';
import webTester from '../actor/webTester';
import MainLoader from '../elements/MainLoader';

const mnemonicWords: string[] = getTestWallet(TestWalletName.TestAutomationWallet).mnemonic;
const invalidMnemonicWords: string[] = getTestWallet(TestWalletName.InvalidMnemonic).mnemonic;
Expand Down Expand Up @@ -537,6 +538,8 @@ Then(/^"Next" button is (enabled|disabled) during onboarding process$/, async (s
When(
/^I click "(Got it|Learn more)" button on "DApp connector is now in Beta" modal$/,
async (button: 'Got it' | 'Learn more') => {
// Wait for main page to finish loading
await MainLoader.component.waitForDisplayed({ reverse: true, timeout: 3000 });
if (button === 'Got it') {
await Modal.cancelButton.waitForClickable();
await Modal.cancelButton.click();
Expand Down

0 comments on commit 5b86ff5

Please sign in to comment.