Skip to content

Commit

Permalink
test(extension): test maintenance 27 Sep (#1453)
Browse files Browse the repository at this point in the history
  • Loading branch information
ljagiela authored Sep 27, 2024
1 parent cb3fffe commit 2309b20
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 12 deletions.
13 changes: 8 additions & 5 deletions packages/e2e-tests/src/elements/toastMessage.ts
Original file line number Diff line number Diff line change
@@ -1,27 +1,30 @@
/* eslint-disable no-undef */
import { ChainablePromiseElement } from 'webdriverio';

class ToastMessage {
private CONTAINER = '[data-testid="toast-content-wrapper"]';
private MESSAGE_TEXT = '[data-testid="toast-message-text"]';
private ICON = '[data-testid="toast-icon"]';
private CLOSE_BUTTON = '[data-testid="toast-close-btn"]';
private PROGRESS_BAR = '[data-testid="progressbar-wrapper-id"]';

get container() {
get container(): ChainablePromiseElement<WebdriverIO.Element> {
return $(this.CONTAINER);
}

get messageText() {
get messageText(): ChainablePromiseElement<WebdriverIO.Element> {
return $(this.MESSAGE_TEXT);
}

get icon() {
get icon(): ChainablePromiseElement<WebdriverIO.Element> {
return $(this.ICON);
}

get closeButton() {
get closeButton(): ChainablePromiseElement<WebdriverIO.Element> {
return $(this.CLOSE_BUTTON);
}

get progressBar() {
get progressBar(): ChainablePromiseElement<WebdriverIO.Element> {
return $(this.PROGRESS_BAR);
}

Expand Down
11 changes: 7 additions & 4 deletions packages/e2e-tests/src/elements/trezorConnectPage.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,26 @@
/* eslint-disable no-undef */
import { ChainablePromiseElement } from 'webdriverio';

class TrezorConnectPage {
private CONFIRM_BUTTON = '[data-test="@permissions/confirm-button"]';
private EXPORT_BUTTON = '[id="container"] .confirm';
private ANALYTICS_CONFIRM_BUTTON = '[data-test="@analytics/continue-button"]';
private ANALYTICS_TOGGLE_BUTTON = '[data-test="@analytics/toggle-switch"]';
private SHADOW_ROOT = '#react';

get confirmButton() {
get confirmButton(): ChainablePromiseElement<WebdriverIO.Element> {
return $(this.CONFIRM_BUTTON);
}

get analyticsConfirmButton() {
get analyticsConfirmButton(): ChainablePromiseElement<WebdriverIO.Element> {
return $(this.SHADOW_ROOT).shadow$(this.ANALYTICS_CONFIRM_BUTTON);
}

get analyticsToggleButton() {
get analyticsToggleButton(): ChainablePromiseElement<WebdriverIO.Element> {
return $(this.SHADOW_ROOT).shadow$(this.ANALYTICS_TOGGLE_BUTTON);
}

get exportButton() {
get exportButton(): ChainablePromiseElement<WebdriverIO.Element> {
return $(this.EXPORT_BUTTON);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ Feature: Send Transactions from Dapp - E2E
And I fill correct password
And I click "Confirm" button on "Sign transaction" page
And I see DApp connector "All done" page
Then I click "Send ADA" "Run" button in test DApp
Then I see DApp connector "All done" page on 3 window handle
And I see DApp connector "Confirm transaction" page on 4 window handle
And I click "Send ADA" "Run" button in test DApp without retry
When I switch to last window
Then I see DApp connector "Confirm transaction" page with all UI elements and with following data in "Transaction Summary" section:
| -3.00 tADA - FEE |
6 changes: 6 additions & 0 deletions packages/e2e-tests/src/steps/dAppConnectorSteps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,12 @@ Then(/^I click "(Send ADA|Send Token)" "Run" button in test DApp$/, async (runBu
}
});

Then(/^I click "Send ADA" "Run" button in test DApp without retry$/, async () => {
await DAppConnectorPageObject.switchToTestDAppWindow();
await browser.pause(1000);
await TestDAppPage.sendAdaRunButton.click();
});

Then(/^I click "(Send ADA|Send Token)" button in test DApp$/, async (buttonId: 'Send ADA' | 'Send Token') => {
await DAppConnectorPageObject.switchToTestDAppWindow();
switch (buttonId) {
Expand Down

0 comments on commit 2309b20

Please sign in to comment.