-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(extension): update tests for HW wallet (#1078)
- Loading branch information
1 parent
f32d2a1
commit 2bb331d
Showing
9 changed files
with
106 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
packages/e2e-tests/src/assert/onboarding/ConnectYourDevicePageAssert.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import ConnectYourDevicePage from '../../elements/onboarding/ConnectYourDevicePage'; | ||
import { t } from '../../utils/translationService'; | ||
import { expect } from 'chai'; | ||
import OnboardingCommonAssert from './onboardingCommonAssert'; | ||
|
||
class ConnectYourDevicePageAssert extends OnboardingCommonAssert { | ||
async assertSeeConnectYourDevicePage() { | ||
await this.assertSeeStepTitle(await t('core.walletSetupConnectHardwareWalletStepRevamp.title')); | ||
// TODO: replace subtitle assertions when USE_TREZOR_HW=true | ||
// await this.assertSeeStepSubtitle(await t('core.walletSetupConnectHardwareWalletStepRevamp.subTitle')); | ||
await this.assertSeeStepSubtitle(await t('core.walletSetupConnectHardwareWalletStepRevamp.subTitleLedgerOnly')); | ||
|
||
await ConnectYourDevicePage.loader.waitForDisplayed(); | ||
|
||
await this.assertSeeBackButton(); | ||
await this.assertSeeTryAgainButton(false); | ||
|
||
await this.assertSeeLegalLinks(); | ||
await this.assertSeeHelpAndSupportButton(); | ||
} | ||
|
||
async assertSeeError(expectedErrorMessage: string) { | ||
await ConnectYourDevicePage.errorImage.waitForDisplayed(); | ||
await ConnectYourDevicePage.banner.container.waitForDisplayed(); | ||
expect(await ConnectYourDevicePage.banner.description.getText()).to.equal(expectedErrorMessage); | ||
} | ||
|
||
async assertSeeTryAgainButton(shouldBeVisible: boolean) { | ||
await ConnectYourDevicePage.tryAgainButton.waitForDisplayed({ reverse: !shouldBeVisible }); | ||
if (shouldBeVisible) { | ||
expect(await ConnectYourDevicePage.tryAgainButton.getText()).to.equal( | ||
await t('core.walletSetupConnectHardwareWalletStepRevamp.errorCta') | ||
); | ||
} | ||
} | ||
|
||
async assertSeeTryAgainButtonEnabled(shouldBeEnabled: boolean) { | ||
await ConnectYourDevicePage.tryAgainButton.waitForEnabled({ reverse: !shouldBeEnabled }); | ||
} | ||
} | ||
|
||
export default new ConnectYourDevicePageAssert(); |
47 changes: 0 additions & 47 deletions
47
packages/e2e-tests/src/assert/onboarding/onboardingConnectHWPageAssert.ts
This file was deleted.
Oops, something went wrong.
27 changes: 27 additions & 0 deletions
27
packages/e2e-tests/src/elements/onboarding/ConnectYourDevicePage.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* eslint-disable no-undef*/ | ||
import CommonOnboardingElements from './commonOnboardingElements'; | ||
import { ChainablePromiseElement } from 'webdriverio'; | ||
import Banner from '../banner'; | ||
|
||
export class ConnectYourDevicePage extends CommonOnboardingElements { | ||
private LOADER_IMAGE = '[data-testid="loader-image"]'; | ||
private ERROR_IMAGE = '[data-testid="error-image"]'; | ||
|
||
get loader(): ChainablePromiseElement<WebdriverIO.Element> { | ||
return $(this.LOADER_IMAGE); | ||
} | ||
|
||
get errorImage(): ChainablePromiseElement<WebdriverIO.Element> { | ||
return $(this.ERROR_IMAGE); | ||
} | ||
|
||
get tryAgainButton(): ChainablePromiseElement<WebdriverIO.Element> { | ||
return this.nextButton; | ||
} | ||
|
||
get banner(): typeof Banner { | ||
return Banner; | ||
} | ||
} | ||
|
||
export default new ConnectYourDevicePage(); |
34 changes: 0 additions & 34 deletions
34
packages/e2e-tests/src/elements/onboarding/connectHardwareWalletPage.ts
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters