diff --git a/src/constants.ts b/src/constants.ts index 1c7b9c19..c1d0b0dc 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -3,7 +3,7 @@ import { getDappateerPath } from "./helpers/utils"; export const EXAMPLE_WEBSITE = "http://example.org"; -export const RECOMMENDED_METAMASK_VERSION = "v10.29.0"; +export const RECOMMENDED_METAMASK_VERSION = "v10.31.0"; export const DEFAULT_METAMASK_USERDATA = path.join( getDappateerPath(), diff --git a/src/helpers/actions.ts b/src/helpers/actions.ts index 8dabe7b5..e3431399 100644 --- a/src/helpers/actions.ts +++ b/src/helpers/actions.ts @@ -80,7 +80,10 @@ export const clickOnElement = async ( text: string, type?: string ): Promise => { - const element = await getElementByContent(page, text, type); + const element = await Promise.race([ + getElementByContent(page, text, type), + getElementByTestId(page, text), + ]); await element.click(); }; diff --git a/src/setup/setupActions.ts b/src/setup/setupActions.ts index 259d26e5..6318e132 100644 --- a/src/setup/setupActions.ts +++ b/src/setup/setupActions.ts @@ -24,7 +24,16 @@ export async function enableEthSign( metaMaskPage: DappeteerPage ): Promise { await openSettingsScreen(metaMaskPage, "Advanced"); - await clickOnSettingsSwitch(metaMaskPage, "Toggle eth_sign requests"); + await clickOnSettingsSwitch(metaMaskPage, "Eth_sign requests"); + await clickOnElement(metaMaskPage, "eth-sign__checkbox"); + await clickOnButton(metaMaskPage, "Continue"); + await typeOnInputField( + metaMaskPage, + "Enter “I only sign what I understand” to continue", + "I only sign what I understand" + ); + await clickOnButton(metaMaskPage, "Enable"); + await metaMaskPage.waitForTimeout(333); await clickOnLogo(metaMaskPage); } @@ -53,6 +62,8 @@ export async function importAccount( password = "password1234", }: MetaMaskOptions ): Promise { + await waitForOverlay(metaMaskPage); + await clickOnElement(metaMaskPage, "onboarding-terms-checkbox"); await clickOnButton(metaMaskPage, "onboarding-import-wallet"); await clickOnButton(metaMaskPage, "metametrics-i-agree");