pull/5038/head
bunsenstraat 4 months ago committed by Aniket
parent 0ebd34a2d1
commit 3bbedd600d
  1. 10
      apps/remix-ide-e2e/src/commands/pinGrid.ts
  2. 36
      apps/remix-ide-e2e/src/tests/grid.test.ts
  3. 2
      apps/remix-ide-e2e/src/tests/terminal.test.ts
  4. 2
      apps/remix-ide-e2e/src/types/index.d.ts

@ -1,14 +1,14 @@
import { NightwatchBrowser } from 'nightwatch'
import EventEmitter from 'events'
class pinChain extends EventEmitter {
command (this: NightwatchBrowser, provider: string): NightwatchBrowser {
class pinGrid extends EventEmitter {
command (this: NightwatchBrowser, provider: string, status: boolean): NightwatchBrowser {
this.api.useCss().waitForElementVisible('[data-id="settingsSelectEnvOptions"]')
.click('[data-id="settingsSelectEnvOptions"] button')
.waitForElementVisible(`[data-id="dropdown-item-another-chain"]`)
.click(`[data-id="dropdown-item-another-chain"]`)
.waitForElementVisible(`[data-id="${provider}-unpinned"]`)
.click(`[data-id="${provider}-unpinned"]`)
.waitForElementVisible(`[data-id="${provider}-${status ? 'unpinned' : 'pinned'}"]`)
.click(`[data-id="${provider}-${status ? 'unpinned' : 'pinned'}"]`)
.perform((done) => {
done()
this.emit('complete')
@ -17,4 +17,4 @@ class pinChain extends EventEmitter {
}
}
module.exports = pinChain
module.exports = pinGrid

@ -0,0 +1,36 @@
'use strict'
import { NightwatchBrowser } from 'nightwatch'
import init from '../helpers/init'
module.exports = {
before: function (browser: NightwatchBrowser, done: VoidFunction) {
init(browser, done, 'http://127.0.0.1:8080?plugins=solidity,udapp', false)
},
'pin chain': function (browser: NightwatchBrowser) {
browser
.clickLaunchIcon('udapp')
.pinGrid('vm-custom-fork', true)
.waitForElementVisible('[data-id="settingsSelectEnvOptions"]')
.click('[data-id="settingsSelectEnvOptions"] button')
.waitForElementVisible(`[data-id="dropdown-item-vm-custom-fork"]`)
.click('[data-id="settingsSelectEnvOptions"] button') // close the dropdown
.pinGrid('vm-sepolia-fork', true)
.waitForElementVisible('[data-id="settingsSelectEnvOptions"]')
.click('[data-id="settingsSelectEnvOptions"] button')
.waitForElementVisible(`[data-id="dropdown-item-vm-sepolia-fork"]`)
.click('[data-id="settingsSelectEnvOptions"] button') // close the dropdown
},
'unpin chain': function (browser: NightwatchBrowser) {
browser
.pinGrid('vm-custom-fork', false)
.waitForElementVisible('[data-id="settingsSelectEnvOptions"]')
.click('[data-id="settingsSelectEnvOptions"] button')
.waitForElementNotPresent(`[data-id="dropdown-item-vm-custom-fork"]`)
.click('[data-id="settingsSelectEnvOptions"] button') // close the dropdown
.pinGrid('vm-sepolia-fork', false)
.waitForElementVisible('[data-id="settingsSelectEnvOptions"]')
.click('[data-id="settingsSelectEnvOptions"] button')
.waitForElementNotPresent(`[data-id="dropdown-item-vm-sepolia-fork"]`)
.click('[data-id="settingsSelectEnvOptions"] button') // close the dropdown
}
}

@ -313,7 +313,7 @@ module.exports = {
'Should connect to the sepolia fork and run web3.eth.getCode in the terminal #group9': function (browser: NightwatchBrowser) {
if (runMasterTests)
browser
.pinChain('vm-custom-fork')
.pinGrid('vm-custom-fork', true)
.switchEnvironment('vm-custom-fork')
.waitForElementVisible('[data-id="vm-custom-fork-modal-footer-ok-react"]')
.execute(() => {

@ -70,7 +70,7 @@ declare module 'nightwatch' {
currentSelectedFileIs(name: string): NightwatchBrowser
switchWorkspace: (workspaceName: string) => NightwatchBrowser
switchEnvironment: (provider: string) => NightwatchBrowser
pinChain: (provider: string) => NightwatchBrowser
pinGrid: (provider: string, status: boolean) => NightwatchBrowser
connectToExternalHttpProvider: (url: string, identifier: string) => NightwatchBrowser
waitForElementNotContainsText: (id: string, value: string, timeout: number = 10000) => NightwatchBrowser
hideToolTips: (this: NightwatchBrowser) => NightwatchBrowser

Loading…
Cancel
Save