-
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): add tests for LW-10208
- Loading branch information
1 parent
e778f66
commit 31fd5b1
Showing
6 changed files
with
76 additions
and
6 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
24 changes: 24 additions & 0 deletions
24
packages/e2e-tests/src/assert/PinWalletExtensionNotificationAssert.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,24 @@ | ||
import PinWalletExtensionNotification from '../elements/PinWalletExtensionNotification'; | ||
import { expect } from 'chai'; | ||
import { t } from '../utils/translationService'; | ||
|
||
class PinWalletExtensionNotificationAssert { | ||
async assertSeeNotification(): Promise<void> { | ||
await PinWalletExtensionNotification.component.waitForDisplayed(); | ||
await PinWalletExtensionNotification.logo.waitForDisplayed(); | ||
await PinWalletExtensionNotification.title.waitForDisplayed(); | ||
expect(await PinWalletExtensionNotification.title.getText()).to.equal(await t('browserView.pinExtension.title')); | ||
await PinWalletExtensionNotification.prompt.waitForDisplayed(); | ||
const expectedPrompt = (await t('browserView.pinExtension.prompt')).replace('<icon/>', '').replace(/\s{2,}/g, ' '); | ||
const actualPromptText = (await PinWalletExtensionNotification.prompt.getText()).replace('\n', ' '); | ||
expect(actualPromptText).to.equal(expectedPrompt); | ||
await PinWalletExtensionNotification.icon.waitForDisplayed(); | ||
} | ||
|
||
async assertDoNotSeeNotificationAfter(seconds: number): Promise<void> { | ||
await browser.pause(seconds * 1000); | ||
await PinWalletExtensionNotification.component.waitForDisplayed({ reverse: true }); | ||
} | ||
} | ||
|
||
export default new PinWalletExtensionNotificationAssert(); |
32 changes: 32 additions & 0 deletions
32
packages/e2e-tests/src/elements/PinWalletExtensionNotification.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,32 @@ | ||
/* global WebdriverIO */ | ||
import type { ChainablePromiseElement } from 'webdriverio'; | ||
|
||
class PinWalletExtensionNotification { | ||
private COMPONENT = '[data-testid="pin-extension-component"]'; | ||
private LOGO = '[data-testid="pin-extension-logo"]'; | ||
private TITLE = '[data-testid="pin-extension-title"]'; | ||
private PROMPT = '[data-testid="pin-extension-prompt"]'; | ||
private ICON = '[data-testid="pin-extension-icon"]'; | ||
|
||
get component(): ChainablePromiseElement<WebdriverIO.Element> { | ||
return $(this.COMPONENT); | ||
} | ||
|
||
get logo(): ChainablePromiseElement<WebdriverIO.Element> { | ||
return $(this.LOGO); | ||
} | ||
|
||
get title(): ChainablePromiseElement<WebdriverIO.Element> { | ||
return $(this.TITLE); | ||
} | ||
|
||
get prompt(): ChainablePromiseElement<WebdriverIO.Element> { | ||
return $(this.PROMPT); | ||
} | ||
|
||
get icon(): ChainablePromiseElement<WebdriverIO.Element> { | ||
return $(this.ICON); | ||
} | ||
} | ||
|
||
export default new PinWalletExtensionNotification(); |
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