Merge branch 'master' into filedecoratorplugin

pull/2668/head
Aniket 3 years ago committed by GitHub
commit ca3708a2d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      .circleci/config.yml
  2. 4
      apps/remix-ide-e2e/src/commands/executeScriptInTerminal.ts
  3. 3
      apps/remix-ide-e2e/src/commands/getEditorValue.ts
  4. 4
      apps/remix-ide-e2e/src/commands/journalChildIncludes.ts
  5. 11
      apps/remix-ide-e2e/src/commands/openFile.ts
  6. 8
      apps/remix-ide-e2e/src/commands/rightClickCustom.ts
  7. 4
      apps/remix-ide-e2e/src/commands/switchWorkspace.ts
  8. 11
      apps/remix-ide-e2e/src/commands/testFunction.ts
  9. 2
      apps/remix-ide-e2e/src/commands/validateValueInput.ts
  10. 2
      apps/remix-ide-e2e/src/helpers/init.ts
  11. 7
      apps/remix-ide-e2e/src/select_tests.sh
  12. 8
      apps/remix-ide-e2e/src/tests/compiler_api.test.ts
  13. 4
      apps/remix-ide-e2e/src/tests/debugger.test.ts
  14. 2
      apps/remix-ide-e2e/src/tests/defaultLayout.test.ts
  15. 6
      apps/remix-ide-e2e/src/tests/editor.test.ts
  16. 23
      apps/remix-ide-e2e/src/tests/fileExplorer.test.ts
  17. 24
      apps/remix-ide-e2e/src/tests/fileManager_api.test.ts
  18. 4
      apps/remix-ide-e2e/src/tests/gist.test.ts
  19. 4
      apps/remix-ide-e2e/src/tests/importFromGithub.test.ts
  20. 8
      apps/remix-ide-e2e/src/tests/plugin_api.ts
  21. 4
      apps/remix-ide-e2e/src/tests/remixd.test.ts
  22. 20
      apps/remix-ide-e2e/src/tests/runAndDeploy.test.ts
  23. 4
      apps/remix-ide-e2e/src/tests/search.test.ts
  24. 12
      apps/remix-ide-e2e/src/tests/solidityUnittests.test.ts
  25. 26
      apps/remix-ide-e2e/src/tests/specialFunctions.test.ts
  26. 4
      apps/remix-ide-e2e/src/tests/staticAnalysis.test.ts
  27. 22
      apps/remix-ide-e2e/src/tests/terminal.test.ts
  28. 4
      apps/remix-ide-e2e/src/tests/transactionExecution.test.ts
  29. 6
      apps/remix-ide-e2e/src/tests/txListener.test.ts
  30. 2
      apps/remix-ide-e2e/src/tests/url.test.ts
  31. 4
      apps/remix-ide-e2e/src/tests/verticalIconsPanel.test.ts
  32. 309
      apps/remix-ide-e2e/src/tests/workspace.test.ts
  33. 4
      apps/remix-ide-e2e/src/types/index.d.ts
  34. 3
      apps/remix-ide/ci/browser_test.sh
  35. 6
      package.json
  36. 903
      yarn.lock

@ -8,7 +8,7 @@ parameters:
type: boolean type: boolean
default: false default: false
orbs: orbs:
browser-tools: circleci/browser-tools@1.2.3 browser-tools: circleci/browser-tools@1.3.0
jobs: jobs:
build: build:
docker: docker:

@ -1,7 +1,7 @@
import { NightwatchBrowser } from 'nightwatch' import { NightwatchBrowser } from 'nightwatch'
import EventEmitter from 'events' import EventEmitter from 'events'
class ExecuteScript extends EventEmitter { class ExecuteScriptInTerminal extends EventEmitter {
command (this: NightwatchBrowser, script: string): NightwatchBrowser { command (this: NightwatchBrowser, script: string): NightwatchBrowser {
this.api this.api
.clearEditableContent('*[data-id="terminalCliInput"]') .clearEditableContent('*[data-id="terminalCliInput"]')
@ -17,4 +17,4 @@ class ExecuteScript extends EventEmitter {
} }
} }
module.exports = ExecuteScript module.exports = ExecuteScriptInTerminal

@ -9,11 +9,10 @@ class GetEditorValue extends EventEmitter {
return elem.currentContent() return elem.currentContent()
}, [], (result) => { }, [], (result) => {
done()
const value = typeof result.value === 'string' ? result.value : null const value = typeof result.value === 'string' ? result.value : null
callback(value) callback(value)
this.emit('complete') this.emit('complete')
done()
}) })
}) })
return this return this

@ -1,4 +1,4 @@
import { NightwatchBrowser } from 'nightwatch' import { ELEMENT_KEY, NightwatchBrowser } from 'nightwatch'
import EventEmitter from 'events' import EventEmitter from 'events'
/* /*
@ -11,7 +11,7 @@ class JournalChildIncludes extends EventEmitter {
let occurence = 0 let occurence = 0
this.api.elements('css selector', '*[data-id="terminalJournal"]', (res) => { this.api.elements('css selector', '*[data-id="terminalJournal"]', (res) => {
Array.isArray(res.value) && res.value.forEach(function (jsonWebElement) { Array.isArray(res.value) && res.value.forEach(function (jsonWebElement) {
const jsonWebElementId = jsonWebElement.ELEMENT || jsonWebElement[Object.keys(jsonWebElement)[0]] const jsonWebElementId = jsonWebElement[ELEMENT_KEY] || jsonWebElement[Object.keys(jsonWebElement)[0]]
browser.elementIdText(jsonWebElementId, (jsonElement) => { browser.elementIdText(jsonWebElementId, (jsonElement) => {
const text = jsonElement.value const text = jsonElement.value

@ -22,9 +22,16 @@ function openFile (browser: NightwatchBrowser, name: string, done: VoidFunction)
browser.element('css selector', '[data-id="verticalIconsKindfilePanel"] img[data-id="selected"]', (result) => { browser.element('css selector', '[data-id="verticalIconsKindfilePanel"] img[data-id="selected"]', (result) => {
if (result.status === 0) { if (result.status === 0) {
done() done()
} else browser.clickLaunchIcon('filePanel').perform(done) } else browser.clickLaunchIcon('filePanel').perform(() => {
done()
})
}) })
} else browser.clickLaunchIcon('filePanel').perform(done) } else {
browser.clickLaunchIcon('filePanel').perform(() => {
done()
})
}
}) })
}) })
.waitForElementVisible('li[data-id="treeViewLitreeViewItem' + name + '"', 60000) .waitForElementVisible('li[data-id="treeViewLitreeViewItem' + name + '"', 60000)

@ -1,10 +1,10 @@
import EventEmitter from 'events' import EventEmitter from 'events'
import { NightwatchBrowser } from 'nightwatch' import { NightwatchBrowser } from 'nightwatch'
class RightClick extends EventEmitter { class RightClickCustom extends EventEmitter {
command (this: NightwatchBrowser, cssSelector: string) { command (this: NightwatchBrowser, cssSelector: string) {
this.api.perform((done) => { this.api.perform((done) => {
rightClick(this.api, cssSelector, () => { rightClickCustom(this.api, cssSelector, () => {
done() done()
this.emit('complete') this.emit('complete')
}) })
@ -13,7 +13,7 @@ class RightClick extends EventEmitter {
} }
} }
function rightClick (browser: NightwatchBrowser, cssSelector: string, callback: VoidFunction) { function rightClickCustom (browser: NightwatchBrowser, cssSelector: string, callback: VoidFunction) {
browser.execute(function (cssSelector: string) { browser.execute(function (cssSelector: string) {
const element: any = document.querySelector(cssSelector) const element: any = document.querySelector(cssSelector)
const evt = element.ownerDocument.createEvent('MouseEvents') const evt = element.ownerDocument.createEvent('MouseEvents')
@ -34,4 +34,4 @@ function rightClick (browser: NightwatchBrowser, cssSelector: string, callback:
}) })
} }
module.exports = RightClick module.exports = RightClickCustom

@ -6,7 +6,9 @@ class switchWorkspace extends EventEmitter {
this.api.waitForElementVisible('[data-id="workspacesSelect"]') this.api.waitForElementVisible('[data-id="workspacesSelect"]')
.click('[data-id="workspacesSelect"]') .click('[data-id="workspacesSelect"]')
.waitForElementVisible(`[data-id="dropdown-item-${workspaceName}"]`) .waitForElementVisible(`[data-id="dropdown-item-${workspaceName}"]`)
.pause(2000)
.click(`[data-id="dropdown-item-${workspaceName}"]`) .click(`[data-id="dropdown-item-${workspaceName}"]`)
.pause(3000)
.perform((done) => { .perform((done) => {
done() done()
this.emit('complete') this.emit('complete')
@ -15,4 +17,4 @@ class switchWorkspace extends EventEmitter {
} }
} }
module.exports = switchWorkspace module.exports = switchWorkspace

@ -1,4 +1,4 @@
import { NightwatchBrowser, NightwatchTestFunctionExpectedInput } from 'nightwatch' import { ELEMENT_KEY, NightwatchBrowser, NightwatchTestFunctionExpectedInput } from 'nightwatch'
import EventEmitter from 'events' import EventEmitter from 'events'
const deepequal = require('deep-equal') const deepequal = require('deep-equal')
@ -22,14 +22,17 @@ class TestFunction extends EventEmitter {
}) })
}) })
.perform((done) => { .perform((done) => {
browser.waitForElementVisible(`[data-id="block_tx${txHash}"]`, 60000) browser
.waitForElementVisible(`[data-id="block_tx${txHash}"]`, 60000)
.moveToElement(`[data-id="block_tx${txHash}"]`, 0, 0)
.pause(2000)
.click(`[data-id="block_tx${txHash}"]`) .click(`[data-id="block_tx${txHash}"]`)
.pause(3000) .pause(3000)
.waitForElementVisible(`*[data-id="txLoggerTable${txHash}"]`, 60000) .waitForElementVisible(`*[data-id="txLoggerTable${txHash}"]`, 60000)
// fetch and format transaction logs as key => pair object // fetch and format transaction logs as key => pair object
.elements('css selector', `*[data-shared="key_${txHash}"]`, (res) => { .elements('css selector', `*[data-shared="key_${txHash}"]`, (res) => {
Array.isArray(res.value) && res.value.forEach(function (jsonWebElement) { Array.isArray(res.value) && res.value.forEach(function (jsonWebElement) {
const jsonWebElementId: string = jsonWebElement.ELEMENT || jsonWebElement[Object.keys(jsonWebElement)[0]] const jsonWebElementId: string = jsonWebElement[ELEMENT_KEY] || jsonWebElement[Object.keys(jsonWebElement)[0]]
browser.elementIdText(jsonWebElementId, (jsonElement) => { browser.elementIdText(jsonWebElementId, (jsonElement) => {
const key = typeof jsonElement.value === 'string' ? jsonElement.value.trim() : null const key = typeof jsonElement.value === 'string' ? jsonElement.value.trim() : null
@ -40,7 +43,7 @@ class TestFunction extends EventEmitter {
}) })
.elements('css selector', `*[data-shared="pair_${txHash}"]`, (res) => { .elements('css selector', `*[data-shared="pair_${txHash}"]`, (res) => {
Array.isArray(res.value) && res.value.forEach(function (jsonWebElement, index) { Array.isArray(res.value) && res.value.forEach(function (jsonWebElement, index) {
const jsonWebElementId = jsonWebElement.ELEMENT || jsonWebElement[Object.keys(jsonWebElement)[0]] const jsonWebElementId = jsonWebElement[ELEMENT_KEY] || jsonWebElement[Object.keys(jsonWebElement)[0]]
browser.elementIdText(jsonWebElementId, (jsonElement) => { browser.elementIdText(jsonWebElementId, (jsonElement) => {
let value = jsonElement.value let value = jsonElement.value

@ -7,7 +7,7 @@ class ValidateValueInput extends EventEmitter {
browser.perform((done) => { browser.perform((done) => {
browser.clearValue(selector) browser.clearValue(selector)
.pause(2000) .pause(2000)
.setValue(selector, valueTosSet) .setValue(selector, valueTosSet).pause(2000)
.execute(function (selector) { .execute(function (selector) {
const elem = document.querySelector(selector) as HTMLInputElement const elem = document.querySelector(selector) as HTMLInputElement
return elem.value return elem.value

@ -22,7 +22,7 @@ export default function (browser: NightwatchBrowser, callback: VoidFunction, url
}, [loadPlugin]) }, [loadPlugin])
.refresh() .refresh()
.pause(6000) .pause(6000)
.perform(done) .perform(done())
}) })
.maximizeWindow() .maximizeWindow()
.fullscreenWindow(() => { .fullscreenWindow(() => {

@ -3,7 +3,7 @@
# Bash Menu Script Example # Bash Menu Script Example
PS3='Select a browser: ' PS3='Select a browser: '
BROWSERS=( "chrome" "firefox" "exit" ) BROWSERS=( "chrome" "chrome headless" "firefox" "exit" )
select opt in "${BROWSERS[@]}" select opt in "${BROWSERS[@]}"
do do
case $opt in case $opt in
@ -12,6 +12,11 @@ do
BROWSER="chromeDesktop" BROWSER="chromeDesktop"
break break
;; ;;
"chrome headless")
echo "Chrome headless selected"
BROWSER="chrome"
break
;;
"firefox") "firefox")
echo "Firefox selected" echo "Firefox selected"
BROWSER="firefoxDesktop" BROWSER="firefoxDesktop"

@ -21,7 +21,7 @@ module.exports = {
'Should compile using "compileWithParamaters" API #group1': function (browser: NightwatchBrowser) { 'Should compile using "compileWithParamaters" API #group1': function (browser: NightwatchBrowser) {
browser browser
.addFile('test_jsCompile.js', { content: jsCompile }) .addFile('test_jsCompile.js', { content: jsCompile })
.executeScript('remix.exeCurrent()') .executeScriptInTerminal('remix.exeCurrent()')
.waitForElementContainsText('*[data-id="terminalJournal"]', '"languageversion":"0.6.8+commit.0bbfe453"', 60000) .waitForElementContainsText('*[data-id="terminalJournal"]', '"languageversion":"0.6.8+commit.0bbfe453"', 60000)
.click('*[data-id="terminalClearConsole"]') .click('*[data-id="terminalClearConsole"]')
}, },
@ -29,7 +29,7 @@ module.exports = {
'Should compile using "compileWithParamaters" API with optimization On #group2': function (browser: NightwatchBrowser) { 'Should compile using "compileWithParamaters" API with optimization On #group2': function (browser: NightwatchBrowser) {
browser browser
.addFile('test_jsCompileWithOptimization.js', { content: jsCompileWithOptimization }) .addFile('test_jsCompileWithOptimization.js', { content: jsCompileWithOptimization })
.executeScript('remix.exeCurrent()') .executeScriptInTerminal('remix.exeCurrent()')
.waitForElementContainsText('*[data-id="terminalJournal"]', '\\"optimizer\\":{\\"enabled\\":true,\\"runs\\":300}', 60000) .waitForElementContainsText('*[data-id="terminalJournal"]', '\\"optimizer\\":{\\"enabled\\":true,\\"runs\\":300}', 60000)
.click('*[data-id="terminalClearConsole"]') .click('*[data-id="terminalClearConsole"]')
}, },
@ -37,7 +37,7 @@ module.exports = {
'Should compile using "compileWithParamaters" API with optimization off check default runs #group3': function (browser: NightwatchBrowser) { 'Should compile using "compileWithParamaters" API with optimization off check default runs #group3': function (browser: NightwatchBrowser) {
browser browser
.addFile('test_jsCompileWithOptimizationDefault.js', { content: jsCompileWithOptimizationDefault }) .addFile('test_jsCompileWithOptimizationDefault.js', { content: jsCompileWithOptimizationDefault })
.executeScript('remix.exeCurrent()') .executeScriptInTerminal('remix.exeCurrent()')
.waitForElementContainsText('*[data-id="terminalJournal"]', '\\"optimizer\\":{\\"enabled\\":false,\\"runs\\":200}', 60000) .waitForElementContainsText('*[data-id="terminalJournal"]', '\\"optimizer\\":{\\"enabled\\":false,\\"runs\\":200}', 60000)
.click('*[data-id="terminalClearConsole"]') .click('*[data-id="terminalClearConsole"]')
}, },
@ -45,7 +45,7 @@ module.exports = {
'Should update the compiler configuration with "setCompilerConfig" API #group4': function (browser: NightwatchBrowser) { 'Should update the compiler configuration with "setCompilerConfig" API #group4': function (browser: NightwatchBrowser) {
browser browser
.addFile('test_updateConfiguration.js', { content: updateConfiguration }) .addFile('test_updateConfiguration.js', { content: updateConfiguration })
.executeScript('remix.exeCurrent()') .executeScriptInTerminal('remix.exeCurrent()')
.pause(15000) .pause(15000)
.addFile('test_updateConfiguration.sol', { content: simpleContract }) .addFile('test_updateConfiguration.sol', { content: simpleContract })
.verifyContracts(['StorageTestUpdateConfiguration'], { wait: 5000, version: '0.6.8+commit.0bbfe453' }) .verifyContracts(['StorageTestUpdateConfiguration'], { wait: 5000, version: '0.6.8+commit.0bbfe453' })

@ -192,7 +192,7 @@ module.exports = {
'Should call the debugger api: getTrace #group4': function (browser: NightwatchBrowser) { 'Should call the debugger api: getTrace #group4': function (browser: NightwatchBrowser) {
browser browser
.addFile('test_jsGetTrace.js', { content: jsGetTrace }) .addFile('test_jsGetTrace.js', { content: jsGetTrace })
.executeScript('remix.exeCurrent()') .executeScriptInTerminal('remix.exeCurrent()')
.pause(3000) .pause(3000)
.waitForElementContainsText('*[data-id="terminalJournal"]', '{"gas":"0x575f","return":"0x0000000000000000000000000000000000000000000000000000000000000000","structLogs":', 60000) .waitForElementContainsText('*[data-id="terminalJournal"]', '{"gas":"0x575f","return":"0x0000000000000000000000000000000000000000000000000000000000000000","structLogs":', 60000)
}, },
@ -200,7 +200,7 @@ module.exports = {
'Should call the debugger api: debug #group4': function (browser: NightwatchBrowser) { 'Should call the debugger api: debug #group4': function (browser: NightwatchBrowser) {
browser browser
.addFile('test_jsDebug.js', { content: jsDebug }) .addFile('test_jsDebug.js', { content: jsDebug })
.executeScript('remix.exeCurrent()') .executeScriptInTerminal('remix.exeCurrent()')
.pause(3000) .pause(3000)
.clickLaunchIcon('debugger') .clickLaunchIcon('debugger')
.waitForElementVisible('*[data-id="slider"]') .waitForElementVisible('*[data-id="slider"]')

@ -42,7 +42,7 @@ module.exports = {
browser.waitForElementVisible('div[data-id="remixIdeSidePanel"]') browser.waitForElementVisible('div[data-id="remixIdeSidePanel"]')
.assert.containsText('h6[data-id="sidePanelSwapitTitle"]', 'FILE EXPLORER') .assert.containsText('h6[data-id="sidePanelSwapitTitle"]', 'FILE EXPLORER')
.clickLaunchIcon('filePanel') .clickLaunchIcon('filePanel')
.assert.hidden('div[data-id="remixIdeSidePanel"]') .assert.not.visible('div[data-id="remixIdeSidePanel"]')
.clickLaunchIcon('filePanel') .clickLaunchIcon('filePanel')
.assert.visible('div[data-id="remixIdeSidePanel"]') .assert.visible('div[data-id="remixIdeSidePanel"]')
.assert.containsText('h6[data-id="sidePanelSwapitTitle"]', 'FILE EXPLORER') .assert.containsText('h6[data-id="sidePanelSwapitTitle"]', 'FILE EXPLORER')

@ -89,7 +89,7 @@ module.exports = {
.addFile('sourcehighlight.js', sourcehighlightScript) .addFile('sourcehighlight.js', sourcehighlightScript)
.addFile('removeAllSourcehighlightScript.js', removeAllSourcehighlightScript) .addFile('removeAllSourcehighlightScript.js', removeAllSourcehighlightScript)
.openFile('sourcehighlight.js') .openFile('sourcehighlight.js')
.executeScript('remix.exeCurrent()') .executeScriptInTerminal('remix.exeCurrent()')
.scrollToLine(32) .scrollToLine(32)
.waitForElementPresent('.highlightLine33', 60000) .waitForElementPresent('.highlightLine33', 60000)
.checkElementStyle('.highlightLine33', 'background-color', 'rgb(52, 152, 219)') .checkElementStyle('.highlightLine33', 'background-color', 'rgb(52, 152, 219)')
@ -105,7 +105,7 @@ module.exports = {
browser.waitForElementVisible('li[data-id="treeViewLitreeViewItemremoveSourcehighlightScript.js"]') browser.waitForElementVisible('li[data-id="treeViewLitreeViewItemremoveSourcehighlightScript.js"]')
.click('li[data-id="treeViewLitreeViewItemremoveSourcehighlightScript.js"]') .click('li[data-id="treeViewLitreeViewItemremoveSourcehighlightScript.js"]')
.pause(2000) .pause(2000)
.executeScript('remix.exeCurrent()') .executeScriptInTerminal('remix.exeCurrent()')
.waitForElementVisible('li[data-id="treeViewLitreeViewItemcontracts"]') .waitForElementVisible('li[data-id="treeViewLitreeViewItemcontracts"]')
.click('li[data-id="treeViewLitreeViewItemcontracts"]') .click('li[data-id="treeViewLitreeViewItemcontracts"]')
.waitForElementVisible('li[data-id="treeViewLitreeViewItemcontracts/3_Ballot.sol"]') .waitForElementVisible('li[data-id="treeViewLitreeViewItemcontracts/3_Ballot.sol"]')
@ -119,7 +119,7 @@ module.exports = {
browser.waitForElementVisible('li[data-id="treeViewLitreeViewItemremoveAllSourcehighlightScript.js"]') browser.waitForElementVisible('li[data-id="treeViewLitreeViewItemremoveAllSourcehighlightScript.js"]')
.click('li[data-id="treeViewLitreeViewItemremoveAllSourcehighlightScript.js"]') .click('li[data-id="treeViewLitreeViewItemremoveAllSourcehighlightScript.js"]')
.pause(2000) .pause(2000)
.executeScript('remix.exeCurrent()') .executeScriptInTerminal('remix.exeCurrent()')
.waitForElementVisible('li[data-id="treeViewLitreeViewItemcontracts/3_Ballot.sol"]') .waitForElementVisible('li[data-id="treeViewLitreeViewItemcontracts/3_Ballot.sol"]')
.click('li[data-id="treeViewLitreeViewItemcontracts/3_Ballot.sol"]') .click('li[data-id="treeViewLitreeViewItemcontracts/3_Ballot.sol"]')
.pause(2000) .pause(2000)

@ -10,12 +10,12 @@ const testData = {
} }
module.exports = { module.exports = {
'@disabled': true,
before: function (browser: NightwatchBrowser, done: VoidFunction) { before: function (browser: NightwatchBrowser, done: VoidFunction) {
init(browser, done) init(browser, done)
}, },
'Should create a new file `5_New_contract.sol` in file explorer': function (browser: NightwatchBrowser) { 'Should create a new file `5_New_contract.sol` in file explorer #group1': function (browser: NightwatchBrowser) {
browser.waitForElementVisible('div[data-id="remixIdeSidePanel"]') browser.waitForElementVisible('div[data-id="remixIdeSidePanel"]')
.clickLaunchIcon('filePanel') .clickLaunchIcon('filePanel')
.assert.containsText('h6[data-id="sidePanelSwapitTitle"]', 'FILE EXPLORER') .assert.containsText('h6[data-id="sidePanelSwapitTitle"]', 'FILE EXPLORER')
@ -28,7 +28,7 @@ module.exports = {
.waitForElementVisible('*[data-id="treeViewLitreeViewItem5_New_contract.sol"]', 7000) .waitForElementVisible('*[data-id="treeViewLitreeViewItem5_New_contract.sol"]', 7000)
}, },
'Should rename `5_New_contract.sol` to 5_Renamed_Contract.sol': function (browser: NightwatchBrowser) { 'Should rename `5_New_contract.sol` to 5_Renamed_Contract.sol #group1': function (browser: NightwatchBrowser) {
browser browser
.waitForElementVisible('*[data-id="treeViewLitreeViewItem5_New_contract.sol"]') .waitForElementVisible('*[data-id="treeViewLitreeViewItem5_New_contract.sol"]')
.click('*[data-id="treeViewLitreeViewItem5_New_contract.sol"]') .click('*[data-id="treeViewLitreeViewItem5_New_contract.sol"]')
@ -36,14 +36,14 @@ module.exports = {
.waitForElementVisible('*[data-id="treeViewLitreeViewItem5_Renamed_Contract.sol"]') .waitForElementVisible('*[data-id="treeViewLitreeViewItem5_Renamed_Contract.sol"]')
}, },
'Should delete file `5_Renamed_Contract.sol` from file explorer': function (browser: NightwatchBrowser) { 'Should delete file `5_Renamed_Contract.sol` from file explorer #group1': function (browser: NightwatchBrowser) {
browser browser
.waitForElementVisible('*[data-id="treeViewLitreeViewItem5_Renamed_Contract.sol"]') .waitForElementVisible('*[data-id="treeViewLitreeViewItem5_Renamed_Contract.sol"]')
.removeFile('5_Renamed_Contract.sol', 'default_workspace') .removeFile('5_Renamed_Contract.sol', 'default_workspace')
.waitForElementNotPresent('*[data-id="treeViewLitreeViewItem5_Renamed_Contract.sol"') .waitForElementNotPresent('*[data-id="treeViewLitreeViewItem5_Renamed_Contract.sol"')
}, },
'Should create a new folder': function (browser: NightwatchBrowser) { 'Should create a new folder #group1': function (browser: NightwatchBrowser) {
browser browser
.waitForElementVisible('*[data-id="treeViewLitreeViewItemREADME.txt"]') .waitForElementVisible('*[data-id="treeViewLitreeViewItemREADME.txt"]')
.click('li[data-id="treeViewLitreeViewItemREADME.txt"]') // focus on root directory .click('li[data-id="treeViewLitreeViewItemREADME.txt"]') // focus on root directory
@ -55,7 +55,7 @@ module.exports = {
.waitForElementVisible('*[data-id="treeViewLitreeViewItemBrowser_Tests"]') .waitForElementVisible('*[data-id="treeViewLitreeViewItemBrowser_Tests"]')
}, },
'Should rename Browser_Tests folder to Browser_E2E_Tests': function (browser: NightwatchBrowser) { 'Should rename Browser_Tests folder to Browser_E2E_Tests #group1': function (browser: NightwatchBrowser) {
browser browser
.waitForElementVisible('*[data-id="treeViewLitreeViewItemBrowser_Tests"]') .waitForElementVisible('*[data-id="treeViewLitreeViewItemBrowser_Tests"]')
.click('*[data-id="treeViewLitreeViewItemBrowser_Tests"]') .click('*[data-id="treeViewLitreeViewItemBrowser_Tests"]')
@ -63,10 +63,10 @@ module.exports = {
.waitForElementVisible('*[data-id="treeViewLitreeViewItemBrowser_E2E_Tests"]') .waitForElementVisible('*[data-id="treeViewLitreeViewItemBrowser_E2E_Tests"]')
}, },
'Should delete Browser_E2E_Tests folder': function (browser: NightwatchBrowser) { 'Should delete Browser_E2E_Tests folder #group1': function (browser: NightwatchBrowser) {
browser browser
.waitForElementVisible('*[data-id="treeViewLitreeViewItemBrowser_E2E_Tests"]') .waitForElementVisible('*[data-id="treeViewLitreeViewItemBrowser_E2E_Tests"]')
.rightClick('[data-path="Browser_E2E_Tests"]') .rightClickCustom('[data-path="Browser_E2E_Tests"]')
.click('*[id="menuitemdelete"]') .click('*[id="menuitemdelete"]')
.waitForElementVisible('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok', 60000) .waitForElementVisible('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok', 60000)
.pause(2000) .pause(2000)
@ -99,9 +99,12 @@ module.exports = {
}) })
}, },
'Should open local filesystem explorer': function (browser: NightwatchBrowser) { 'Should open local filesystem explorer #group2': !function (browser: NightwatchBrowser) {
browser.waitForElementVisible('*[data-id="filePanelFileExplorerTree"]') browser.waitForElementVisible('div[data-id="remixIdeSidePanel"]')
.clickLaunchIcon('filePanel')
.waitForElementVisible('*[data-id="filePanelFileExplorerTree"]')
.click('[data-id="remixUIWorkspaceExplorer"]') .click('[data-id="remixUIWorkspaceExplorer"]')
.waitForElementPresent('*[data-id="fileExplorerFileUpload"]')
.setValue('*[data-id="fileExplorerFileUpload"]', testData.testFile1) .setValue('*[data-id="fileExplorerFileUpload"]', testData.testFile1)
.setValue('*[data-id="fileExplorerFileUpload"]', testData.testFile2) .setValue('*[data-id="fileExplorerFileUpload"]', testData.testFile2)
.setValue('*[data-id="fileExplorerFileUpload"]', testData.testFile3) .setValue('*[data-id="fileExplorerFileUpload"]', testData.testFile3)

@ -11,7 +11,7 @@ module.exports = {
'Should execute `file` api from file manager external api #group1': function (browser: NightwatchBrowser) { 'Should execute `file` api from file manager external api #group1': function (browser: NightwatchBrowser) {
browser browser
.addFile('file.js', { content: executeFile }) .addFile('file.js', { content: executeFile })
.executeScript('remix.exeCurrent()') .executeScriptInTerminal('remix.exeCurrent()')
.pause(1000) .pause(1000)
.waitForElementContainsText('*[data-id="terminalJournal"]', 'file.js', 60000) .waitForElementContainsText('*[data-id="terminalJournal"]', 'file.js', 60000)
}, },
@ -19,7 +19,7 @@ module.exports = {
'Should execute `exists` api from file manager external api #group1': function (browser: NightwatchBrowser) { 'Should execute `exists` api from file manager external api #group1': function (browser: NightwatchBrowser) {
browser browser
.addFile('exists.js', { content: executeExists }) .addFile('exists.js', { content: executeExists })
.executeScript('remix.exeCurrent()') .executeScriptInTerminal('remix.exeCurrent()')
.waitForElementContainsText('*[data-id="terminalJournal"]', 'exists.js true', 60000) .waitForElementContainsText('*[data-id="terminalJournal"]', 'exists.js true', 60000)
.waitForElementContainsText('*[data-id="terminalJournal"]', 'non-exists.js false', 60000) .waitForElementContainsText('*[data-id="terminalJournal"]', 'non-exists.js false', 60000)
}, },
@ -27,14 +27,14 @@ module.exports = {
'Should execute `open` api from file manager external api #group1': function (browser: NightwatchBrowser) { 'Should execute `open` api from file manager external api #group1': function (browser: NightwatchBrowser) {
browser browser
.addFile('open.js', { content: executeOpen }) .addFile('open.js', { content: executeOpen })
.executeScript('remix.exeCurrent()') .executeScriptInTerminal('remix.exeCurrent()')
.waitForElementContainsText('*[data-id="terminalJournal"]', 'contracts/3_Ballot.sol', 60000) .waitForElementContainsText('*[data-id="terminalJournal"]', 'contracts/3_Ballot.sol', 60000)
}, },
'Should execute `writeFile` api from file manager external api #group1': function (browser: NightwatchBrowser) { 'Should execute `writeFile` api from file manager external api #group1': function (browser: NightwatchBrowser) {
browser browser
.addFile('writeFile.js', { content: executeWriteFile }) .addFile('writeFile.js', { content: executeWriteFile })
.executeScript('remix.exeCurrent()') .executeScriptInTerminal('remix.exeCurrent()')
.pause(2000) .pause(2000)
.openFile('new_contract.sol') .openFile('new_contract.sol')
.getEditorValue((content) => { .getEditorValue((content) => {
@ -45,23 +45,23 @@ module.exports = {
'Should execute `readFile` api from file manager external api #group2': function (browser: NightwatchBrowser) { 'Should execute `readFile` api from file manager external api #group2': function (browser: NightwatchBrowser) {
browser browser
.addFile('writeFile.js', { content: executeWriteFile }) .addFile('writeFile.js', { content: executeWriteFile })
.executeScript('remix.exeCurrent()') .executeScriptInTerminal('remix.exeCurrent()')
.addFile('readFile.js', { content: executeReadFile }) .addFile('readFile.js', { content: executeReadFile })
.executeScript('remix.exeCurrent()') .executeScriptInTerminal('remix.exeCurrent()')
.waitForElementContainsText('*[data-id="terminalJournal"]', 'pragma solidity ^0.6.0', 60000) .waitForElementContainsText('*[data-id="terminalJournal"]', 'pragma solidity ^0.6.0', 60000)
}, },
'Should execute `copyFile` api from file manager external api #group2': function (browser: NightwatchBrowser) { 'Should execute `copyFile` api from file manager external api #group2': function (browser: NightwatchBrowser) {
browser browser
.addFile('copyFile.js', { content: executeCopyFile }) .addFile('copyFile.js', { content: executeCopyFile })
.executeScript('remix.exeCurrent()') .executeScriptInTerminal('remix.exeCurrent()')
.waitForElementContainsText('*[data-id="terminalJournal"]', 'pragma solidity >=0.7.0 <0.9.0;', 60000) .waitForElementContainsText('*[data-id="terminalJournal"]', 'pragma solidity >=0.7.0 <0.9.0;', 60000)
}, },
'Should execute `rename` api from file manager external api #group2': function (browser: NightwatchBrowser) { 'Should execute `rename` api from file manager external api #group2': function (browser: NightwatchBrowser) {
browser browser
.addFile('renameFile.js', { content: executeRename }) .addFile('renameFile.js', { content: executeRename })
.executeScript('remix.exeCurrent()') .executeScriptInTerminal('remix.exeCurrent()')
.pause(2000) .pause(2000)
.waitForElementPresent('[data-id="treeViewLitreeViewItemold_contract.sol"]', 60000) .waitForElementPresent('[data-id="treeViewLitreeViewItemold_contract.sol"]', 60000)
}, },
@ -69,7 +69,7 @@ module.exports = {
'Should execute `mkdir` api from file manager external api #group3': function (browser: NightwatchBrowser) { 'Should execute `mkdir` api from file manager external api #group3': function (browser: NightwatchBrowser) {
browser browser
.addFile('mkdirFile.js', { content: executeMkdir }) .addFile('mkdirFile.js', { content: executeMkdir })
.executeScript('remix.exeCurrent()') .executeScriptInTerminal('remix.exeCurrent()')
.pause(2000) .pause(2000)
.waitForElementPresent('[data-id="treeViewLitreeViewItemTest_Folder"]', 80000) .waitForElementPresent('[data-id="treeViewLitreeViewItemTest_Folder"]', 80000)
}, },
@ -77,7 +77,7 @@ module.exports = {
'Should execute `readdir` api from file manager external api #group3': function (browser: NightwatchBrowser) { 'Should execute `readdir` api from file manager external api #group3': function (browser: NightwatchBrowser) {
browser browser
.addFile('readdirFile.js', { content: executeReaddir }) .addFile('readdirFile.js', { content: executeReaddir })
.executeScript('remix.exeCurrent()') .executeScriptInTerminal('remix.exeCurrent()')
.waitForElementContainsText('*[data-id="terminalJournal"]', 'Test_Folder isDirectory', 60000) .waitForElementContainsText('*[data-id="terminalJournal"]', 'Test_Folder isDirectory', 60000)
.waitForElementContainsText('*[data-id="terminalJournal"]', 'true', 5000) .waitForElementContainsText('*[data-id="terminalJournal"]', 'true', 5000)
}, },
@ -86,7 +86,7 @@ module.exports = {
browser browser
.addFile('old_contract.sol', { content: 'test' }) .addFile('old_contract.sol', { content: 'test' })
.addFile('removeFile.js', { content: executeRemove }) .addFile('removeFile.js', { content: executeRemove })
.executeScript('remix.exeCurrent()') .executeScriptInTerminal('remix.exeCurrent()')
.pause(2000) .pause(2000)
.waitForElementNotPresent('[data-id="treeViewLitreeViewItemold_contract.sol"]', 60000) .waitForElementNotPresent('[data-id="treeViewLitreeViewItemold_contract.sol"]', 60000)
}, },
@ -95,7 +95,7 @@ module.exports = {
'Should execute `remove` api from file manager external api on a folder #group4': function (browser: NightwatchBrowser) { 'Should execute `remove` api from file manager external api on a folder #group4': function (browser: NightwatchBrowser) {
browser browser
.addFile('test_jsRemoveFolder.js', { content: executeRemoveOnFolder }) .addFile('test_jsRemoveFolder.js', { content: executeRemoveOnFolder })
.executeScript('remix.exeCurrent()') .executeScriptInTerminal('remix.exeCurrent()')
.pause(2000) .pause(2000)
.waitForElementNotPresent('[data-id="treeViewLitreeViewItemcontracts"]', 60000) .waitForElementNotPresent('[data-id="treeViewLitreeViewItemcontracts"]', 60000)
.end() .end()

@ -34,7 +34,7 @@ module.exports = {
.sendKeys('*[data-id$="/blank"] .remixui_items', browser.Keys.ENTER) .sendKeys('*[data-id$="/blank"] .remixui_items', browser.Keys.ENTER)
.waitForElementVisible('*[data-id="treeViewLitreeViewItemBrowser_Tests"]') .waitForElementVisible('*[data-id="treeViewLitreeViewItemBrowser_Tests"]')
.addFile('File.sol', { content: '' }) .addFile('File.sol', { content: '' })
.executeScript(`remix.loadgist('${gistid}')`) .executeScriptInTerminal(`remix.loadgist('${gistid}')`)
// .perform((done) => { if (runtimeBrowser === 'chrome') { browser.openFile('gists') } done() }) // .perform((done) => { if (runtimeBrowser === 'chrome') { browser.openFile('gists') } done() })
.waitForElementVisible(`[data-id="treeViewLitreeViewItemgist-${gistid}"]`) .waitForElementVisible(`[data-id="treeViewLitreeViewItemgist-${gistid}"]`)
.click(`[data-id="treeViewLitreeViewItemgist-${gistid}"]`) .click(`[data-id="treeViewLitreeViewItemgist-${gistid}"]`)
@ -58,7 +58,7 @@ module.exports = {
const gistid = id[1] const gistid = id[1]
browser browser
.click('[data-id="default_workspace-modal-footer-cancel-react"]') .click('[data-id="default_workspace-modal-footer-cancel-react"]')
.executeScript(`remix.loadgist('${gistid}')`) .executeScriptInTerminal(`remix.loadgist('${gistid}')`)
// .perform((done) => { if (runtimeBrowser === 'chrome') { browser.openFile('gists') } done() }) // .perform((done) => { if (runtimeBrowser === 'chrome') { browser.openFile('gists') } done() })
.waitForElementVisible(`[data-id="treeViewLitreeViewItemgist-${gistid}"]`) .waitForElementVisible(`[data-id="treeViewLitreeViewItemgist-${gistid}"]`)
.click(`[data-id="treeViewLitreeViewItemgist-${gistid}"]`) .click(`[data-id="treeViewLitreeViewItemgist-${gistid}"]`)

@ -37,8 +37,8 @@ module.exports = {
.setValue('input[data-id="homeTabModalDialogCustomPromptText"]', testData.invalidURL) .setValue('input[data-id="homeTabModalDialogCustomPromptText"]', testData.invalidURL)
.waitForElementVisible('*[data-id="homeTab-modal-footer-ok-react"]') .waitForElementVisible('*[data-id="homeTab-modal-footer-ok-react"]')
.click('[data-id="homeTab-modal-footer-ok-react"]') // submitted .click('[data-id="homeTab-modal-footer-ok-react"]') // submitted
.waitForElementVisible('*[data-shared="tooltipPopup"]') //.waitForElementVisible('*[data-shared="tooltipPopup"]')
.assert.containsText('*[data-shared="tooltipPopup"] span', 'not found ' + testData.invalidURL) //.waitForElementContainsText('*[data-shared="tooltipPopup"] span', 'not found ' + testData.invalidURL)
}, },
'Import From GitHub For Valid URL #group2': function (browser: NightwatchBrowser) { 'Import From GitHub For Valid URL #group2': function (browser: NightwatchBrowser) {

@ -214,7 +214,7 @@ module.exports = {
} }
}) })
.waitForElementVisible('[data-id="treeViewLitreeViewItemcontracts/1_Storage.sol"]') .waitForElementVisible('[data-id="treeViewLitreeViewItemcontracts/1_Storage.sol"]')
.rightClick('[data-id="treeViewLitreeViewItemcontracts/1_Storage.sol"]').useXpath().waitForElementVisible('//*[@id="menuitemtestcommand"]').click('//*[@id="menuitemtestcommand"]', async () => { .rightClickCustom('[data-id="treeViewLitreeViewItemcontracts/1_Storage.sol"]').useXpath().waitForElementVisible('//*[@id="menuitemtestcommand"]').click('//*[@id="menuitemtestcommand"]', async () => {
// @ts-ignore // @ts-ignore
browser.click('//*[@data-id="verticalIconsKindlocalPlugin"]').frame(0, async () => { browser.click('//*[@data-id="verticalIconsKindlocalPlugin"]').frame(0, async () => {
await clickAndCheckLog(browser, null, { id: 'localPlugin', name: 'testCommand', label: 'testCommand', type: [], extension: ['.sol'], path: ['contracts/1_Storage.sol'], pattern: [] }, null, null) await clickAndCheckLog(browser, null, { id: 'localPlugin', name: 'testCommand', label: 'testCommand', type: [], extension: ['.sol'], path: ['contracts/1_Storage.sol'], pattern: [] }, null, null)
@ -321,14 +321,14 @@ module.exports = {
// DGIT // DGIT
'Should have changes on new workspace #group3': async function (browser: NightwatchBrowser) { 'Should have changes on new workspace #group3': async function (browser: NightwatchBrowser) {
await clickAndCheckLog(browser, 'filePanel:createWorkspace', null, null, 'dgit') await clickAndCheckLog(browser, 'filePanel:createWorkspace', null, null, 'dgit')
await clickAndCheckLog(browser, 'dGitProvider:status', [['README.txt', 0, 2, 0], ['contracts/1_Storage.sol', 0, 2, 0], ['contracts/2_Owner.sol', 0, 2, 0], ['contracts/3_Ballot.sol', 0, 2, 0], ['scripts/deploy_with_ethers.ts', 0, 2, 0], ['scripts/deploy_with_web3.ts', 0, 2, 0], ['tests/Ballot_test.sol', 0, 2, 0]], ['tests/storage.test.js', 0, 2, 0], null, null) await clickAndCheckLog(browser, 'dGitProvider:status', [["README.txt",0,2,0],["contracts/1_Storage.sol",0,2,0],["contracts/2_Owner.sol",0,2,0],["contracts/3_Ballot.sol",0,2,0],["scripts/deploy_with_ethers.ts",0,2,0],["scripts/deploy_with_web3.ts",0,2,0],["scripts/ethers-lib.ts",0,2,0],["scripts/web3-lib.ts",0,2,0],["tests/Ballot_test.sol",0,2,0],["tests/storage.test.js",0,2,0]], null, null)
}, },
'Should stage contract #group3': async function (browser: NightwatchBrowser) { 'Should stage contract #group3': async function (browser: NightwatchBrowser) {
await clickAndCheckLog(browser, 'dGitProvider:add', null, null, { await clickAndCheckLog(browser, 'dGitProvider:add', null, null, {
filepath: 'contracts/1_Storage.sol' filepath: 'contracts/1_Storage.sol'
}) })
await clickAndCheckLog(browser, 'dGitProvider:status', [['README.txt', 0, 2, 0], ['contracts/1_Storage.sol', 0, 2, 2], ['contracts/2_Owner.sol', 0, 2, 0], ['contracts/3_Ballot.sol', 0, 2, 0], ['scripts/deploy_with_ethers.ts', 0, 2, 0], ['scripts/deploy_with_web3.ts', 0, 2, 0], ['tests/Ballot_test.sol', 0, 2, 0]], ['tests/storage.test.js', 0, 2, 0], null, null) await clickAndCheckLog(browser, 'dGitProvider:status', [["README.txt",0,2,0],["contracts/1_Storage.sol",0,2,2],["contracts/2_Owner.sol",0,2,0],["contracts/3_Ballot.sol",0,2,0],["scripts/deploy_with_ethers.ts",0,2,0],["scripts/deploy_with_web3.ts",0,2,0],["scripts/ethers-lib.ts",0,2,0],["scripts/web3-lib.ts",0,2,0],["tests/Ballot_test.sol",0,2,0],["tests/storage.test.js",0,2,0]], null, null)
}, },
'Should commit changes #group3': async function (browser: NightwatchBrowser) { 'Should commit changes #group3': async function (browser: NightwatchBrowser) {
await clickAndCheckLog(browser, 'dGitProvider:commit', null, null, { author: { name: 'Remix', email: 'Remix' }, message: 'commit-message' }) await clickAndCheckLog(browser, 'dGitProvider:commit', null, null, { author: { name: 'Remix', email: 'Remix' }, message: 'commit-message' })
@ -417,7 +417,7 @@ module.exports = {
.frameParent() .frameParent()
.useCss() .useCss()
.addFile('test_modal.js', { content: testModalToasterApi }) .addFile('test_modal.js', { content: testModalToasterApi })
.executeScript('remix.execute(\'test_modal.js\')') .executeScriptInTerminal('remix.execute(\'test_modal.js\')')
.useCss() .useCss()
.waitForElementVisible('*[data-id="test_id_1_ModalDialogModalBody-react"]', 60000) .waitForElementVisible('*[data-id="test_id_1_ModalDialogModalBody-react"]', 60000)
.assert.containsText('*[data-id="test_id_1_ModalDialogModalBody-react"]', 'message 1') .assert.containsText('*[data-id="test_id_1_ModalDialogModalBody-react"]', 'message 1')

@ -55,6 +55,7 @@ module.exports = {
}, },
'start Remixd': function (browser) { 'start Remixd': function (browser) {
startRemixd(browser) startRemixd(browser)
}, },
'run Remixd tests #group4': function (browser) { 'run Remixd tests #group4': function (browser) {
runTests(browser) runTests(browser)
@ -102,7 +103,7 @@ module.exports = {
'Run git status': '' + function (browser) { 'Run git status': '' + function (browser) {
browser browser
.executeScript('git status') .executeScriptInTerminal('git status')
.pause(3000) .pause(3000)
.journalLastChildIncludes('On branch ') .journalLastChildIncludes('On branch ')
}, },
@ -131,6 +132,7 @@ function startRemixd (browser: NightwatchBrowser) {
.waitForElementVisible('*[data-id="remixdConnect-modal-footer-ok-react"]', 2000) .waitForElementVisible('*[data-id="remixdConnect-modal-footer-ok-react"]', 2000)
.pause(2000) .pause(2000)
.click('*[data-id="remixdConnect-modal-footer-ok-react"]') .click('*[data-id="remixdConnect-modal-footer-ok-react"]')
.pause(10000)
// .click('*[data-id="workspacesModalDialog-modal-footer-ok-react"]') // .click('*[data-id="workspacesModalDialog-modal-footer-ok-react"]')
} }

@ -39,8 +39,8 @@ module.exports = {
.waitForElementVisible('*[data-id="signMessageTextarea"]', 120000) .waitForElementVisible('*[data-id="signMessageTextarea"]', 120000)
.click('*[data-id="signMessageTextarea"]') .click('*[data-id="signMessageTextarea"]')
.setValue('*[data-id="signMessageTextarea"]', 'Remix is cool!') .setValue('*[data-id="signMessageTextarea"]', 'Remix is cool!')
.assert.elementNotPresent('*[data-id="settingsRemixRunSignMsgHash"]') .assert.not.elementPresent('*[data-id="settingsRemixRunSignMsgHash"]')
.assert.elementNotPresent('*[data-id="settingsRemixRunSignMsgSignature"]') .assert.not.elementPresent('*[data-id="settingsRemixRunSignMsgSignature"]')
.pause(2000) .pause(2000)
.waitForElementPresent('[data-id="udappNotify-modal-footer-ok-react"]') .waitForElementPresent('[data-id="udappNotify-modal-footer-ok-react"]')
.click('[data-id="udappNotify-modal-footer-ok-react"]') .click('[data-id="udappNotify-modal-footer-ok-react"]')
@ -80,7 +80,7 @@ module.exports = {
.end() .end()
}, },
'Should connect to Goerli Test Network using MetaMask': '' + function (browser: NightwatchBrowser) { 'Should connect to Goerli Test Network using MetaMask': !function (browser: NightwatchBrowser) {
browser.waitForElementPresent('*[data-id="remixIdeSidePanel"]') browser.waitForElementPresent('*[data-id="remixIdeSidePanel"]')
.setupMetamask(passphrase, password) .setupMetamask(passphrase, password)
.click('.network-indicator__down-arrow') .click('.network-indicator__down-arrow')
@ -101,7 +101,7 @@ module.exports = {
.switchBrowserTab(0) .switchBrowserTab(0)
}, },
'Should deploy contract on Goerli Test Network using MetaMask': '' + function (browser: NightwatchBrowser) { 'Should deploy contract on Goerli Test Network using MetaMask': !function (browser: NightwatchBrowser) {
browser.waitForElementPresent('*[data-id="runTabSelectAccount"] option') browser.waitForElementPresent('*[data-id="runTabSelectAccount"] option')
.clickLaunchIcon('filePanel') .clickLaunchIcon('filePanel')
.openFile('Greet.sol') .openFile('Greet.sol')
@ -118,7 +118,7 @@ module.exports = {
.switchBrowserTab(0) .switchBrowserTab(0)
}, },
'Should run low level interaction (fallback function) on Goerli Test Network using MetaMask': '' + function (browser: NightwatchBrowser) { 'Should run low level interaction (fallback function) on Goerli Test Network using MetaMask': !function (browser: NightwatchBrowser) {
browser.waitForElementPresent('*[data-id="remixIdeSidePanel"]') browser.waitForElementPresent('*[data-id="remixIdeSidePanel"]')
.waitForElementPresent('*[data-id="universalDappUiTitleExpander"]') .waitForElementPresent('*[data-id="universalDappUiTitleExpander"]')
.click('*[data-id="universalDappUiTitleExpander"]') .click('*[data-id="universalDappUiTitleExpander"]')
@ -135,7 +135,7 @@ module.exports = {
.end() .end()
}, },
'Should connect to Ethereum Main Network using MetaMask': '' + function (browser: NightwatchBrowser) { 'Should connect to Ethereum Main Network using MetaMask': !function (browser: NightwatchBrowser) {
browser.waitForElementPresent('*[data-id="remixIdeSidePanel"]') browser.waitForElementPresent('*[data-id="remixIdeSidePanel"]')
.switchBrowserTab(2) .switchBrowserTab(2)
.waitForElementPresent('.network-indicator__down-arrow') .waitForElementPresent('.network-indicator__down-arrow')
@ -153,7 +153,7 @@ module.exports = {
.assert.containsText('*[data-id="settingsNetworkEnv"]', 'Main (1) network') .assert.containsText('*[data-id="settingsNetworkEnv"]', 'Main (1) network')
}, },
'Should deploy contract on Ethereum Main Network using MetaMask': '' + function (browser: NightwatchBrowser) { 'Should deploy contract on Ethereum Main Network using MetaMask': !function (browser: NightwatchBrowser) {
browser.waitForElementPresent('*[data-id="runTabSelectAccount"] option') browser.waitForElementPresent('*[data-id="runTabSelectAccount"] option')
.clickLaunchIcon('filePanel') .clickLaunchIcon('filePanel')
.openFile('Greet.sol') .openFile('Greet.sol')
@ -173,7 +173,7 @@ module.exports = {
* - Ropsten node for retrieving the trace and storage * - Ropsten node for retrieving the trace and storage
* *
*/ */
'Should debug Ropsten transaction with source highlighting using the source verifier service and MetaMask': '' + function (browser: NightwatchBrowser) { 'Should debug Ropsten transaction with source highlighting using the source verifier service and MetaMask': !function (browser: NightwatchBrowser) {
browser.waitForElementPresent('*[data-id="remixIdeSidePanel"]') browser.waitForElementPresent('*[data-id="remixIdeSidePanel"]')
.waitForElementVisible('*[data-id="remixIdeIconPanel"]', 10000) .waitForElementVisible('*[data-id="remixIdeIconPanel"]', 10000)
.switchBrowserTab(2) .switchBrowserTab(2)
@ -198,9 +198,9 @@ module.exports = {
.assert.containsText('*[data-id="solidityLocals"]', 'to: 0x6C3CCC7FBA111707D5A1AAF2758E9D4F4AC5E7B1') .assert.containsText('*[data-id="solidityLocals"]', 'to: 0x6C3CCC7FBA111707D5A1AAF2758E9D4F4AC5E7B1')
}, },
'Call web3.eth.getAccounts() using Injected Provider (Metamask)': '' + function (browser: NightwatchBrowser) { 'Call web3.eth.getAccounts() using Injected Provider (Metamask)': !function (browser: NightwatchBrowser) {
browser browser
.executeScript('web3.eth.getAccounts()') .executeScriptInTerminal('web3.eth.getAccounts()')
.pause(2000) .pause(2000)
.journalLastChildIncludes('[ "0x76a3ABb5a12dcd603B52Ed22195dED17ee82708f" ]') .journalLastChildIncludes('[ "0x76a3ABb5a12dcd603B52Ed22195dED17ee82708f" ]')
.end() .end()

@ -12,7 +12,7 @@ module.exports = {
browser.waitForElementVisible('*[data-id="remixIdeSidePanel"]') browser.waitForElementVisible('*[data-id="remixIdeSidePanel"]')
.click('*[plugin="search"]').waitForElementVisible('*[id="search_input"]') .click('*[plugin="search"]').waitForElementVisible('*[id="search_input"]')
.waitForElementVisible('*[id="search_include"]') .waitForElementVisible('*[id="search_include"]')
.setValue('*[id="search_include"]', ', *.txt').pause(2000) .setValue('*[id="search_include"]', ', *.*').pause(2000)
.setValue('*[id="search_input"]', 'read').sendKeys('*[id="search_input"]', browser.Keys.ENTER) .setValue('*[id="search_input"]', 'read').sendKeys('*[id="search_input"]', browser.Keys.ENTER)
.pause(1000) .pause(1000)
.waitForElementContainsText('*[data-id="search_results"]', '3_BALLOT.SOL', 60000) .waitForElementContainsText('*[data-id="search_results"]', '3_BALLOT.SOL', 60000)
@ -100,7 +100,7 @@ module.exports = {
browser.click('*[data-id="confirm_replace_label"]').pause(500) browser.click('*[data-id="confirm_replace_label"]').pause(500)
.clearValue('*[id="search_input"]') .clearValue('*[id="search_input"]')
.setValue('*[id="search_input"]', 'replacing').sendKeys('*[id="search_input"]', browser.Keys.ENTER).pause(1000) .setValue('*[id="search_input"]', 'replacing').sendKeys('*[id="search_input"]', browser.Keys.ENTER).pause(1000)
.setValue('*[id="search_replace"]', '2').pause(1000) .setValue('*[id="search_replace"]', 'replacing2').pause(1000)
.waitForElementVisible('*[data-id="contracts/2_Owner.sol-33-71"]') .waitForElementVisible('*[data-id="contracts/2_Owner.sol-33-71"]')
.moveToElement('*[data-id="contracts/2_Owner.sol-33-71"]', 10, 10) .moveToElement('*[data-id="contracts/2_Owner.sol-33-71"]', 10, 10)
.waitForElementVisible('*[data-id="replace-contracts/2_Owner.sol-33-71"]') .waitForElementVisible('*[data-id="replace-contracts/2_Owner.sol-33-71"]')

@ -177,10 +177,16 @@ module.exports = {
// creating a new workspace // creating a new workspace
.click('*[data-id="workspaceCreate"]') .click('*[data-id="workspaceCreate"]')
.waitForElementVisible('*[data-id="modalDialogCustomPromptTextCreate"]') .waitForElementVisible('*[data-id="modalDialogCustomPromptTextCreate"]')
// eslint-disable-next-line dot-notation .click('*[data-id="fileSystemModalDialogContainer-react"] input[data-id="modalDialogCustomPromptTextCreate"]')
.execute(function () { document.querySelector('*[data-id="modalDialogCustomPromptTextCreate"]')['value'] = 'workspace_new' }) .setValue('*[data-id="fileSystemModalDialogContainer-react"] input[data-id="modalDialogCustomPromptTextCreate"]', 'workspace_new')
.pause(2000)
.getValue('*[data-id="fileSystemModalDialogContainer-react"] input[data-id="modalDialogCustomPromptTextCreate"]', (result) => {
console.log(result)
browser.assert.equal(result.value, 'workspace_new')
})
.waitForElementVisible('*[data-id="fileSystem-modal-footer-ok-react"]') .waitForElementVisible('*[data-id="fileSystem-modal-footer-ok-react"]')
.execute(function () { (document.querySelector('[data-id="fileSystem-modal-footer-ok-react"]') as HTMLElement).click() }) .click('*[data-id="fileSystem-modal-footer-ok-react"]')
.pause(3000)
.currentWorkspaceIs('workspace_new') .currentWorkspaceIs('workspace_new')
.waitForElementVisible('li[data-id="treeViewLitreeViewItem.deps/remix-tests/remix_tests.sol"]') .waitForElementVisible('li[data-id="treeViewLitreeViewItem.deps/remix-tests/remix_tests.sol"]')
.waitForElementVisible('li[data-id="treeViewLitreeViewItem.deps/remix-tests/remix_accounts.sol"]') .waitForElementVisible('li[data-id="treeViewLitreeViewItem.deps/remix-tests/remix_accounts.sol"]')

@ -33,7 +33,7 @@ module.exports = {
.journalLastChildIncludes('to: CheckSpecials.(fallback)') .journalLastChildIncludes('to: CheckSpecials.(fallback)')
.journalLastChildIncludes('value: 0 wei') .journalLastChildIncludes('value: 0 wei')
.journalLastChildIncludes('data: 0xaa') .journalLastChildIncludes('data: 0xaa')
.perform(done) .perform(done())
}) })
}) })
}, },
@ -46,7 +46,7 @@ module.exports = {
.pause(1000) .pause(1000)
.waitForElementVisible(`#instance${address} label[id="deployAndRunLLTxError"]`) .waitForElementVisible(`#instance${address} label[id="deployAndRunLLTxError"]`)
.assert.containsText(`#instance${address} label[id="deployAndRunLLTxError"]`, 'The calldata should be a valid hexadecimal value with size of at least one byte.') .assert.containsText(`#instance${address} label[id="deployAndRunLLTxError"]`, 'The calldata should be a valid hexadecimal value with size of at least one byte.')
.perform(done) .perform(done())
}) })
}) })
}, },
@ -58,7 +58,7 @@ module.exports = {
.pause(1000) .pause(1000)
.waitForElementVisible(`#instance${address} label[id="deployAndRunLLTxError"]`) .waitForElementVisible(`#instance${address} label[id="deployAndRunLLTxError"]`)
.assert.containsText(`#instance${address} label[id="deployAndRunLLTxError"]`, 'The calldata should be a valid hexadecimal value.') .assert.containsText(`#instance${address} label[id="deployAndRunLLTxError"]`, 'The calldata should be a valid hexadecimal value.')
.perform(done) .perform(done())
}) })
}) })
}, },
@ -71,7 +71,7 @@ module.exports = {
.journalLastChildIncludes('to: CheckSpecials.(receive)') .journalLastChildIncludes('to: CheckSpecials.(receive)')
.journalLastChildIncludes('value: 1 wei') .journalLastChildIncludes('value: 1 wei')
.journalLastChildIncludes('data: 0x') .journalLastChildIncludes('data: 0x')
.perform(done) .perform(done())
}) })
}) })
}, },
@ -83,7 +83,7 @@ module.exports = {
.pause(1000) .pause(1000)
.journalLastChildIncludes('to CheckSpecials.(fallback) errored:') .journalLastChildIncludes('to CheckSpecials.(fallback) errored:')
.journalLastChildIncludes('The called function should be payable if you send value') .journalLastChildIncludes('The called function should be payable if you send value')
.perform(done) .perform(done())
}) })
}) })
}, },
@ -101,7 +101,7 @@ module.exports = {
.journalLastChildIncludes('to: CheckSpecials.(receive)') .journalLastChildIncludes('to: CheckSpecials.(receive)')
.journalLastChildIncludes('value: 1 wei') .journalLastChildIncludes('value: 1 wei')
.journalLastChildIncludes('data: 0x') .journalLastChildIncludes('data: 0x')
.perform(done) .perform(done())
}) })
}) })
}, },
@ -113,7 +113,7 @@ module.exports = {
.pause(1000) .pause(1000)
.waitForElementVisible(`#instance${address} label[id="deployAndRunLLTxError"]`) .waitForElementVisible(`#instance${address} label[id="deployAndRunLLTxError"]`)
.assert.containsText(`#instance${address} label[id="deployAndRunLLTxError"]`, '\'Fallback\' function is not defined') .assert.containsText(`#instance${address} label[id="deployAndRunLLTxError"]`, '\'Fallback\' function is not defined')
.perform(done) .perform(done())
}) })
}) })
}, },
@ -131,7 +131,7 @@ module.exports = {
.journalLastChildIncludes('to: CheckSpecials.(fallback)') .journalLastChildIncludes('to: CheckSpecials.(fallback)')
.journalLastChildIncludes('value: 1 wei') .journalLastChildIncludes('value: 1 wei')
.journalLastChildIncludes('data: 0x') .journalLastChildIncludes('data: 0x')
.perform(done) .perform(done())
}) })
}) })
}, },
@ -144,7 +144,7 @@ module.exports = {
.journalLastChildIncludes('to: CheckSpecials.(fallback)') .journalLastChildIncludes('to: CheckSpecials.(fallback)')
.journalLastChildIncludes('value: 1 wei') .journalLastChildIncludes('value: 1 wei')
.journalLastChildIncludes('data: 0xaa') .journalLastChildIncludes('data: 0xaa')
.perform(done) .perform(done())
}) })
}) })
}, },
@ -161,7 +161,7 @@ module.exports = {
.pause(1000) .pause(1000)
.waitForElementVisible(`#instance${address} label[id="deployAndRunLLTxError"]`) .waitForElementVisible(`#instance${address} label[id="deployAndRunLLTxError"]`)
.assert.containsText(`#instance${address} label[id="deployAndRunLLTxError"]`, 'should have either \'receive\' or payable \'fallback\'') .assert.containsText(`#instance${address} label[id="deployAndRunLLTxError"]`, 'should have either \'receive\' or payable \'fallback\'')
.perform(done) .perform(done())
}) })
}) })
}, },
@ -184,7 +184,7 @@ module.exports = {
.journalLastChildIncludes('to: CheckSpecials.(fallback)') .journalLastChildIncludes('to: CheckSpecials.(fallback)')
.journalLastChildIncludes('value: 999999998765257135 wei') .journalLastChildIncludes('value: 999999998765257135 wei')
.journalLastChildIncludes('data: 0xaa') .journalLastChildIncludes('data: 0xaa')
.perform(done) .perform(done())
}) })
}) })
}, },
@ -196,7 +196,7 @@ module.exports = {
.journalLastChildIncludes('to: CheckSpecials.(receive)') .journalLastChildIncludes('to: CheckSpecials.(receive)')
.journalLastChildIncludes('value: 1 wei') .journalLastChildIncludes('value: 1 wei')
.journalLastChildIncludes('data: 0x') .journalLastChildIncludes('data: 0x')
.perform(done) .perform(done())
}) })
}) })
}, },
@ -217,7 +217,7 @@ module.exports = {
.pause(1000) .pause(1000)
.waitForElementVisible(`#instance${address} label[id="deployAndRunLLTxError"]`) .waitForElementVisible(`#instance${address} label[id="deployAndRunLLTxError"]`)
.assert.containsText(`#instance${address} label[id="deployAndRunLLTxError"]`, 'Both \'receive\' and \'fallback\' functions are not defined') .assert.containsText(`#instance${address} label[id="deployAndRunLLTxError"]`, 'Both \'receive\' and \'fallback\' functions are not defined')
.perform(done) .perform(done())
}) })
}) })
.end() .end()

@ -42,7 +42,7 @@ module.exports = {
.waitForElementPresent('#staticanalysisresult .warning', 5000) .waitForElementPresent('#staticanalysisresult .warning', 5000)
.assert.containsText('#verticalIconsKindsolidityStaticAnalysis .remixui_status', '1') // Check warning count .assert.containsText('#verticalIconsKindsolidityStaticAnalysis .remixui_status', '1') // Check warning count
.verify.elementPresent('input[name="showLibWarnings"]') .verify.elementPresent('input[name="showLibWarnings"]')
.verify.elementNotPresent('input[name="showLibWarnings"]:checked') .verify.not.elementPresent('input[name="showLibWarnings"]:checked')
.verify.elementPresent('label[id="headingshowLibWarnings"]') .verify.elementPresent('label[id="headingshowLibWarnings"]')
.click('label[id="headingshowLibWarnings"]') .click('label[id="headingshowLibWarnings"]')
.pause(1000) .pause(1000)
@ -62,7 +62,7 @@ function runTests (browser: NightwatchBrowser) {
.testContracts('Untitled.sol', sources[0]['Untitled.sol'], ['TooMuchGas', 'test1', 'test2']) .testContracts('Untitled.sol', sources[0]['Untitled.sol'], ['TooMuchGas', 'test1', 'test2'])
.clickLaunchIcon('solidityStaticAnalysis') .clickLaunchIcon('solidityStaticAnalysis')
.click('#staticanalysisButton button') .click('#staticanalysisButton button')
.waitForElementPresent('#staticanalysisresult .warning', 2000, true, function () { .waitForElementPresent('#staticanalysisresult .warning', 2000, 500, true, function () {
listSelectorContains(['Use of tx.origin', listSelectorContains(['Use of tx.origin',
'Fallback function of contract TooMuchGas requires too much gas', 'Fallback function of contract TooMuchGas requires too much gas',
'TooMuchGas.() : Variables have very similar names "test" and "test1".', 'TooMuchGas.() : Variables have very similar names "test" and "test1".',

@ -10,7 +10,7 @@ module.exports = {
'Should execution a simple console command #group1 #group999': function (browser: NightwatchBrowser) { 'Should execution a simple console command #group1 #group999': function (browser: NightwatchBrowser) {
browser browser
.waitForElementVisible('*[data-id="terminalCli"]', 10000) .waitForElementVisible('*[data-id="terminalCli"]', 10000)
.executeScript('console.log(1 + 1)') .executeScriptInTerminal('console.log(1 + 1)')
.pause(2000) .pause(2000)
.waitForElementContainsText('*[data-id="terminalJournal"]', '2', 60000) .waitForElementContainsText('*[data-id="terminalJournal"]', '2', 60000)
}, },
@ -26,7 +26,7 @@ module.exports = {
'Async/Await Script #group1': function (browser: NightwatchBrowser) { 'Async/Await Script #group1': function (browser: NightwatchBrowser) {
browser browser
.addFile('asyncAwait.js', { content: asyncAwait }) .addFile('asyncAwait.js', { content: asyncAwait })
.executeScript('remix.execute("asyncAwait.js")') .executeScriptInTerminal('remix.execute("asyncAwait.js")')
.waitForElementContainsText('*[data-id="terminalJournal"]', 'Waiting Promise', 60000) .waitForElementContainsText('*[data-id="terminalJournal"]', 'Waiting Promise', 60000)
.waitForElementContainsText('*[data-id="terminalJournal"]', 'result - ', 60000) .waitForElementContainsText('*[data-id="terminalJournal"]', 'result - ', 60000)
.waitForElementContainsText('*[data-id="terminalJournal"]', 'Promise Resolved', 60000) .waitForElementContainsText('*[data-id="terminalJournal"]', 'Promise Resolved', 60000)
@ -35,13 +35,13 @@ module.exports = {
'Call Remix File Manager from a script #group2': function (browser: NightwatchBrowser) { 'Call Remix File Manager from a script #group2': function (browser: NightwatchBrowser) {
browser browser
.addFile('asyncAwaitWithFileManagerAccess.js', { content: asyncAwaitWithFileManagerAccess }) .addFile('asyncAwaitWithFileManagerAccess.js', { content: asyncAwaitWithFileManagerAccess })
.executeScript('remix.execute(\'asyncAwaitWithFileManagerAccess.js\')') .executeScriptInTerminal('remix.execute(\'asyncAwaitWithFileManagerAccess.js\')')
.waitForElementContainsText('*[data-id="terminalJournal"]', 'contract Ballot {', 60000) .waitForElementContainsText('*[data-id="terminalJournal"]', 'contract Ballot {', 60000)
}, },
'Call web3.eth.getAccounts() using Remix VM #group2': function (browser: NightwatchBrowser) { 'Call web3.eth.getAccounts() using Remix VM #group2': function (browser: NightwatchBrowser) {
browser browser
.executeScript('web3.eth.getAccounts()') .executeScriptInTerminal('web3.eth.getAccounts()')
.waitForElementContainsText('*[data-id="terminalJournal"]', '["0x5B38Da6a701c568545dCfcB03FcB875f56beddC4","0xAb8483F64d9C6d1EcF9b849Ae677dD3315835cb2","0x4B20993Bc481177ec7E8f571ceCaE8A9e22C02db","0x78731D3Ca6b7E34aC0F824c42a7cC18A495cabaB","0x617F2E2fD72FD9D5503197092aC168c91465E7f2","0x17F6AD8Ef982297579C203069C1DbfFE4348c372","0x5c6B0f7Bf3E7ce046039Bd8FABdfD3f9F5021678","0x03C6FcED478cBbC9a4FAB34eF9f40767739D1Ff7","0x1aE0EA34a72D944a8C7603FfB3eC30a6669E454C","0x0A098Eda01Ce92ff4A4CCb7A4fFFb5A43EBC70DC","0xCA35b7d915458EF540aDe6068dFe2F44E8fa733c","0x14723A09ACff6D2A60DcdF7aA4AFf308FDDC160C","0x4B0897b0513fdC7C541B6d9D7E929C4e5364D2dB","0x583031D1113aD414F02576BD6afaBfb302140225","0xdD870fA1b7C4700F2BD7f44238821C26f7392148"]') .waitForElementContainsText('*[data-id="terminalJournal"]', '["0x5B38Da6a701c568545dCfcB03FcB875f56beddC4","0xAb8483F64d9C6d1EcF9b849Ae677dD3315835cb2","0x4B20993Bc481177ec7E8f571ceCaE8A9e22C02db","0x78731D3Ca6b7E34aC0F824c42a7cC18A495cabaB","0x617F2E2fD72FD9D5503197092aC168c91465E7f2","0x17F6AD8Ef982297579C203069C1DbfFE4348c372","0x5c6B0f7Bf3E7ce046039Bd8FABdfD3f9F5021678","0x03C6FcED478cBbC9a4FAB34eF9f40767739D1Ff7","0x1aE0EA34a72D944a8C7603FfB3eC30a6669E454C","0x0A098Eda01Ce92ff4A4CCb7A4fFFb5A43EBC70DC","0xCA35b7d915458EF540aDe6068dFe2F44E8fa733c","0x14723A09ACff6D2A60DcdF7aA4AFf308FDDC160C","0x4B0897b0513fdC7C541B6d9D7E929C4e5364D2dB","0x583031D1113aD414F02576BD6afaBfb302140225","0xdD870fA1b7C4700F2BD7f44238821C26f7392148"]')
}, },
@ -51,7 +51,7 @@ module.exports = {
.clickLaunchIcon('udapp') .clickLaunchIcon('udapp')
.switchEnvironment('External Http Provider') .switchEnvironment('External Http Provider')
.modalFooterOKClick('basic-http-provider') .modalFooterOKClick('basic-http-provider')
.executeScript('web3.eth.getAccounts()') .executeScriptInTerminal('web3.eth.getAccounts()')
.waitForElementContainsText('*[data-id="terminalJournal"]', '["', 60000) // we check if an array is present, don't need to check for the content .waitForElementContainsText('*[data-id="terminalJournal"]', '["', 60000) // we check if an array is present, don't need to check for the content
.waitForElementContainsText('*[data-id="terminalJournal"]', '"]', 60000) .waitForElementContainsText('*[data-id="terminalJournal"]', '"]', 60000)
.waitForElementContainsText('*[data-id="terminalJournal"]', '","', 60000) .waitForElementContainsText('*[data-id="terminalJournal"]', '","', 60000)
@ -63,7 +63,7 @@ module.exports = {
.addFile('resolveExternalUrlAndSave.js', { content: resolveExternalUrlAndSave }) .addFile('resolveExternalUrlAndSave.js', { content: resolveExternalUrlAndSave })
.openFile('resolveExternalUrlAndSave.js') .openFile('resolveExternalUrlAndSave.js')
.pause(1000) .pause(1000)
.executeScript('remix.execute(\'resolveExternalUrlAndSave.js\')') .executeScriptInTerminal('remix.execute(\'resolveExternalUrlAndSave.js\')')
.waitForElementContainsText('*[data-id="terminalJournal"]', 'Implementation of the {IERC20} interface.', 60000) .waitForElementContainsText('*[data-id="terminalJournal"]', 'Implementation of the {IERC20} interface.', 60000)
.openFile('.deps/github/OpenZeppelin/openzeppelin-contracts/contracts/token/ERC20/ERC20.sol') .openFile('.deps/github/OpenZeppelin/openzeppelin-contracts/contracts/token/ERC20/ERC20.sol')
}, },
@ -74,7 +74,7 @@ module.exports = {
.addFile('resolveUrl.js', { content: resolveUrl }) .addFile('resolveUrl.js', { content: resolveUrl })
.openFile('resolveUrl.js') .openFile('resolveUrl.js')
.pause(1000) .pause(1000)
.executeScript('remix.execute(\'resolveUrl.js\')') .executeScriptInTerminal('remix.execute(\'resolveUrl.js\')')
.waitForElementContainsText('*[data-id="terminalJournal"]', 'contract Ballot {', 60000) .waitForElementContainsText('*[data-id="terminalJournal"]', 'contract Ballot {', 60000)
}, },
@ -84,7 +84,7 @@ module.exports = {
.addFile('resolveExternalUrlAndSaveToaPath.js', { content: resolveExternalUrlAndSaveToaPath }) .addFile('resolveExternalUrlAndSaveToaPath.js', { content: resolveExternalUrlAndSaveToaPath })
.openFile('resolveExternalUrlAndSaveToaPath.js') .openFile('resolveExternalUrlAndSaveToaPath.js')
.pause(1000) .pause(1000)
.executeScript('remix.execute(\'resolveExternalUrlAndSaveToaPath.js\')') .executeScriptInTerminal('remix.execute(\'resolveExternalUrlAndSaveToaPath.js\')')
.waitForElementContainsText('*[data-id="terminalJournal"]', 'abstract contract ERC20Burnable', 60000) .waitForElementContainsText('*[data-id="terminalJournal"]', 'abstract contract ERC20Burnable', 60000)
.openFile('.deps/github/newFile.sol') .openFile('.deps/github/newFile.sol')
@ -105,7 +105,7 @@ module.exports = {
.openFile('contracts/2_Owner.sol') .openFile('contracts/2_Owner.sol')
.clickLaunchIcon('solidity') .clickLaunchIcon('solidity')
.click('*[data-id="compilerContainerCompileBtn"]').pause(5000) // compile Owner .click('*[data-id="compilerContainerCompileBtn"]').pause(5000) // compile Owner
.executeScript('remix.execute(\'deployWithEthersJs.js\')') .executeScriptInTerminal('remix.execute(\'deployWithEthersJs.js\')')
.waitForElementContainsText('*[data-id="terminalJournal"]', 'Contract Address:', 60000) .waitForElementContainsText('*[data-id="terminalJournal"]', 'Contract Address:', 60000)
.waitForElementContainsText('*[data-id="terminalJournal"]', '0xd9145CCE52D386f254917e481eB44e9943F39138', 60000) .waitForElementContainsText('*[data-id="terminalJournal"]', '0xd9145CCE52D386f254917e481eB44e9943F39138', 60000)
.waitForElementContainsText('*[data-id="terminalJournal"]', 'Deployment successful.', 60000) .waitForElementContainsText('*[data-id="terminalJournal"]', 'Deployment successful.', 60000)
@ -127,7 +127,7 @@ module.exports = {
.clickLaunchIcon('solidity') .clickLaunchIcon('solidity')
.click('*[data-id="compilerContainerCompileBtn"]') .click('*[data-id="compilerContainerCompileBtn"]')
.pause(1000) // compile Storage .pause(1000) // compile Storage
.executeScript('remix.execute(\'scripts/storage.test.js\')') .executeScriptInTerminal('remix.execute(\'scripts/storage.test.js\')')
.pause(1000) .pause(1000)
.waitForElementContainsText('*[data-id="terminalJournal"]', 'Running tests....') .waitForElementContainsText('*[data-id="terminalJournal"]', 'Running tests....')
.waitForElementContainsText('*[data-id="terminalJournal"]', 'storage contract Address:') .waitForElementContainsText('*[data-id="terminalJournal"]', 'storage contract Address:')
@ -149,7 +149,7 @@ module.exports = {
.clickLaunchIcon('solidity') .clickLaunchIcon('solidity')
.click('*[data-id="compilerContainerCompileBtn"]') .click('*[data-id="compilerContainerCompileBtn"]')
.pause(1000) // compile StorageWithLib .pause(1000) // compile StorageWithLib
.executeScript('remix.execute(\'scripts/storageWithLib.test.js\')') .executeScriptInTerminal('remix.execute(\'scripts/storageWithLib.test.js\')')
.pause(1000) .pause(1000)
.waitForElementContainsText('*[data-id="terminalJournal"]', 'Running tests....') .waitForElementContainsText('*[data-id="terminalJournal"]', 'Running tests....')
.waitForElementContainsText('*[data-id="terminalJournal"]', 'Storage with lib') .waitForElementContainsText('*[data-id="terminalJournal"]', 'Storage with lib')

@ -23,8 +23,8 @@ module.exports = {
status: 'true Transaction mined and execution succeed', status: 'true Transaction mined and execution succeed',
'decoded output': { 0: 'uint256: 8' } 'decoded output': { 0: 'uint256: 8' }
}) })
.pause(500) .pause(120000)
.checkTerminalFilter('0x12332162e2e31397dc1e07ed0a1cf08f728e9b4487c6f9ed79d2f39410c92782', '') //.checkTerminalFilter('0x12332162e2e31397dc1e07ed0a1cf08f728e9b4487c6f9ed79d2f39410c92782', '')
.clickFunction('g - transact (not payable)') .clickFunction('g - transact (not payable)')
.testFunction('last', .testFunction('last',
{ {

@ -9,13 +9,14 @@ const sources = [
] ]
module.exports = { module.exports = {
'@disabled': true,
before: function (browser: NightwatchBrowser, done: VoidFunction) { before: function (browser: NightwatchBrowser, done: VoidFunction) {
init(browser, done) init(browser, done)
}, },
'@sources': function () { '@sources': function () {
return sources return sources
}, },
'The sequence: Compiling / Deploying / Compiling another contract / calling the first contract - should display in the log the transaction with all the decoded information': function (browser: NightwatchBrowser) { 'The sequence: Compiling / Deploying / Compiling another contract / calling the first contract - should display in the log the transaction with all the decoded information #group1': function (browser: NightwatchBrowser) {
// https://github.com/ethereum/remix-ide/issues/2864 // https://github.com/ethereum/remix-ide/issues/2864
browser browser
.waitForElementVisible('*[data-id="remixIdeIconPanel"]', 10000) .waitForElementVisible('*[data-id="remixIdeIconPanel"]', 10000)
@ -36,8 +37,7 @@ module.exports = {
.clickLaunchIcon('solidity') .clickLaunchIcon('solidity')
.testContracts('Untitled1.sol', sources[1]['Untitled1.sol'], ['test']) .testContracts('Untitled1.sol', sources[1]['Untitled1.sol'], ['test'])
.clickLaunchIcon('udapp') .clickLaunchIcon('udapp')
.clickFunction('delegate - transact (not payable)', { types: 'address to', values: '' }) .clickFunction('delegate - transact (not payable)', { types: 'address to', values: '"0x4b0897b0513fdc7c541b6d9d7e929c4e5364d2db"' })
.pause(5000)
.testFunction('last', .testFunction('last',
{ {
status: 'false Transaction mined but execution failed', status: 'false Transaction mined but execution failed',

@ -227,7 +227,7 @@ module.exports = {
// default values // default values
.assert.containsText('#evmVersionSelector option[data-id="selected"]', 'default') .assert.containsText('#evmVersionSelector option[data-id="selected"]', 'default')
.verify.elementPresent('#optimize') .verify.elementPresent('#optimize')
.assert.elementNotPresent('#optimize:checked') .assert.not.elementPresent('#optimize:checked')
.verify.elementPresent('#runs:disabled') .verify.elementPresent('#runs:disabled')
.click('[for="optimize"') .click('[for="optimize"')
.verify.attributeEquals('#runs', 'value', '200') .verify.attributeEquals('#runs', 'value', '200')

@ -13,7 +13,7 @@ module.exports = {
.click('*[data-id="verticalIconsKindpluginManager"]') .click('*[data-id="verticalIconsKindpluginManager"]')
.scrollAndClick('*[data-id="pluginManagerComponentActivateButtondebugger"]') .scrollAndClick('*[data-id="pluginManagerComponentActivateButtondebugger"]')
.waitForElementVisible('*[data-id="pluginManagerComponentDeactivateButtondebugger"]', 7000) .waitForElementVisible('*[data-id="pluginManagerComponentDeactivateButtondebugger"]', 7000)
.rightClick('[data-id="verticalIconsKinddebugger"]') .rightClickCustom('[data-id="verticalIconsKinddebugger"]')
.waitForElementVisible('*[id="menuitemdeactivate"]') .waitForElementVisible('*[id="menuitemdeactivate"]')
.waitForElementVisible('*[id="menuitemdocumentation"]') .waitForElementVisible('*[id="menuitemdocumentation"]')
.click('*[data-id="remixIdeIconPanel"]') .click('*[data-id="remixIdeIconPanel"]')
@ -23,7 +23,7 @@ module.exports = {
browser.waitForElementVisible('div[data-id="remixIdeIconPanel"]', 10000) browser.waitForElementVisible('div[data-id="remixIdeIconPanel"]', 10000)
.waitForElementVisible('*[data-id="verticalIconsKinddebugger"]', 7000) .waitForElementVisible('*[data-id="verticalIconsKinddebugger"]', 7000)
.pause(5000) .pause(5000)
.rightClick('[data-id="verticalIconsKinddebugger"]') .rightClickCustom('[data-id="verticalIconsKinddebugger"]')
.click('*[id="menuitemdeactivate"]') .click('*[id="menuitemdeactivate"]')
.click('*[data-id="verticalIconsKindsettings"]') .click('*[data-id="verticalIconsKindsettings"]')
.click('*[data-id="verticalIconsKindpluginManager"]') .click('*[data-id="verticalIconsKindpluginManager"]')

@ -33,7 +33,7 @@ module.exports = {
// WORKSPACE TEMPLATES E2E START // WORKSPACE TEMPLATES E2E START
'Should create Remix default workspace with files': function (browser: NightwatchBrowser) { 'Should create Remix default workspace with files #group1': function (browser: NightwatchBrowser) {
browser browser
.clickLaunchIcon('filePanel') .clickLaunchIcon('filePanel')
.click('*[data-id="workspaceCreate"]') .click('*[data-id="workspaceCreate"]')
@ -44,53 +44,53 @@ module.exports = {
.waitForElementPresent('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') .waitForElementPresent('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok')
.execute(function () { (document.querySelector('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') as HTMLElement).click() }) .execute(function () { (document.querySelector('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') as HTMLElement).click() })
.pause(1000) .pause(1000)
.assert.elementPresent('*[data-id="treeViewLitreeViewItemcontracts"]') .waitForElementVisible('*[data-id="treeViewLitreeViewItemcontracts"]')
.assert.elementPresent('*[data-id="treeViewLitreeViewItemcontracts/1_Storage.sol"]') .waitForElementVisible('*[data-id="treeViewLitreeViewItemcontracts/1_Storage.sol"]')
.assert.elementPresent('*[data-id="treeViewLitreeViewItemcontracts/2_Owner.sol"]') .waitForElementVisible('*[data-id="treeViewLitreeViewItemcontracts/2_Owner.sol"]')
.assert.elementPresent('*[data-id="treeViewLitreeViewItemcontracts/3_Ballot.sol"]') .waitForElementVisible('*[data-id="treeViewLitreeViewItemcontracts/3_Ballot.sol"]')
.assert.elementPresent('*[data-id="treeViewLitreeViewItemscripts"]') .waitForElementVisible('*[data-id="treeViewLitreeViewItemscripts"]')
.assert.elementPresent('*[data-id="treeViewLitreeViewItemscripts/deploy_with_web3.ts"]') .waitForElementVisible('*[data-id="treeViewLitreeViewItemscripts/deploy_with_web3.ts"]')
// check js and ts files are not transformed // check js and ts files are not transformed
.click('*[data-id="treeViewLitreeViewItemscripts/deploy_with_web3.ts"]') .click('*[data-id="treeViewLitreeViewItemscripts/deploy_with_web3.ts"]')
.getEditorValue((content) => { .getEditorValue((content) => {
browser.assert.ok(content.indexOf(`import { deploy } from './web3-lib'`) !== -1, browser.assert.ok(content.indexOf(`import { deploy } from './web3-lib'`) !== -1,
'Incorrect content') 'Incorrect content')
}) })
.assert.elementPresent('*[data-id="treeViewLitreeViewItemscripts/deploy_with_ethers.ts"]') .waitForElementVisible('*[data-id="treeViewLitreeViewItemscripts/deploy_with_ethers.ts"]')
.click('*[data-id="treeViewLitreeViewItemscripts/deploy_with_ethers.ts"]') .click('*[data-id="treeViewLitreeViewItemscripts/deploy_with_ethers.ts"]')
.pause(100) .pause(100)
.getEditorValue((content) => { .getEditorValue((content) => {
browser.assert.ok(content.indexOf(`import { deploy } from './ethers-lib'`) !== -1, browser.assert.ok(content.indexOf(`import { deploy } from './ethers-lib'`) !== -1,
'Incorrect content') 'Incorrect content')
}) })
.assert.elementPresent('*[data-id="treeViewLitreeViewItemscripts/web3-lib.ts"]') .waitForElementVisible('*[data-id="treeViewLitreeViewItemscripts/web3-lib.ts"]')
.click('*[data-id="treeViewLitreeViewItemscripts/web3-lib.ts"]') .click('*[data-id="treeViewLitreeViewItemscripts/web3-lib.ts"]')
.pause(2000) .pause(2000)
.getEditorValue((content) => { .getEditorValue((content) => {
browser.assert.ok(content.indexOf(`export const deploy = async (contractName: string, args: Array<any>, from?: string, gas?: number): Promise<Options> => {`) !== -1, browser.assert.ok(content.indexOf(`export const deploy = async (contractName: string, args: Array<any>, from?: string, gas?: number): Promise<Options> => {`) !== -1,
'Incorrect content') 'Incorrect content')
}) })
.assert.elementPresent('*[data-id="treeViewLitreeViewItemscripts/ethers-lib.ts"]') .waitForElementVisible('*[data-id="treeViewLitreeViewItemscripts/ethers-lib.ts"]')
.click('*[data-id="treeViewLitreeViewItemscripts/ethers-lib.ts"]') .click('*[data-id="treeViewLitreeViewItemscripts/ethers-lib.ts"]')
.pause(100) .pause(100)
.getEditorValue((content) => { .getEditorValue((content) => {
browser.assert.ok(content.indexOf(`export const deploy = async (contractName: string, args: Array<any>, accountIndex?: number): Promise<ethers.Contract> => {`) !== -1, browser.assert.ok(content.indexOf(`export const deploy = async (contractName: string, args: Array<any>, accountIndex?: number): Promise<ethers.Contract> => {`) !== -1,
'Incorrect content') 'Incorrect content')
}) })
.assert.elementPresent('*[data-id="treeViewLitreeViewItemtests"]') .waitForElementVisible('*[data-id="treeViewLitreeViewItemtests"]')
.assert.elementPresent('*[data-id="treeViewLitreeViewItemtests/storage.test.js"]') .waitForElementVisible('*[data-id="treeViewLitreeViewItemtests/storage.test.js"]')
.click('*[data-id="treeViewLitreeViewItemtests/storage.test.js"]') .click('*[data-id="treeViewLitreeViewItemtests/storage.test.js"]')
.pause(100) .pause(100)
.getEditorValue((content) => { .getEditorValue((content) => {
browser.assert.ok(content.indexOf(`const { expect } = require("chai");`) !== -1, browser.assert.ok(content.indexOf(`const { expect } = require("chai");`) !== -1,
'Incorrect content') 'Incorrect content')
}) })
.assert.elementPresent('*[data-id="treeViewLitreeViewItemtests/Ballot_test.sol"]') .waitForElementVisible('*[data-id="treeViewLitreeViewItemtests/Ballot_test.sol"]')
.assert.elementPresent('*[data-id="treeViewLitreeViewItemREADME.txt"]') .waitForElementVisible('*[data-id="treeViewLitreeViewItemREADME.txt"]')
}, },
'Should create blank workspace with no files': function (browser: NightwatchBrowser) { 'Should create blank workspace with no files #group1': function (browser: NightwatchBrowser) {
browser browser
.click('*[data-id="workspaceCreate"]') .click('*[data-id="workspaceCreate"]')
.waitForElementVisible('*[data-id="modalDialogCustomPromptTextCreate"]') .waitForElementVisible('*[data-id="modalDialogCustomPromptTextCreate"]')
@ -102,16 +102,16 @@ module.exports = {
.waitForElementPresent('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') .waitForElementPresent('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok')
.execute(function () { (document.querySelector('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') as HTMLElement).click() }) .execute(function () { (document.querySelector('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') as HTMLElement).click() })
.pause(100) .pause(100)
.assert.elementPresent('*[data-id="treeViewUltreeViewMenu"]') .waitForElementPresent('*[data-id="treeViewUltreeViewMenu"]')
.execute(function () { .execute(function () {
const fileList = document.querySelector('*[data-id="treeViewUltreeViewMenu"]') const fileList = document.querySelector('*[data-id="treeViewUltreeViewMenu"]')
return fileList.getElementsByTagName('li').length; return fileList.getElementsByTagName('li').length;
}, [], function(result){ }, [], function (result) {
browser.assert.equal(result.value, 0, 'Incorrect number of files'); browser.assert.equal(result.value, 0, 'Incorrect number of files');
}); });
}, },
'Should create ERC20 workspace with files': function (browser: NightwatchBrowser) { 'Should create ERC20 workspace with files #group1': function (browser: NightwatchBrowser) {
browser browser
.click('*[data-id="workspaceCreate"]') .click('*[data-id="workspaceCreate"]')
.waitForElementVisible('*[data-id="modalDialogCustomPromptTextCreate"]') .waitForElementVisible('*[data-id="modalDialogCustomPromptTextCreate"]')
@ -123,43 +123,43 @@ module.exports = {
.waitForElementPresent('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') .waitForElementPresent('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok')
.execute(function () { (document.querySelector('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') as HTMLElement).click() }) .execute(function () { (document.querySelector('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') as HTMLElement).click() })
.pause(100) .pause(100)
.assert.elementPresent('*[data-id="treeViewLitreeViewItemcontracts"]') .waitForElementVisible('*[data-id="treeViewLitreeViewItemcontracts"]')
.assert.elementPresent('*[data-id="treeViewLitreeViewItemcontracts/SampleERC20.sol"]') .waitForElementVisible('*[data-id="treeViewLitreeViewItemcontracts/SampleERC20.sol"]')
.assert.elementPresent('*[data-id="treeViewLitreeViewItemscripts"]') .waitForElementVisible('*[data-id="treeViewLitreeViewItemscripts"]')
.assert.elementPresent('*[data-id="treeViewLitreeViewItemscripts/deploy_with_web3.ts"]') .waitForElementVisible('*[data-id="treeViewLitreeViewItemscripts/deploy_with_web3.ts"]')
// check js and ts files are not transformed // check js and ts files are not transformed
.click('*[data-id="treeViewLitreeViewItemscripts/deploy_with_web3.ts"]') .click('*[data-id="treeViewLitreeViewItemscripts/deploy_with_web3.ts"]')
.pause(5000)
.getEditorValue((content) => { .getEditorValue((content) => {
browser.assert.ok(content.indexOf(`import { deploy } from './web3-lib'`) !== -1, browser.assert.ok(content.indexOf(`import { deploy } from './web3-lib'`) !== -1,
'Incorrect content') 'Incorrect content')
}) })
.assert.elementPresent('*[data-id="treeViewLitreeViewItemscripts/deploy_with_ethers.ts"]') .waitForElementVisible('*[data-id="treeViewLitreeViewItemscripts/deploy_with_ethers.ts"]')
.click('*[data-id="treeViewLitreeViewItemscripts/deploy_with_ethers.ts"]') .click('*[data-id="treeViewLitreeViewItemscripts/deploy_with_ethers.ts"]')
.pause(100) .pause(4000)
.getEditorValue((content) => { .getEditorValue((content) => {
browser.assert.ok(content.indexOf(`import { deploy } from './ethers-lib'`) !== -1, browser.assert.ok(content.indexOf(`import { deploy } from './ethers-lib'`) !== -1,
'Incorrect content') 'Incorrect content')
}) })
.assert.elementPresent('*[data-id="treeViewLitreeViewItemscripts/web3-lib.ts"]') .waitForElementVisible('*[data-id="treeViewLitreeViewItemscripts/web3-lib.ts"]')
.click('*[data-id="treeViewLitreeViewItemscripts/web3-lib.ts"]') .click('*[data-id="treeViewLitreeViewItemscripts/web3-lib.ts"]')
.pause(100) .pause(4000)
.getEditorValue((content) => { .getEditorValue((content) => {
browser.assert.ok(content.indexOf(`export const deploy = async (contractName: string, args: Array<any>, from?: string, gas?: number): Promise<Options> => {`) !== -1, browser.assert.ok(content.indexOf(`export const deploy = async (contractName: string, args: Array<any>, from?: string, gas?: number): Promise<Options> => {`) !== -1,
'Incorrect content') 'Incorrect content')
}) })
.assert.elementPresent('*[data-id="treeViewLitreeViewItemscripts/ethers-lib.ts"]') .waitForElementVisible('*[data-id="treeViewLitreeViewItemscripts/ethers-lib.ts"]')
.click('*[data-id="treeViewLitreeViewItemscripts/ethers-lib.ts"]') .click('*[data-id="treeViewLitreeViewItemscripts/ethers-lib.ts"]')
.pause(100) .pause(4000)
.getEditorValue((content) => { .getEditorValue((content) => {
browser.assert.ok(content.indexOf(`export const deploy = async (contractName: string, args: Array<any>, accountIndex?: number): Promise<ethers.Contract> => {`) !== -1, browser.assert.ok(content.indexOf(`export const deploy = async (contractName: string, args: Array<any>, accountIndex?: number): Promise<ethers.Contract> => {`) !== -1,
'Incorrect content') 'Incorrect content')
}) })
.assert.elementPresent('*[data-id="treeViewLitreeViewItemtests"]') .waitForElementVisible('*[data-id="treeViewLitreeViewItemtests"]')
.assert.elementPresent('*[data-id="treeViewLitreeViewItemtests/SampleERC20_test.sol"]') .waitForElementVisible('*[data-id="treeViewLitreeViewItemtests/SampleERC20_test.sol"]')
}, },
'Should create ERC721 workspace with files': function (browser: NightwatchBrowser) { 'Should create ERC721 workspace with files #group1': function (browser: NightwatchBrowser) {
browser browser
.click('*[data-id="workspaceCreate"]') .click('*[data-id="workspaceCreate"]')
.waitForElementVisible('*[data-id="modalDialogCustomPromptTextCreate"]') .waitForElementVisible('*[data-id="modalDialogCustomPromptTextCreate"]')
@ -171,72 +171,70 @@ module.exports = {
.waitForElementPresent('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') .waitForElementPresent('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok')
.execute(function () { (document.querySelector('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') as HTMLElement).click() }) .execute(function () { (document.querySelector('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') as HTMLElement).click() })
.pause(100) .pause(100)
.assert.elementPresent('*[data-id="treeViewLitreeViewItemcontracts"]') .waitForElementVisible('*[data-id="treeViewLitreeViewItemcontracts"]')
.assert.elementPresent('*[data-id="treeViewLitreeViewItemcontracts/SampleERC721.sol"]') .waitForElementVisible('*[data-id="treeViewLitreeViewItemcontracts/SampleERC721.sol"]')
.assert.elementPresent('*[data-id="treeViewLitreeViewItemscripts"]') .waitForElementVisible('*[data-id="treeViewLitreeViewItemscripts"]')
.assert.elementPresent('*[data-id="treeViewLitreeViewItemscripts/deploy_with_web3.ts"]') .waitForElementVisible('*[data-id="treeViewLitreeViewItemscripts/deploy_with_web3.ts"]')
// check js and ts files are not transformed // check js and ts files are not transformed
.click('*[data-id="treeViewLitreeViewItemscripts/deploy_with_web3.ts"]') .click('*[data-id="treeViewLitreeViewItemscripts/deploy_with_web3.ts"]')
.pause(4000)
.getEditorValue((content) => { .getEditorValue((content) => {
browser.assert.ok(content.indexOf(`import { deploy } from './web3-lib'`) !== -1, browser.assert.ok(content.indexOf(`import { deploy } from './web3-lib'`) !== -1,
'Incorrect content') 'Incorrect content')
}) })
.assert.elementPresent('*[data-id="treeViewLitreeViewItemscripts/deploy_with_ethers.ts"]') .waitForElementVisible('*[data-id="treeViewLitreeViewItemscripts/deploy_with_ethers.ts"]')
.click('*[data-id="treeViewLitreeViewItemscripts/deploy_with_ethers.ts"]') .click('*[data-id="treeViewLitreeViewItemscripts/deploy_with_ethers.ts"]')
.pause(100) .pause(4000)
.getEditorValue((content) => { .getEditorValue((content) => {
browser.assert.ok(content.indexOf(`import { deploy } from './ethers-lib'`) !== -1, browser.assert.ok(content.indexOf(`import { deploy } from './ethers-lib'`) !== -1,
'Incorrect content') 'Incorrect content')
}) })
.assert.elementPresent('*[data-id="treeViewLitreeViewItemscripts/web3-lib.ts"]') .waitForElementVisible('*[data-id="treeViewLitreeViewItemscripts/web3-lib.ts"]')
.click('*[data-id="treeViewLitreeViewItemscripts/web3-lib.ts"]') .click('*[data-id="treeViewLitreeViewItemscripts/web3-lib.ts"]')
.pause(100) .pause(4000)
.getEditorValue((content) => { .getEditorValue((content) => {
browser.assert.ok(content.indexOf(`export const deploy = async (contractName: string, args: Array<any>, from?: string, gas?: number): Promise<Options> => {`) !== -1, browser.assert.ok(content.indexOf(`export const deploy = async (contractName: string, args: Array<any>, from?: string, gas?: number): Promise<Options> => {`) !== -1,
'Incorrect content') 'Incorrect content')
}) })
.assert.elementPresent('*[data-id="treeViewLitreeViewItemscripts/ethers-lib.ts"]') .waitForElementVisible('*[data-id="treeViewLitreeViewItemscripts/ethers-lib.ts"]')
.click('*[data-id="treeViewLitreeViewItemscripts/ethers-lib.ts"]') .click('*[data-id="treeViewLitreeViewItemscripts/ethers-lib.ts"]')
.pause(100) .pause(4000)
.getEditorValue((content) => { .getEditorValue((content) => {
browser.assert.ok(content.indexOf(`export const deploy = async (contractName: string, args: Array<any>, accountIndex?: number): Promise<ethers.Contract> => {`) !== -1, browser.assert.ok(content.indexOf(`export const deploy = async (contractName: string, args: Array<any>, accountIndex?: number): Promise<ethers.Contract> => {`) !== -1,
'Incorrect content') 'Incorrect content')
}) })
.assert.elementPresent('*[data-id="treeViewLitreeViewItemtests"]') .waitForElementVisible('*[data-id="treeViewLitreeViewItemtests"]')
.assert.elementPresent('*[data-id="treeViewLitreeViewItemtests/SampleERC721_test.sol"]') .waitForElementVisible('*[data-id="treeViewLitreeViewItemtests/SampleERC721_test.sol"]')
}, },
// WORKSPACE TEMPLATES E2E END // WORKSPACE TEMPLATES E2E END
'Should create two workspace and switch to the first one': function (browser: NightwatchBrowser) { 'Should create two workspace and switch to the first one #group1': function (browser: NightwatchBrowser) {
browser browser
.click('*[data-id="workspaceCreate"]') // create workspace_name .click('*[data-id="workspaceCreate"]')
.waitForElementVisible('*[data-id="modalDialogCustomPromptTextCreate"]') .waitForElementVisible('*[data-id="modalDialogCustomPromptTextCreate"]')
.waitForElementVisible('[data-id="fileSystemModalDialogModalFooter-react"] > button') .click('*[data-id="fileSystemModalDialogContainer-react"] input[data-id="modalDialogCustomPromptTextCreate"]')
.click('*[data-id="modalDialogCustomPromptTextCreate"]') .setValue('*[data-id="fileSystemModalDialogContainer-react"] input[data-id="modalDialogCustomPromptTextCreate"]', 'workspace_name')
.clearValue('*[data-id="modalDialogCustomPromptTextCreate"]')
.setValue('*[data-id="modalDialogCustomPromptTextCreate"]', 'workspace_name')
.waitForElementPresent('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') .waitForElementPresent('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok')
.click('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') .click('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok')
.waitForElementVisible('*[data-id="treeViewLitreeViewItemtests"]') .waitForElementVisible('*[data-id="treeViewLitreeViewItemtests"]')
.pause(1000) .pause(1000)
.addFile('test.sol', { content: 'test' }) .addFile('test.sol', { content: 'test' })
.waitForElementVisible('*[data-id="treeViewLitreeViewItemtest.sol"]') .waitForElementVisible('*[data-id="treeViewLitreeViewItemtest.sol"]')
.click('*[data-id="workspaceCreate"]') // create workspace_name_1 .click('*[data-id="workspaceCreate"]')
.waitForElementVisible('*[data-id="modalDialogCustomPromptTextCreate"]') .waitForElementVisible('*[data-id="modalDialogCustomPromptTextCreate"]')
.waitForElementVisible('[data-id="fileSystemModalDialogModalFooter-react"] > button') .click('*[data-id="fileSystemModalDialogContainer-react"] input[data-id="modalDialogCustomPromptTextCreate"]')
.click('*[data-id="modalDialogCustomPromptTextCreate"]') .setValue('*[data-id="fileSystemModalDialogContainer-react"] input[data-id="modalDialogCustomPromptTextCreate"]', 'workspace_name_1')
.clearValue('*[data-id="modalDialogCustomPromptTextCreate"]')
.setValue('*[data-id="modalDialogCustomPromptTextCreate"]', 'workspace_name_1')
.waitForElementPresent('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') .waitForElementPresent('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok')
.click('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') .click('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok')
.pause(2000)
.waitForElementVisible('*[data-id="treeViewLitreeViewItemtests"]') .waitForElementVisible('*[data-id="treeViewLitreeViewItemtests"]')
.pause(2000) .pause(2000)
.waitForElementNotPresent('*[data-id="treeViewLitreeViewItemtest.sol"]') .waitForElementNotPresent('*[data-id="treeViewLitreeViewItemtest.sol"]')
.pause(2000) .pause(2000)
.switchWorkspace('workspace_name') .switchWorkspace('workspace_name')
.waitForElementVisible('*[data-id="treeViewLitreeViewItemtests"]') .waitForElementVisible('*[data-id="treeViewLitreeViewItemtests"]')
.currentWorkspaceIs('workspace_name')
}, },
'Should rename a workspace #group1': function (browser: NightwatchBrowser) { 'Should rename a workspace #group1': function (browser: NightwatchBrowser) {
@ -251,9 +249,11 @@ module.exports = {
.click('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') .click('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok')
.switchWorkspace('workspace_name_1') .switchWorkspace('workspace_name_1')
.pause(2000) .pause(2000)
.currentWorkspaceIs('workspace_name_1')
.waitForElementNotPresent('*[data-id="treeViewLitreeViewItemtest.sol"]') .waitForElementNotPresent('*[data-id="treeViewLitreeViewItemtest.sol"]')
.switchWorkspace('workspace_name_renamed') .switchWorkspace('workspace_name_renamed')
.pause(2000) .pause(2000)
.currentWorkspaceIs('workspace_name_renamed')
.waitForElementVisible('*[data-id="treeViewLitreeViewItemtest.sol"]') .waitForElementVisible('*[data-id="treeViewLitreeViewItemtest.sol"]')
}, },
@ -268,84 +268,85 @@ module.exports = {
.waitForElementNotPresent(`[data-id="dropdown-item-workspace_name_1"]`) .waitForElementNotPresent(`[data-id="dropdown-item-workspace_name_1"]`)
}, },
// CLONE REPOSITORY E2E START // CLONE REPOSITORY E2E START
'Should clone a repository #group2': function (browser: NightwatchBrowser) {
browser
.clickLaunchIcon('filePanel')
.waitForElementVisible('[data-id="cloneGitRepository"]')
.click('[data-id="cloneGitRepository"]')
.waitForElementVisible('[data-id="fileSystemModalDialogModalBody-react"]')
.click('[data-id="fileSystemModalDialogModalBody-react"]')
.waitForElementVisible('[data-id="modalDialogCustomPromptTextClone"]')
.setValue('[data-id="modalDialogCustomPromptTextClone"]', 'https://github.com/ethereum/awesome-remix')
.click('[data-id="fileSystem-modal-footer-ok-react"]')
.waitForElementPresent('.fa-spinner')
.pause(5000)
.waitForElementNotPresent('.fa-spinner')
.waitForElementVisible('*[data-id="treeViewLitreeViewItem.git"]')
.waitForElementContainsText('[data-id="workspacesSelect"]', 'awesome-remix')
},
'Should clone a repository #group2': function (browser: NightwatchBrowser) { 'Should display dgit icon for cloned workspace #group2': function (browser: NightwatchBrowser) {
browser browser
.waitForElementVisible('[data-id="cloneGitRepository"]') .switchWorkspace('default_workspace')
.click('[data-id="cloneGitRepository"]') .waitForElementNotVisible('[data-id="workspacesSelect"] .fa-code-branch')
.waitForElementVisible('[data-id="fileSystemModalDialogModalBody-react"]') .switchWorkspace('awesome-remix')
.click('[data-id="fileSystemModalDialogModalBody-react"]') .waitForElementVisible('[data-id="workspacesSelect"] .fa-code-branch')
.waitForElementVisible('[data-id="modalDialogCustomPromptTextClone"]') },
.setValue('[data-id="modalDialogCustomPromptTextClone"]', 'https://github.com/ethereum/awesome-remix')
.click('[data-id="fileSystem-modal-footer-ok-react"]')
.waitForElementPresent('.fa-spinner')
.pause(5000)
.waitForElementNotPresent('.fa-spinner')
.waitForElementVisible('*[data-id="treeViewLitreeViewItem.git"]')
.waitForElementContainsText('[data-id="workspacesSelect"]', 'awesome-remix')
},
'Should display dgit icon for cloned workspace #group2': function (browser: NightwatchBrowser) { 'Should display non-clashing names for duplicate clone #group2': '' + function (browser: NightwatchBrowser) {
browser browser
.switchWorkspace('default_workspace') .waitForElementVisible('[data-id="cloneGitRepository"]')
.waitForElementNotVisible('[data-id="workspacesSelect"] .fa-code-branch') .click('[data-id="cloneGitRepository"]')
.switchWorkspace('awesome-remix') .waitForElementVisible('[data-id="fileSystemModalDialogModalBody-react"]')
.waitForElementVisible('[data-id="workspacesSelect"] .fa-code-branch') .click('[data-id="fileSystemModalDialogModalBody-react"]')
}, .waitForElementVisible('[data-id="modalDialogCustomPromptTextClone"]')
.setValue('[data-id="modalDialogCustomPromptTextClone"]', 'https://github.com/ethereum/awesome-remix')
'Should display non-clashing names for duplicate clone #group2': '' + function (browser: NightwatchBrowser) { .click('[data-id="fileSystem-modal-footer-ok-react"]')
browser .pause(5000)
.waitForElementVisible('[data-id="cloneGitRepository"]') .waitForElementContainsText('[data-id="workspacesSelect"]', 'awesome-remix1')
.click('[data-id="cloneGitRepository"]') .waitForElementVisible('[data-id="cloneGitRepository"]')
.waitForElementVisible('[data-id="fileSystemModalDialogModalBody-react"]') .click('[data-id="cloneGitRepository"]')
.click('[data-id="fileSystemModalDialogModalBody-react"]') .waitForElementVisible('[data-id="fileSystemModalDialogModalBody-react"]')
.waitForElementVisible('[data-id="modalDialogCustomPromptTextClone"]') .click('[data-id="fileSystemModalDialogModalBody-react"]')
.setValue('[data-id="modalDialogCustomPromptTextClone"]', 'https://github.com/ethereum/awesome-remix') .waitForElementVisible('[data-id="modalDialogCustomPromptTextClone"]')
.click('[data-id="fileSystem-modal-footer-ok-react"]') .setValue('[data-id="modalDialogCustomPromptTextClone"]', 'https://github.com/ethereum/awesome-remix')
.pause(5000) .click('[data-id="fileSystem-modal-footer-ok-react"]')
.waitForElementContainsText('[data-id="workspacesSelect"]', 'awesome-remix1') .pause(5000)
.waitForElementVisible('[data-id="cloneGitRepository"]') .waitForElementContainsText('[data-id="workspacesSelect"]', 'awesome-remix2')
.click('[data-id="cloneGitRepository"]') .waitForElementVisible('[data-id="cloneGitRepository"]')
.waitForElementVisible('[data-id="fileSystemModalDialogModalBody-react"]') .click('[data-id="cloneGitRepository"]')
.click('[data-id="fileSystemModalDialogModalBody-react"]') .waitForElementVisible('[data-id="fileSystemModalDialogModalBody-react"]')
.waitForElementVisible('[data-id="modalDialogCustomPromptTextClone"]') .click('[data-id="fileSystemModalDialogModalBody-react"]')
.setValue('[data-id="modalDialogCustomPromptTextClone"]', 'https://github.com/ethereum/awesome-remix') .waitForElementVisible('[data-id="modalDialogCustomPromptTextClone"]')
.click('[data-id="fileSystem-modal-footer-ok-react"]') .setValue('[data-id="modalDialogCustomPromptTextClone"]', 'https://github.com/ethereum/awesome-remix')
.pause(5000) .click('[data-id="fileSystem-modal-footer-ok-react"]')
.waitForElementContainsText('[data-id="workspacesSelect"]', 'awesome-remix2') .pause(5000)
.waitForElementVisible('[data-id="cloneGitRepository"]') .waitForElementContainsText('[data-id="workspacesSelect"]', 'awesome-remix3')
.click('[data-id="cloneGitRepository"]') .switchWorkspace('awesome-remix')
.waitForElementVisible('[data-id="fileSystemModalDialogModalBody-react"]') .switchWorkspace('awesome-remix1')
.click('[data-id="fileSystemModalDialogModalBody-react"]') .switchWorkspace('awesome-remix2')
.waitForElementVisible('[data-id="modalDialogCustomPromptTextClone"]') .switchWorkspace('awesome-remix3')
.setValue('[data-id="modalDialogCustomPromptTextClone"]', 'https://github.com/ethereum/awesome-remix') },
.click('[data-id="fileSystem-modal-footer-ok-react"]')
.pause(5000)
.waitForElementContainsText('[data-id="workspacesSelect"]', 'awesome-remix3')
.switchWorkspace('awesome-remix')
.switchWorkspace('awesome-remix1')
.switchWorkspace('awesome-remix2')
.switchWorkspace('awesome-remix3')
},
'Should display error message in modal for failed clone #group2': function (browser: NightwatchBrowser) { 'Should display error message in modal for failed clone #group2': function (browser: NightwatchBrowser) {
browser browser
.waitForElementVisible('[data-id="cloneGitRepository"]') .waitForElementVisible('[data-id="cloneGitRepository"]')
.click('[data-id="cloneGitRepository"]') .click('[data-id="cloneGitRepository"]')
.waitForElementVisible('[data-id="fileSystemModalDialogModalBody-react"]') .waitForElementVisible('[data-id="fileSystemModalDialogModalBody-react"]')
.click('[data-id="fileSystemModalDialogModalBody-react"]') .click('[data-id="fileSystemModalDialogModalBody-react"]')
.waitForElementVisible('[data-id="modalDialogCustomPromptTextClone"]') .waitForElementVisible('[data-id="modalDialogCustomPromptTextClone"]')
.setValue('[data-id="modalDialogCustomPromptTextClone"]', 'https://github.com/ethereum/non-existent-repo') .setValue('[data-id="modalDialogCustomPromptTextClone"]', 'https://github.com/ethereum/non-existent-repo')
.click('[data-id="fileSystem-modal-footer-ok-react"]') .click('[data-id="fileSystem-modal-footer-ok-react"]')
.pause(5000) .pause(5000)
.waitForElementVisible('[data-id="cloneGitRepositoryModalDialogModalBody-react"]') .waitForElementVisible('[data-id="cloneGitRepositoryModalDialogModalBody-react"]')
.waitForElementContainsText('[data-id="cloneGitRepositoryModalDialogModalBody-react"]', 'An error occurred: Please check that you have the correct URL for the repo. If the repo is private, you need to add your github credentials (with the valid token permissions) in Settings plugin') .waitForElementContainsText('[data-id="cloneGitRepositoryModalDialogModalBody-react"]', 'An error occurred: Please check that you have the correct URL for the repo. If the repo is private, you need to add your github credentials (with the valid token permissions) in Settings plugin')
.click('[data-id="cloneGitRepository-modal-footer-ok-react"]') .click('[data-id="cloneGitRepository-modal-footer-ok-react"]')
.end() .end()
}, },
// CLONE REPOSITORY E2E END // CLONE REPOSITORY E2E END
tearDown: sauce tearDown: sauce
} }

@ -21,14 +21,14 @@ declare module 'nightwatch' {
modalFooterOKClick(id?: string): NightwatchBrowser, modalFooterOKClick(id?: string): NightwatchBrowser,
clickInstance(index: number): NightwatchBrowser, clickInstance(index: number): NightwatchBrowser,
journalLastChildIncludes(val: string): NightwatchBrowser, journalLastChildIncludes(val: string): NightwatchBrowser,
executeScript(script: string): NightwatchBrowser, executeScriptInTerminal(script: string): NightwatchBrowser,
clearEditableContent(cssSelector: string): NightwatchBrowser, clearEditableContent(cssSelector: string): NightwatchBrowser,
journalChildIncludes(val: string, opts = { shouldHaveOnlyOneOccurence: boolean }): NightwatchBrowser, journalChildIncludes(val: string, opts = { shouldHaveOnlyOneOccurence: boolean }): NightwatchBrowser,
debugTransaction(index: number): NightwatchBrowser, debugTransaction(index: number): NightwatchBrowser,
checkElementStyle(cssSelector: string, styleProperty: string, expectedResult: string): NightwatchBrowser, checkElementStyle(cssSelector: string, styleProperty: string, expectedResult: string): NightwatchBrowser,
openFile(name: string): NightwatchBrowser, openFile(name: string): NightwatchBrowser,
renamePath(path: string, newFileName: string, renamedPath: string): NightwatchBrowser, renamePath(path: string, newFileName: string, renamedPath: string): NightwatchBrowser,
rightClick(cssSelector: string): NightwatchBrowser, rightClickCustom(cssSelector: string): NightwatchBrowser,
scrollToLine(line: number): NightwatchBrowser, scrollToLine(line: number): NightwatchBrowser,
waitForElementContainsText(id: string, value: string, timeout?: number): NightwatchBrowser, waitForElementContainsText(id: string, value: string, timeout?: number): NightwatchBrowser,
getModalBody(callback: (value: string, cb: VoidFunction) => void): NightwatchBrowser, getModalBody(callback: (value: string, cb: VoidFunction) => void): NightwatchBrowser,

@ -14,8 +14,7 @@ yarn run remixd &
sleep 5 sleep 5
yarn run build:e2e yarn run build:e2e
TESTFILES=$(grep -IRiL "@disabled" "dist/apps/remix-ide-e2e/src/tests" | grep "\.spec\|\.test" | sort | circleci tests split )
TESTFILES=$(grep -IRiL "\'@disabled\': \?true" "dist/apps/remix-ide-e2e/src/tests" | grep "\.spec\|\.test" | sort | circleci tests split )
for TESTFILE in $TESTFILES; do for TESTFILE in $TESTFILES; do
npx nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js $TESTFILE --env=$1 || TEST_EXITCODE=1 npx nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js $TESTFILE --env=$1 || TEST_EXITCODE=1
done done

@ -153,7 +153,7 @@
"@ethereumjs/vm": "^5.5.3", "@ethereumjs/vm": "^5.5.3",
"@ethersphere/bee-js": "^3.2.0", "@ethersphere/bee-js": "^3.2.0",
"@isomorphic-git/lightning-fs": "^4.4.1", "@isomorphic-git/lightning-fs": "^4.4.1",
"@monaco-editor/react": "^4.3.1", "@monaco-editor/react": "4.4.5",
"@remixproject/engine": "^0.3.31", "@remixproject/engine": "^0.3.31",
"@remixproject/engine-web": "^0.3.31", "@remixproject/engine-web": "^0.3.31",
"@remixproject/plugin": "^0.3.31", "@remixproject/plugin": "^0.3.31",
@ -161,6 +161,7 @@
"@remixproject/plugin-utils": "^0.3.31", "@remixproject/plugin-utils": "^0.3.31",
"@remixproject/plugin-webview": "^0.3.31", "@remixproject/plugin-webview": "^0.3.31",
"@remixproject/plugin-ws": "^0.3.31", "@remixproject/plugin-ws": "^0.3.31",
"@types/nightwatch": "^2.3.1",
"ansi-gray": "^0.1.1", "ansi-gray": "^0.1.1",
"async": "^2.6.2", "async": "^2.6.2",
"axios": ">=0.26.0", "axios": ">=0.26.0",
@ -245,7 +246,6 @@
"@types/jest": "^27.0.2", "@types/jest": "^27.0.2",
"@types/lodash": "^4.14.172", "@types/lodash": "^4.14.172",
"@types/mocha": "^7.0.2", "@types/mocha": "^7.0.2",
"@types/nightwatch": "1.3.4",
"@types/node": "~8.9.4", "@types/node": "~8.9.4",
"@types/react": "^17.0.24", "@types/react": "^17.0.24",
"@types/react-beautiful-dnd": "^13.1.2", "@types/react-beautiful-dnd": "^13.1.2",
@ -307,7 +307,7 @@
"mkdirp": "^0.5.1", "mkdirp": "^0.5.1",
"mocha": "^8.0.1", "mocha": "^8.0.1",
"nanohtml": "^1.6.3", "nanohtml": "^1.6.3",
"nightwatch": "^1.7.11", "nightwatch": "^2.3",
"nodemon": "^2.0.4", "nodemon": "^2.0.4",
"notify-error": "^1.2.0", "notify-error": "^1.2.0",
"npm-link-local": "^1.1.0", "npm-link-local": "^1.1.0",

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save