diff --git a/app/scripts/lib/transaction/metrics.ts b/app/scripts/lib/transaction/metrics.ts index 15713a72b62e..9981d1148907 100644 --- a/app/scripts/lib/transaction/metrics.ts +++ b/app/scripts/lib/transaction/metrics.ts @@ -42,6 +42,7 @@ import { getSnapAndHardwareInfoForMetrics, type SnapAndHardwareMessenger, } from '../snap-keyring/metrics'; +import { REDESIGN_TRANSACTION_TYPES } from '../../../../ui/pages/confirmations/utils'; export type TransactionMetricsRequest = { createEventFragment: ( @@ -978,6 +979,13 @@ async function buildEventFragmentProperties({ uiCustomizations.push(MetaMetricsEventUiCustomization.GasEstimationFailed); } + if ( + REDESIGN_TRANSACTION_TYPES.includes(transactionMeta.type as TransactionType) + ) { + uiCustomizations.push( + MetaMetricsEventUiCustomization.RedesignedConfirmation, + ); + } const smartTransactionMetricsProperties = getSmartTransactionMetricsProperties( transactionMetricsRequest, diff --git a/test/e2e/tests/confirmations/transactions/contract-interaction-redesign.spec.js b/test/e2e/tests/confirmations/transactions/contract-interaction-redesign.spec.ts similarity index 57% rename from test/e2e/tests/confirmations/transactions/contract-interaction-redesign.spec.js rename to test/e2e/tests/confirmations/transactions/contract-interaction-redesign.spec.ts index f77bcaa20f8f..79b83961bff0 100644 --- a/test/e2e/tests/confirmations/transactions/contract-interaction-redesign.spec.js +++ b/test/e2e/tests/confirmations/transactions/contract-interaction-redesign.spec.ts @@ -1,3 +1,19 @@ +/* eslint-disable @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires */ +import GanacheContractAddressRegistry from '../../../seeder/ganache-contract-address-registry'; +import { + assertAdvancedGasDetails, + assertAdvancedGasDetailsWithL2Breakdown, + confirmContractDeploymentTransaction, + confirmDepositTransaction, + confirmDepositTransactionWithCustomNonce, + createContractDeploymentTransaction, + createDepositTransaction, + TestSuiteArguments, + toggleAdvancedDetails, + toggleOnCustomNonce, + toggleOnHexData, +} from './shared'; + const { hexToNumber } = require('@metamask/utils'); const { defaultGanacheOptions, @@ -8,7 +24,6 @@ const { withFixtures, } = require('../../../helpers'); const FixtureBuilder = require('../../../fixture-builder'); -const { scrollAndConfirmAndAssertConfirm } = require('../helpers'); const { SMART_CONTRACTS } = require('../../../seeder/smart-contracts'); const { CHAIN_IDS } = require('../../../../../shared/constants/network'); @@ -34,10 +49,10 @@ describe('Confirmation Redesign Contract Interaction Component', function () { smartContract, title: this.test?.fullTitle(), }, - async ({ driver, contractRegistry }) => { - const contractAddress = await contractRegistry.getContractAddress( - smartContract, - ); + async ({ driver, contractRegistry }: TestSuiteArguments) => { + const contractAddress = await ( + contractRegistry as GanacheContractAddressRegistry + ).getContractAddress(smartContract); await unlockWallet(driver); await openDapp(driver, contractAddress); @@ -62,10 +77,10 @@ describe('Confirmation Redesign Contract Interaction Component', function () { smartContract, title: this.test?.fullTitle(), }, - async ({ driver, contractRegistry }) => { - const contractAddress = await contractRegistry.getContractAddress( - smartContract, - ); + async ({ driver, contractRegistry }: TestSuiteArguments) => { + const contractAddress = await ( + contractRegistry as GanacheContractAddressRegistry + ).getContractAddress(smartContract); await unlockWallet(driver); await openDapp(driver, contractAddress); @@ -95,10 +110,10 @@ describe('Confirmation Redesign Contract Interaction Component', function () { smartContract, title: this.test?.fullTitle(), }, - async ({ driver, contractRegistry }) => { - const contractAddress = await contractRegistry.getContractAddress( - smartContract, - ); + async ({ driver, contractRegistry }: TestSuiteArguments) => { + const contractAddress = await ( + contractRegistry as GanacheContractAddressRegistry + ).getContractAddress(smartContract); await unlockWallet(driver); await openDapp(driver, contractAddress); @@ -128,10 +143,10 @@ describe('Confirmation Redesign Contract Interaction Component', function () { smartContract, title: this.test?.fullTitle(), }, - async ({ driver, contractRegistry }) => { - const contractAddress = await contractRegistry.getContractAddress( - smartContract, - ); + async ({ driver, contractRegistry }: TestSuiteArguments) => { + const contractAddress = await ( + contractRegistry as GanacheContractAddressRegistry + ).getContractAddress(smartContract); await unlockWallet(driver); await openDapp(driver, contractAddress); @@ -160,10 +175,10 @@ describe('Confirmation Redesign Contract Interaction Component', function () { smartContract, title: this.test?.fullTitle(), }, - async ({ driver, contractRegistry }) => { - const contractAddress = await contractRegistry.getContractAddress( - smartContract, - ); + async ({ driver, contractRegistry }: TestSuiteArguments) => { + const contractAddress = await ( + contractRegistry as GanacheContractAddressRegistry + ).getContractAddress(smartContract); await unlockWallet(driver); await openDapp(driver, contractAddress); @@ -195,10 +210,10 @@ describe('Confirmation Redesign Contract Interaction Component', function () { smartContract, title: this.test?.fullTitle(), }, - async ({ driver, contractRegistry }) => { - const contractAddress = await contractRegistry.getContractAddress( - smartContract, - ); + async ({ driver, contractRegistry }: TestSuiteArguments) => { + const contractAddress = await ( + contractRegistry as GanacheContractAddressRegistry + ).getContractAddress(smartContract); await unlockWallet(driver); await openDapp(driver, contractAddress); @@ -238,10 +253,10 @@ describe('Confirmation Redesign Contract Interaction Component', function () { smartContract, title: this.test?.fullTitle(), }, - async ({ driver, contractRegistry }) => { - const contractAddress = await contractRegistry.getContractAddress( - smartContract, - ); + async ({ driver, contractRegistry }: TestSuiteArguments) => { + const contractAddress = await ( + contractRegistry as GanacheContractAddressRegistry + ).getContractAddress(smartContract); await unlockWallet(driver); await openDapp(driver, contractAddress); @@ -258,147 +273,3 @@ describe('Confirmation Redesign Contract Interaction Component', function () { }); }); }); - -async function createContractDeploymentTransaction(driver) { - await driver.switchToWindowWithTitle(WINDOW_TITLES.TestDApp); - await driver.clickElement(`#deployButton`); -} - -async function confirmContractDeploymentTransaction(driver) { - await driver.waitUntilXWindowHandles(3); - await driver.switchToWindowWithTitle(WINDOW_TITLES.Dialog); - - await driver.waitForSelector({ - css: '.confirm-page-container-summary__action__name', - text: 'Contract deployment', - }); - - await driver.clickElement({ text: 'Confirm', tag: 'button' }); - - await driver.delay(2000); - await driver.waitUntilXWindowHandles(2); - - await driver.switchToWindowWithTitle(WINDOW_TITLES.ExtensionInFullScreenView); - await driver.clickElement({ text: 'Activity', tag: 'button' }); - await driver.waitForSelector( - '.transaction-list__completed-transactions .activity-list-item:nth-of-type(1)', - ); -} - -async function createDepositTransaction(driver) { - await driver.switchToWindowWithTitle(WINDOW_TITLES.TestDApp); - await driver.clickElement(`#depositButton`); -} - -async function confirmDepositTransaction(driver) { - await driver.waitUntilXWindowHandles(3); - - await driver.switchToWindowWithTitle(WINDOW_TITLES.Dialog); - - await driver.waitForSelector({ - css: 'h2', - text: 'Transaction request', - }); - - await driver.switchToWindowWithTitle(WINDOW_TITLES.Dialog); - await toggleAdvancedDetails(driver); - - await driver.waitForSelector({ - css: 'p', - text: 'Nonce', - }); - - await scrollAndConfirmAndAssertConfirm(driver); -} - -async function confirmDepositTransactionWithCustomNonce(driver, customNonce) { - await driver.waitUntilXWindowHandles(3); - await driver.switchToWindowWithTitle(WINDOW_TITLES.Dialog); - - await driver.waitForSelector({ - css: 'h2', - text: 'Transaction request', - }); - - await driver.switchToWindowWithTitle(WINDOW_TITLES.Dialog); - await toggleAdvancedDetails(driver); - - await driver.waitForSelector({ - css: 'p', - text: 'Nonce', - }); - - await driver.clickElement('.edit-nonce-btn'); - await driver.fill('[data-testid="custom-nonce-input"]', customNonce); - await driver.clickElement({ - text: 'Save', - tag: 'button', - }); - await scrollAndConfirmAndAssertConfirm(driver); - - // Confirm tx was submitted with the higher nonce - await driver.switchToWindowWithTitle(WINDOW_TITLES.ExtensionInFullScreenView); - - await driver.delay(500); - - const sendTransactionListItem = await driver.findElement( - '.transaction-list__pending-transactions .activity-list-item', - ); - await sendTransactionListItem.click(); - - await driver.waitForSelector({ - css: '.transaction-breakdown__value', - text: customNonce, - }); -} - -async function toggleOnCustomNonce(driver) { - // switch to metamask page and open the three dots menu - await driver.switchToWindowWithTitle(WINDOW_TITLES.ExtensionInFullScreenView); - - // Open settings menu button - const accountOptionsMenuSelector = - '[data-testid="account-options-menu-button"]'; - await driver.clickElement(accountOptionsMenuSelector); - - // Click settings from dropdown menu - const globalMenuSettingsSelector = '[data-testid="global-menu-settings"]'; - await driver.waitForSelector(globalMenuSettingsSelector); - await driver.clickElement(globalMenuSettingsSelector); - - // Click Advanced tab - const advancedTabRawLocator = { - text: 'Advanced', - tag: 'div', - }; - await driver.clickElement(advancedTabRawLocator); - - // Toggle on custom toggle setting (off by default) - await driver.clickElement('.custom-nonce-toggle'); - - // Close settings - await driver.clickElement( - '.settings-page__header__title-container__close-button', - ); -} - -async function toggleAdvancedDetails(driver) { - // TODO - Scroll button not shown in Firefox if advanced details enabled too fast. - await driver.delay(1000); - - await driver.clickElement(`[data-testid="header-advanced-details-button"]`); -} - -async function assertAdvancedGasDetails(driver) { - await driver.waitForSelector({ css: 'p', text: 'Estimated fee' }); - await driver.waitForSelector({ css: 'p', text: 'Speed' }); - await driver.waitForSelector({ css: 'p', text: 'Max fee' }); -} - -async function assertAdvancedGasDetailsWithL2Breakdown(driver) { - await driver.waitForSelector({ css: 'p', text: 'Estimated fee' }); - await driver.waitForSelector({ css: 'p', text: 'L1 fee' }); - await driver.waitForSelector({ css: 'p', text: 'L2 fee' }); - await driver.waitForSelector({ css: 'p', text: 'Speed' }); - await driver.waitForSelector({ css: 'p', text: 'Max fee' }); -} diff --git a/test/e2e/tests/confirmations/transactions/metrics.spec.ts b/test/e2e/tests/confirmations/transactions/metrics.spec.ts new file mode 100644 index 000000000000..2a5d3c19e7a2 --- /dev/null +++ b/test/e2e/tests/confirmations/transactions/metrics.spec.ts @@ -0,0 +1,212 @@ +/* eslint-disable @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires */ +import { strict as assert } from 'assert'; +import { MockedEndpoint, MockttpServer } from 'mockttp'; +import { + AnonymousTransactionMetaMetricsEvent, + TransactionMetaMetricsEvent, +} from '../../../../../shared/constants/transaction'; +import { Driver } from '../../../webdriver/driver'; +import { + confirmContractDeploymentTransaction, + confirmDepositTransaction, + createContractDeploymentTransaction, + createDepositTransaction, +} from './shared'; + +const { + defaultGanacheOptionsForType2Transactions, + openDapp, + unlockWallet, + WINDOW_TITLES, + withFixtures, + getEventPayloads, +} = require('../../../helpers'); +const FixtureBuilder = require('../../../fixture-builder'); + +describe('Metrics', function () { + if (!process.env.ENABLE_CONFIRMATION_REDESIGN) { + return; + } + + it('Sends a contract interaction type 2 transaction (EIP1559) with the right properties in the metric events', async function () { + await withFixtures( + { + dapp: true, + fixtures: new FixtureBuilder() + .withPermissionControllerConnectedToTestDapp() + .withPreferencesController({ + preferences: { redesignedConfirmationsEnabled: true }, + }) + .withMetaMetricsController({ + metaMetricsId: 'fake-metrics-id', + participateInMetaMetrics: true, + }) + .build(), + ganacheOptions: defaultGanacheOptionsForType2Transactions, + title: this.test?.fullTitle(), + testSpecificMock: mocks, + }, + async ({ + driver, + mockedEndpoint: mockedEndpoints, + }: { + driver: Driver; + mockedEndpoint: MockedEndpoint; + }) => { + await unlockWallet(driver); + + await openDapp(driver); + + await createContractDeploymentTransaction(driver); + await confirmContractDeploymentTransaction(driver); + + await createDepositTransaction(driver); + await driver.waitUntilXWindowHandles(3); + await driver.switchToWindowWithTitle(WINDOW_TITLES.Dialog); + await confirmDepositTransaction(driver); + + const events = await getEventPayloads(driver, mockedEndpoints); + + // deployment tx -- no ui_customizations + assert.equal( + events[0].event, + AnonymousTransactionMetaMetricsEvent.added, + ); + assert.equal(events[0].properties.ui_customizations, null); + assert.equal(events[1].event, TransactionMetaMetricsEvent.added); + assert.equal(events[1].properties.ui_customizations, null); + assert.equal( + events[2].event, + AnonymousTransactionMetaMetricsEvent.submitted, + ); + assert.equal(events[2].properties.ui_customizations, null); + assert.equal(events[3].event, TransactionMetaMetricsEvent.submitted); + assert.equal(events[3].properties.ui_customizations, null); + assert.equal( + events[4].event, + AnonymousTransactionMetaMetricsEvent.approved, + ); + assert.equal(events[4].properties.ui_customizations, null); + assert.equal(events[5].event, TransactionMetaMetricsEvent.approved); + assert.equal(events[5].properties.ui_customizations, null); + assert.equal( + events[6].event, + AnonymousTransactionMetaMetricsEvent.finalized, + ); + assert.equal(events[6].properties.ui_customizations, null); + assert.equal(events[7].event, TransactionMetaMetricsEvent.finalized); + assert.equal(events[7].properties.ui_customizations, null); + + // deposit tx (contract interaction) -- ui_customizations is set + assert.equal( + events[8].event, + AnonymousTransactionMetaMetricsEvent.added, + ); + assert.equal( + events[8].properties.ui_customizations[0], + 'redesigned_confirmation', + ); + assert.equal(events[9].event, TransactionMetaMetricsEvent.added); + assert.equal( + events[9].properties.ui_customizations[0], + 'redesigned_confirmation', + ); + assert.equal( + events[10].event, + AnonymousTransactionMetaMetricsEvent.submitted, + ); + assert.equal( + events[10].properties.ui_customizations[0], + 'redesigned_confirmation', + ); + assert.equal(events[11].event, TransactionMetaMetricsEvent.submitted); + assert.equal( + events[11].properties.ui_customizations[0], + 'redesigned_confirmation', + ); + assert.equal( + events[12].event, + AnonymousTransactionMetaMetricsEvent.approved, + ); + assert.equal( + events[12].properties.ui_customizations[0], + 'redesigned_confirmation', + ); + assert.equal(events[13].event, TransactionMetaMetricsEvent.approved); + assert.equal( + events[13].properties.ui_customizations[0], + 'redesigned_confirmation', + ); + assert.equal( + events[14].event, + AnonymousTransactionMetaMetricsEvent.finalized, + ); + assert.equal( + events[14].properties.ui_customizations[0], + 'redesigned_confirmation', + ); + assert.equal(events[15].event, TransactionMetaMetricsEvent.finalized); + assert.equal( + events[15].properties.ui_customizations[0], + 'redesigned_confirmation', + ); + }, + ); + }); +}); + +async function mockedTrackedEvent(mockServer: MockttpServer, event: string) { + return await mockServer + .forPost('https://api.segment.io/v1/batch') + .withJsonBodyIncluding({ + batch: [{ type: 'track', event }], + }) + .thenCallback(() => ({ statusCode: 200 })); +} + +async function mocks(server: MockttpServer) { + return [ + // deployment tx + await mockedTrackedEvent( + server, + AnonymousTransactionMetaMetricsEvent.added, + ), + await mockedTrackedEvent(server, TransactionMetaMetricsEvent.added), + await mockedTrackedEvent( + server, + AnonymousTransactionMetaMetricsEvent.submitted, + ), + await mockedTrackedEvent(server, TransactionMetaMetricsEvent.submitted), + await mockedTrackedEvent( + server, + AnonymousTransactionMetaMetricsEvent.approved, + ), + await mockedTrackedEvent(server, TransactionMetaMetricsEvent.approved), + await mockedTrackedEvent( + server, + AnonymousTransactionMetaMetricsEvent.finalized, + ), + await mockedTrackedEvent(server, TransactionMetaMetricsEvent.finalized), + // deposit tx + await mockedTrackedEvent( + server, + AnonymousTransactionMetaMetricsEvent.added, + ), + await mockedTrackedEvent(server, TransactionMetaMetricsEvent.added), + await mockedTrackedEvent( + server, + AnonymousTransactionMetaMetricsEvent.submitted, + ), + await mockedTrackedEvent(server, TransactionMetaMetricsEvent.submitted), + await mockedTrackedEvent( + server, + AnonymousTransactionMetaMetricsEvent.approved, + ), + await mockedTrackedEvent(server, TransactionMetaMetricsEvent.approved), + await mockedTrackedEvent( + server, + AnonymousTransactionMetaMetricsEvent.finalized, + ), + await mockedTrackedEvent(server, TransactionMetaMetricsEvent.finalized), + ]; +} diff --git a/test/e2e/tests/confirmations/transactions/shared.ts b/test/e2e/tests/confirmations/transactions/shared.ts new file mode 100644 index 000000000000..ac6cd3c10d46 --- /dev/null +++ b/test/e2e/tests/confirmations/transactions/shared.ts @@ -0,0 +1,187 @@ +/* eslint-disable @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires */ +import GanacheContractAddressRegistry from '../../../seeder/ganache-contract-address-registry'; +import { Driver } from '../../../webdriver/driver'; + +const { WINDOW_TITLES } = require('../../../helpers'); +const { scrollAndConfirmAndAssertConfirm } = require('../helpers'); + +export interface TestSuiteArguments { + driver: Driver; + contractRegistry?: GanacheContractAddressRegistry; +} + +export async function createContractDeploymentTransaction(driver: Driver) { + await driver.switchToWindowWithTitle(WINDOW_TITLES.TestDApp); + await driver.clickElement(`#deployButton`); +} + +export async function confirmContractDeploymentTransaction(driver: Driver) { + await driver.waitUntilXWindowHandles(3); + await driver.switchToWindowWithTitle(WINDOW_TITLES.Dialog); + + await driver.waitForSelector({ + css: '.confirm-page-container-summary__action__name', + text: 'Contract deployment', + }); + + await driver.clickElement({ text: 'Confirm', tag: 'button' }); + + await driver.delay(2000); + await driver.waitUntilXWindowHandles(2); + + await driver.switchToWindowWithTitle(WINDOW_TITLES.ExtensionInFullScreenView); + await driver.clickElement({ text: 'Activity', tag: 'button' }); + await driver.waitForSelector( + '.transaction-list__completed-transactions .activity-list-item:nth-of-type(1)', + ); +} + +export async function createDepositTransaction(driver: Driver) { + await driver.switchToWindowWithTitle(WINDOW_TITLES.TestDApp); + await driver.clickElement(`#depositButton`); +} + +export async function confirmDepositTransaction(driver: Driver) { + await driver.waitUntilXWindowHandles(3); + + await driver.switchToWindowWithTitle(WINDOW_TITLES.Dialog); + + await driver.waitForSelector({ + css: 'h2', + text: 'Transaction request', + }); + + await driver.switchToWindowWithTitle(WINDOW_TITLES.Dialog); + await toggleAdvancedDetails(driver); + + await driver.waitForSelector({ + css: 'p', + text: 'Nonce', + }); + + await scrollAndConfirmAndAssertConfirm(driver); +} + +export async function confirmDepositTransactionWithCustomNonce( + driver: Driver, + customNonce: string, +) { + await driver.waitUntilXWindowHandles(3); + await driver.switchToWindowWithTitle(WINDOW_TITLES.Dialog); + + await driver.waitForSelector({ + css: 'h2', + text: 'Transaction request', + }); + + await driver.switchToWindowWithTitle(WINDOW_TITLES.Dialog); + + await driver.waitForSelector({ + css: 'p', + text: 'Nonce', + }); + + await driver.clickElement('.edit-nonce-btn'); + await driver.fill('[data-testid="custom-nonce-input"]', customNonce); + await driver.clickElement({ + text: 'Save', + tag: 'button', + }); + await scrollAndConfirmAndAssertConfirm(driver); + + // Confirm tx was submitted with the higher nonce + await driver.switchToWindowWithTitle(WINDOW_TITLES.ExtensionInFullScreenView); + + await driver.delay(500); + + const sendTransactionListItem = await driver.findElement( + '.transaction-list__pending-transactions .activity-list-item', + ); + await sendTransactionListItem.click(); + + await driver.waitForSelector({ + css: '.transaction-breakdown__value', + text: customNonce, + }); +} + +export async function toggleOnCustomNonce(driver: Driver) { + // switch to metamask page and open the three dots menu + await driver.switchToWindowWithTitle(WINDOW_TITLES.ExtensionInFullScreenView); + + // Open settings menu button + const accountOptionsMenuSelector = + '[data-testid="account-options-menu-button"]'; + await driver.clickElement(accountOptionsMenuSelector); + + // Click settings from dropdown menu + const globalMenuSettingsSelector = '[data-testid="global-menu-settings"]'; + await driver.waitForSelector(globalMenuSettingsSelector); + await driver.clickElement(globalMenuSettingsSelector); + + // Click Advanced tab + const advancedTabRawLocator = { + text: 'Advanced', + tag: 'div', + }; + await driver.clickElement(advancedTabRawLocator); + + // Toggle on custom toggle setting (off by default) + await driver.clickElement('.custom-nonce-toggle'); + + // Close settings + await driver.clickElement( + '.settings-page__header__title-container__close-button', + ); +} + +export async function toggleOnHexData(driver: Driver) { + // switch to metamask page and open the three dots menu + await driver.switchToWindowWithTitle(WINDOW_TITLES.ExtensionInFullScreenView); + + // Open settings menu button + const accountOptionsMenuSelector = + '[data-testid="account-options-menu-button"]'; + await driver.clickElement(accountOptionsMenuSelector); + + // Click settings from dropdown menu + const globalMenuSettingsSelector = '[data-testid="global-menu-settings"]'; + await driver.waitForSelector(globalMenuSettingsSelector); + await driver.clickElement(globalMenuSettingsSelector); + + // Click Advanced tab + const advancedTabRawLocator = { + text: 'Advanced', + tag: 'div', + }; + await driver.clickElement(advancedTabRawLocator); + + // Toggle on custom toggle setting (off by default) + await driver.clickElement('.hex-data-toggle'); + + // Close settings + await driver.clickElement( + '.settings-page__header__title-container__close-button', + ); +} + +export async function toggleAdvancedDetails(driver: Driver) { + // TODO - Scroll button not shown in Firefox if advanced details enabled too fast. + await driver.delay(1000); + + await driver.clickElement(`[data-testid="header-advanced-details-button"]`); +} + +export async function assertAdvancedGasDetails(driver: Driver) { + await driver.waitForSelector({ css: 'p', text: 'Estimated fee' }); + await driver.waitForSelector({ css: 'p', text: 'Speed' }); + await driver.waitForSelector({ css: 'p', text: 'Max fee' }); +} + +export async function assertAdvancedGasDetailsWithL2Breakdown(driver: Driver) { + await driver.waitForSelector({ css: 'p', text: 'Estimated fee' }); + await driver.waitForSelector({ css: 'p', text: 'L1 fee' }); + await driver.waitForSelector({ css: 'p', text: 'L2 fee' }); + await driver.waitForSelector({ css: 'p', text: 'Speed' }); + await driver.waitForSelector({ css: 'p', text: 'Max fee' }); +}