fix chrome driver

pull/4673/head
yann300 8 months ago
parent f9958b376d
commit 7e362256f0
  1. 4
      .circleci/config.yml
  2. 2
      apps/remix-ide-e2e/nightwatch.ts
  3. 2
      apps/remix-ide-e2e/package.json
  4. 6
      apps/remix-ide-e2e/src/commands/setupMetamask.ts
  5. 1
      apps/remix-ide-e2e/src/commands/switchBrowserTab.ts

@ -388,7 +388,9 @@ jobs:
- run: yarn install --cwd ./apps/remix-ide-e2e --modules-folder ../../node_modules - 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: 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: 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=firefox
- run: yarn run selenium-install --singleDriverInstall=chrome
- when: - when:
condition: condition:
equal: [ "chrome", << parameters.browser >> ] equal: [ "chrome", << parameters.browser >> ]
@ -448,7 +450,9 @@ jobs:
- run: unzip ./persist/dist.zip - run: unzip ./persist/dist.zip
- run: unzip ./persist/plugin-<< parameters.plugin >>.zip - run: unzip ./persist/plugin-<< parameters.plugin >>.zip
- run: yarn install --cwd ./apps/remix-ide-e2e --modules-folder ../../node_modules - 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=firefox
- run: yarn run selenium-install --singleDriverInstall=chrome
- run: mkdir -p node_modules/selenium-standalone/.selenium/chromedriver/latest-x64/ - 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: cp ~/bin/chromedriver /home/circleci/remix-project/node_modules/selenium-standalone/.selenium/chromedriver/latest-x64/
- run: - run:

@ -37,7 +37,7 @@ module.exports = {
args: [ args: [
'window-size=2560,1440', 'window-size=2560,1440',
'--no-sandbox', '--no-sandbox',
'--headless', '--headless=new',
'--verbose', '--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' '--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'
], ],

@ -12,7 +12,7 @@
"@openzeppelin/wizard": "^0.4.0", "@openzeppelin/wizard": "^0.4.0",
"@remix-project/remixd": "../../dist/libs/remixd", "@remix-project/remixd": "../../dist/libs/remixd",
"deep-equal": "^1.0.1", "deep-equal": "^1.0.1",
"selenium-standalone": "^9.0.3", "selenium-standalone": "^9.5.0",
"tree-kill": "^1.2.2" "tree-kill": "^1.2.2"
}, },
"devDependencies": { "devDependencies": {

@ -17,7 +17,11 @@ class MetaMask extends EventEmitter {
function setupMetaMask (browser: NightwatchBrowser, passphrase: string, password: string, done: VoidFunction) { function setupMetaMask (browser: NightwatchBrowser, passphrase: string, password: string, done: VoidFunction) {
const words = passphrase.split(' ') const words = passphrase.split(' ')
browser browser
.switchBrowserTab(1) .perform((done) => {
browser.switchBrowserWindow('chrome-extension://mmejnnbljapjihcidiglpfkpnojpiamk/home.html', 'MetaMask', (browser) => {
browser.perform(() => done())
})
})
.waitForElementVisible('input[data-testid="onboarding-terms-checkbox"]') .waitForElementVisible('input[data-testid="onboarding-terms-checkbox"]')
.click('input[data-testid="onboarding-terms-checkbox"]') .click('input[data-testid="onboarding-terms-checkbox"]')
.click('button[data-testid="onboarding-import-wallet"]') .click('button[data-testid="onboarding-import-wallet"]')

@ -9,6 +9,7 @@ class SwitchBrowserTab extends EventEmitter {
command (this: NightwatchBrowser, index: number): NightwatchBrowser { command (this: NightwatchBrowser, index: number): NightwatchBrowser {
this.api.perform((browser: NightwatchAPI, done) => { this.api.perform((browser: NightwatchAPI, done) => {
browser.windowHandles((result) => { browser.windowHandles((result) => {
console.log('switching to window', result)
browser.switchWindow(result.value[index]) browser.switchWindow(result.value[index])
done() done()
}) })

Loading…
Cancel
Save