Skip to content

Commit

Permalink
Parallel execution tweaks (#926)
Browse files Browse the repository at this point in the history
Parallel execution e2e tests tweaks
  • Loading branch information
oldGreg5 authored Mar 1, 2024
1 parent 967dd38 commit 90c4177
Show file tree
Hide file tree
Showing 16 changed files with 48 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ class StakePoolDetailsAssert {
}

async assertSeeStakePoolDetailsCommonElements() {
await StakePoolDetails.poolName.waitForStable();
await StakePoolDetails.poolName.waitForClickable();
await StakePoolDetails.poolLogo.waitForDisplayed();

Expand Down
1 change: 1 addition & 0 deletions packages/e2e-tests/src/assert/tokenDetailsAssert.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ class TokenDetailsAssert {
async assertSeeTokenDrawerNavigation(mode: 'extended' | 'popup') {
await TokenDetailsPage.drawerNavigationTitle.waitForDisplayed({ reverse: mode === 'popup' });
if (mode === 'extended') {
await TokenDetailsPage.drawerNavigationTitle.waitForStable();
expect(await TokenDetailsPage.drawerNavigationTitle.getText()).to.equal(
await t('browserView.assetDetails.title')
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class TransactionBundleAssert {
};

async assertSeeTokenNameInBundleAndCoinConfigure(expectedName: string, bundleIndex: number) {
await TransactionNewPage.cancelTransactionButton.waitForStable();
const tokenName = await new TransactionBundle(bundleIndex)
.bundleAssetInput()
.coinConfigure(bundleIndex, expectedName.replace('...', ''))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@ class MultidelegationPage {
}

async fillSearch(searchTerm: string) {
await this.stakingPageSearchInput.waitForStable();
await this.stakingPageSearchInput.waitForClickable();
await this.stakingPageSearchInput.scrollIntoView();
await this.stakingPageSearchInput.click();
Expand All @@ -292,7 +293,7 @@ class MultidelegationPage {

async markStakePoolWithTicker(ticker: string) {
const poolItem = await this.getPoolByTicker(ticker);
await poolItem.moveTo();
await poolItem.scrollIntoView();
await poolItem.$(this.CHECKBOX).click();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export class AssetInput {
}

async clickAddAssetButton(): Promise<void> {
await this.assetAddButton.waitForStable();
await this.assetAddButton.click();
}
}
15 changes: 9 additions & 6 deletions packages/e2e-tests/src/elements/transactionsPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { ChainablePromiseElement } from 'webdriverio';
import testContext from '../utils/testContext';
import { ChainablePromiseArray } from 'webdriverio/build/types';
import { browser } from '@wdio/globals';
import transactionsPageAssert from '../assert/transactionsPageAssert';

class TransactionsPage {
private TRANSACTIONS_DATE = '[data-testid="transaction-date"]';
Expand Down Expand Up @@ -92,16 +93,18 @@ class TransactionsPage {
}

async scrollToTheRow(index: number) {
const rows = await this.rows;
await rows[index].scrollIntoView();
const rowsCount = await this.rows;
rowsCount[index - 1].scrollIntoView();
const tokensCounterValue = Number((await this.counter.getText()).slice(1, -1));
if (tokensCounterValue > rowsCount.length) await transactionsPageAssert.assertSeeSkeleton(true);
}

async scrollToTheLastRow() {
const tokensCounterValue = Number((await this.counter.getText()).slice(1, -1));
let rowIndex = 0;
while (rowIndex < tokensCounterValue && (await this.rows).length < tokensCounterValue) {
await this.scrollToTheRow(rowIndex);
rowIndex += 8;
let rowsVisible = 0;
while (rowsVisible < tokensCounterValue && (await this.rows).length < tokensCounterValue) {
rowsVisible = (await this.rows).length;
await this.scrollToTheRow(rowsVisible);
await browser.pause(1000);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,7 @@ Feature: Staking Page - Delegated funds - Multiple pools - Extended View
Then all pools details are expanded
When I remove "9" pools from delegation portfolio
Then I see selected pools counter is showing "1"
And I see "Remove pool from portfolio" button is disabled for pool "1"
And I see "Remove pool from portfolio" button tooltip on hover for pool "1"
And I see "Remove pool from portfolio" button is enabled for pool "1"

@LW-9476
Scenario: Extended View - Staking - Manage staking expanding and hiding all pools details
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,18 +104,17 @@ Feature: Staking Page - Delegated funds - Single pool - Extended View
And I see selected pools counter is showing "<pools_after>"
And I see "Add stake pool" button is disabled
Examples:
| pools_after | pool_tickers |
| 10 | 8BETA, ADACT, WOOF, TEKO, ADV, MOC, SQRL, SEA, ALFA |
| pools_after | pool_tickers |
| 10 | 8BETA, ADACT, WOOF, TEKO, ADV, MOC2, SQRL, SEA, ALFA |

@LW-9493
Scenario: Extended View - Staking - Manage staking remove button disabled when staking to 1 pool
Scenario: Extended View - Staking - Manage staking remove button enabled when staking to 1 pool
When I navigate to Staking extended page
And I open Overview tab
And I click Manage button
Then I see Manage delegation drawer
And I see selected pools counter is showing "1"
And I see "Remove pool from portfolio" button is disabled for pool "1"
And I see "Remove pool from portfolio" button tooltip on hover for pool "1"
And I see "Remove pool from portfolio" button is enabled for pool "1"

@LW-9509
Scenario: Extended View - Staking - Manage staking 'Confirm new portfolio' button not visible
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ Feature: Analytics - Top Navigation - Popup view
When I set up request interception for posthog analytics request(s)
And I click on the Lock Wallet option
Then I validate latest analytics single event "user/wallet profile | lock wallet | click"
And I validate that 1 analytics event(s) have been sent
And I validate that 1 analytics event(s) have been sent
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@SendSimpleTransaction-Extended-E2E @Analytics @Testnet
@Analytics-SendSimpleTransaction-Extended-E2E @Analytics @Testnet
Feature: Analytics - Posthog - Sending - Extended View

Background:
Expand All @@ -10,7 +10,7 @@ Feature: Analytics - Posthog - Sending - Extended View
And I have 2 addresses with ADA handle in my address book in extended mode
And I click "Send" button on page header
Then I validate latest analytics single event "send | send | click"
When I fill bundle 1 with "WalletReceiveSimpleTransactionE2E" address with following assets:
When I fill bundle 1 with "WalletAnalyticsReceiveSimpleTransactionE2E" address with following assets:
| type | assetName | ticker | amount |
| ADA | Cardano | tADA | 1.1234 |
When I click "Add bundle" button on "Send" page
Expand Down Expand Up @@ -40,8 +40,9 @@ Feature: Analytics - Posthog - Sending - Extended View
Scenario: Analytics - Extended-view - Send - Dapp Success Screen - View transaction - Transaction confirmed
Given I de-authorize all DApps in extended mode
And I open and authorize test DApp with "Only once" setting
And I set send to wallet address to: "WalletAnalyticsReceiveSimpleTransactionE2E" in test DApp
And I click "Send ADA" "Run" button in test DApp
And I see DApp connector "Confirm transaction" page with: "3.00 ADA", "0" assets and receiving wallet "WalletReceiveSimpleTransactionE2E"
And I see DApp connector "Confirm transaction" page with: "3.00 ADA", "0" assets and receiving wallet "WalletAnalyticsReceiveSimpleTransactionE2E"
And I set up request interception for posthog analytics request(s)
When I click "Confirm" button on "Confirm transaction" page
Then I validate latest analytics single event "send | transaction summary | confirm | click"
Expand All @@ -50,7 +51,7 @@ Feature: Analytics - Posthog - Sending - Extended View
When I click "Confirm" button on "Sign transaction" page
Then I validate latest analytics multiple events:
| send \| transaction confirmation \| confirm \| click |
| send \| all done \| view |
| send \| all done \| view |
And I validate that the "send | transaction confirmation | confirm | click" event includes property "tx_creation_type" with value "external" in posthog
And I validate that the "send | all done | view" event includes property "tx_creation_type" with value "external" in posthog
And I click "Close" button on DApp "All done" page
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@SendSimpleTransaction-Popup-E2E @Analytics @Testnet
@Analytics-SendSimpleTransaction-Popup-E2E @Analytics @Testnet
Feature: Analytics - Posthog - Sending - Popup View

Background:
Expand All @@ -10,7 +10,7 @@ Feature: Analytics - Posthog - Sending - Popup View
And I save token: "Cardano" balance
And I click "Send" button on Tokens page in popup mode
Then I validate latest analytics single event "send | send | click"
And I fill bundle 1 with "WalletReceiveSimpleTransactionE2E" address with following assets:
And I fill bundle 1 with "WalletAnalyticsReceiveSimpleTransaction2E2E" address with following assets:
| type | assetName | ticker | amount |
| ADA | Cardano | tADA | 1.1234 |
And I click "Review transaction" button on "Send" page
Expand Down
15 changes: 14 additions & 1 deletion packages/e2e-tests/src/hooks/beforeTagHooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,16 @@ Before(
async () => await popupViewWalletInitialization(TestWalletName.WalletSendSimpleTransaction2E2E)
);

Before(
{ tags: '@Analytics-SendSimpleTransaction-Extended-E2E' },
async () => await extendedViewWalletInitialization(TestWalletName.WalletAnalyticsSendSimpleTransactionE2E)
);

Before(
{ tags: '@Analytics-SendSimpleTransaction-Popup-E2E' },
async () => await popupViewWalletInitialization(TestWalletName.WalletAnalyticsSendSimpleTransaction2E2E)
);

Before(
{ tags: '@SendTransactionDapp-E2E' },
async () => await extendedViewWalletInitialization(TestWalletName.WalletSendDappTransactionE2E)
Expand All @@ -93,7 +103,10 @@ Before(
async () => await extendedViewWalletInitialization(TestWalletName.WalletCollateral)
);

Before({ tags: '@Collateral-popup' }, async () => await popupViewWalletInitialization(TestWalletName.WalletCollateral));
Before(
{ tags: '@Collateral-popup' },
async () => await popupViewWalletInitialization(TestWalletName.WalletCollateral2)
);

Before(
{ tags: '@Staking-DelegatedFunds-Popup or @NetworkSwitching-popup' },
Expand Down
1 change: 1 addition & 0 deletions packages/e2e-tests/src/pageobject/nftsPageObject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { AddressInput } from '../elements/AddressInput';
class NftsPageObject {
async clickNftItemOnNftsPage(nftName: string, clickType: 'left' | 'right' = 'left') {
const nftNameElement = await NftsPage.getNftName(nftName);
await nftNameElement.waitForStable();
await nftNameElement.click({ button: clickType });
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@ class SettingsExtendedPageObject {

clickOnRemoveWallet = async () => await SettingsPage.removeWalletButton.click();

clickOnShowPublicKey = async () => await YourKeysDrawer.showPublicKeyButton.click();
clickOnShowPublicKey = async () => {
await YourKeysDrawer.showPublicKeyButton.waitForStable();
await YourKeysDrawer.showPublicKeyButton.click();
};

clickOnNetworkRadioButton = async (network: 'Mainnet' | 'Preprod' | 'Preview') => {
switch (network) {
Expand Down
1 change: 1 addition & 0 deletions packages/e2e-tests/src/steps/nftsExtendedSteps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Given(
);

When(/^I click "Send NFT" button on NFT details drawer$/, async () => {
await NftDetails.sendNFTButton.waitForStable();
await NftDetails.sendNFTButton.click();
});

Expand Down
Binary file modified packages/e2e-tests/src/support/walletConfiguration.ts.gpg
Binary file not shown.

0 comments on commit 90c4177

Please sign in to comment.