From 7e362256f0cd0c29fd8d7dd02357738592712cdf Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 3 Apr 2024 23:21:05 +0200 Subject: [PATCH] fix chrome driver --- .circleci/config.yml | 4 ++++ apps/remix-ide-e2e/nightwatch.ts | 2 +- apps/remix-ide-e2e/package.json | 2 +- apps/remix-ide-e2e/src/commands/setupMetamask.ts | 6 +++++- apps/remix-ide-e2e/src/commands/switchBrowserTab.ts | 1 + 5 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index adc592c1c4..a618a76e3e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -388,7 +388,9 @@ jobs: - run: yarn install --cwd ./apps/remix-ide-e2e --modules-folder ../../node_modules - run: mkdir node_modules/hardhat && wget https://unpkg.com/hardhat/console.sol -O node_modules/hardhat/console.sol - run: ls -la ./dist/apps/remix-ide/assets/js + - run: npm list selenium-standalone - run: yarn run selenium-install --singleDriverInstall=firefox + - run: yarn run selenium-install --singleDriverInstall=chrome - when: condition: equal: [ "chrome", << parameters.browser >> ] @@ -448,7 +450,9 @@ jobs: - run: unzip ./persist/dist.zip - run: unzip ./persist/plugin-<< parameters.plugin >>.zip - run: yarn install --cwd ./apps/remix-ide-e2e --modules-folder ../../node_modules + - run: npm list selenium-standalone - run: yarn run selenium-install --singleDriverInstall=firefox + - run: yarn run selenium-install --singleDriverInstall=chrome - run: mkdir -p node_modules/selenium-standalone/.selenium/chromedriver/latest-x64/ - run: cp ~/bin/chromedriver /home/circleci/remix-project/node_modules/selenium-standalone/.selenium/chromedriver/latest-x64/ - run: diff --git a/apps/remix-ide-e2e/nightwatch.ts b/apps/remix-ide-e2e/nightwatch.ts index 48fb538b09..94700cd832 100644 --- a/apps/remix-ide-e2e/nightwatch.ts +++ b/apps/remix-ide-e2e/nightwatch.ts @@ -37,7 +37,7 @@ module.exports = { args: [ 'window-size=2560,1440', '--no-sandbox', - '--headless', + '--headless=new', '--verbose', '--user-agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36' ], diff --git a/apps/remix-ide-e2e/package.json b/apps/remix-ide-e2e/package.json index 4153017b27..fe88c90162 100644 --- a/apps/remix-ide-e2e/package.json +++ b/apps/remix-ide-e2e/package.json @@ -12,7 +12,7 @@ "@openzeppelin/wizard": "^0.4.0", "@remix-project/remixd": "../../dist/libs/remixd", "deep-equal": "^1.0.1", - "selenium-standalone": "^9.0.3", + "selenium-standalone": "^9.5.0", "tree-kill": "^1.2.2" }, "devDependencies": { diff --git a/apps/remix-ide-e2e/src/commands/setupMetamask.ts b/apps/remix-ide-e2e/src/commands/setupMetamask.ts index 7c18b35f9f..59a01751dd 100644 --- a/apps/remix-ide-e2e/src/commands/setupMetamask.ts +++ b/apps/remix-ide-e2e/src/commands/setupMetamask.ts @@ -17,7 +17,11 @@ class MetaMask extends EventEmitter { function setupMetaMask (browser: NightwatchBrowser, passphrase: string, password: string, done: VoidFunction) { const words = passphrase.split(' ') browser - .switchBrowserTab(1) + .perform((done) => { + browser.switchBrowserWindow('chrome-extension://mmejnnbljapjihcidiglpfkpnojpiamk/home.html', 'MetaMask', (browser) => { + browser.perform(() => done()) + }) + }) .waitForElementVisible('input[data-testid="onboarding-terms-checkbox"]') .click('input[data-testid="onboarding-terms-checkbox"]') .click('button[data-testid="onboarding-import-wallet"]') diff --git a/apps/remix-ide-e2e/src/commands/switchBrowserTab.ts b/apps/remix-ide-e2e/src/commands/switchBrowserTab.ts index c37abe39a7..76db38f0aa 100644 --- a/apps/remix-ide-e2e/src/commands/switchBrowserTab.ts +++ b/apps/remix-ide-e2e/src/commands/switchBrowserTab.ts @@ -9,6 +9,7 @@ class SwitchBrowserTab extends EventEmitter { command (this: NightwatchBrowser, index: number): NightwatchBrowser { this.api.perform((browser: NightwatchAPI, done) => { browser.windowHandles((result) => { + console.log('switching to window', result) browser.switchWindow(result.value[index]) done() })