Fixed remix-ide-e2e linting errors

pull/859/head
ioedeveloper 4 years ago
parent 8790f3949f
commit 3c96778d89
  1. 6
      .circleci/config.yml
  2. 4
      apps/remix-ide-e2e/.eslintrc
  3. 100
      apps/remix-ide-e2e/nightwatch.ts
  4. 2
      apps/remix-ide-e2e/src/commands/addAtAddressInstance.ts
  5. 2
      apps/remix-ide-e2e/src/commands/addFile.ts
  6. 2
      apps/remix-ide-e2e/src/commands/checkVariableDebug.ts
  7. 2
      apps/remix-ide-e2e/src/commands/clickFunction.ts
  8. 2
      apps/remix-ide-e2e/src/commands/clickInstance.ts
  9. 4
      apps/remix-ide-e2e/src/commands/clickLaunchIcon.ts
  10. 4
      apps/remix-ide-e2e/src/commands/createContract.ts
  11. 4
      apps/remix-ide-e2e/src/commands/debugTransaction.ts
  12. 4
      apps/remix-ide-e2e/src/commands/editorScroll.ts
  13. 4
      apps/remix-ide-e2e/src/commands/executeScript.ts
  14. 4
      apps/remix-ide-e2e/src/commands/getAddressAtPosition.ts
  15. 4
      apps/remix-ide-e2e/src/commands/getEditorValue.ts
  16. 6
      apps/remix-ide-e2e/src/commands/getInstalledPlugins.ts
  17. 4
      apps/remix-ide-e2e/src/commands/getModalBody.ts
  18. 4
      apps/remix-ide-e2e/src/commands/goToVMTraceStep.ts
  19. 2
      apps/remix-ide-e2e/src/commands/journalChildIncludes.ts
  20. 2
      apps/remix-ide-e2e/src/commands/journalLastChild.ts
  21. 2
      apps/remix-ide-e2e/src/commands/journalLastChildIncludes.ts
  22. 2
      apps/remix-ide-e2e/src/commands/modalFooterCancelClick.ts
  23. 4
      apps/remix-ide-e2e/src/commands/modalFooterOKClick.ts
  24. 4
      apps/remix-ide-e2e/src/commands/noWorkerErrorFor.ts
  25. 4
      apps/remix-ide-e2e/src/commands/notContainsText.ts
  26. 2
      apps/remix-ide-e2e/src/commands/removeFile.ts
  27. 2
      apps/remix-ide-e2e/src/commands/scrollAndClick.ts
  28. 4
      apps/remix-ide-e2e/src/commands/scrollInto.ts
  29. 2
      apps/remix-ide-e2e/src/commands/selectAccount.ts
  30. 2
      apps/remix-ide-e2e/src/commands/selectContract.ts
  31. 2
      apps/remix-ide-e2e/src/commands/sendLowLevelTx.ts
  32. 2
      apps/remix-ide-e2e/src/commands/setupMetamask.ts
  33. 2
      apps/remix-ide-e2e/src/commands/signMessage.ts
  34. 4
      apps/remix-ide-e2e/src/commands/switchBrowserTab.ts
  35. 2
      apps/remix-ide-e2e/src/commands/switchBrowserWindow.ts
  36. 4
      apps/remix-ide-e2e/src/commands/testConstantFunction.ts
  37. 4
      apps/remix-ide-e2e/src/commands/testContracts.ts
  38. 2
      apps/remix-ide-e2e/src/commands/testEditorValue.ts
  39. 2
      apps/remix-ide-e2e/src/commands/testFunction.ts
  40. 2
      apps/remix-ide-e2e/src/commands/verifyCallReturnValue.ts
  41. 4
      apps/remix-ide-e2e/src/commands/verifyContracts.ts
  42. 2
      apps/remix-ide-e2e/src/examples/example-contracts.ts
  43. 2
      apps/remix-ide-e2e/src/helpers/init.ts
  44. 84
      apps/remix-ide-e2e/src/tests/ballot.test.ts
  45. 11
      apps/remix-ide-e2e/src/tests/ballot_0_4_11.test.ts
  46. 9
      apps/remix-ide-e2e/src/tests/compiler_api.test.ts
  47. 112
      apps/remix-ide-e2e/src/tests/debugger.test.ts
  48. 2
      apps/remix-ide-e2e/src/tests/editor.test.ts
  49. 3
      apps/remix-ide-e2e/src/tests/fileExplorer.test.ts
  50. 22
      apps/remix-ide-e2e/src/tests/fileManager_api.test.ts
  51. 2
      apps/remix-ide-e2e/src/tests/generalSettings.test.ts
  52. 2
      apps/remix-ide-e2e/src/tests/gist.test.ts
  53. 10
      apps/remix-ide-e2e/src/tests/libraryDeployment.test.ts
  54. 2
      apps/remix-ide-e2e/src/tests/pluginManager.test.ts
  55. 2
      apps/remix-ide-e2e/src/tests/publishContract.test.ts
  56. 109
      apps/remix-ide-e2e/src/tests/recorder.test.ts
  57. 16
      apps/remix-ide-e2e/src/tests/remixd.test.ts
  58. 7
      apps/remix-ide-e2e/src/tests/runAndDeploy.ts
  59. 8
      apps/remix-ide-e2e/src/tests/signingMessage.test.ts
  60. 30
      apps/remix-ide-e2e/src/tests/solidityImport.test.ts
  61. 4
      apps/remix-ide-e2e/src/tests/solidityUnittests.test.ts
  62. 12
      apps/remix-ide-e2e/src/tests/specialFunctions.test.ts
  63. 11
      apps/remix-ide-e2e/src/tests/staticAnalysis.test.ts
  64. 21
      apps/remix-ide-e2e/src/tests/terminal.test.ts
  65. 114
      apps/remix-ide-e2e/src/tests/transactionExecution.test.ts
  66. 8
      apps/remix-ide-e2e/src/tests/txListener.test.ts
  67. 4
      apps/remix-ide-e2e/src/tests/url.test.ts
  68. 11
      apps/remix-ide-e2e/src/tests/usingWebWorker.test.ts
  69. 4
      apps/remix-ide-e2e/src/tests/workspace.test.ts

@ -47,7 +47,7 @@ jobs:
- checkout - checkout
- run: npm install - run: npm install
- run: npm run lint - run: npm run lint
# - run: npm run lint remix-ide-e2e - run: npm run lint remix-ide-e2e
- run: npm run build:libs - run: npm run build:libs
- run: npm run build - run: npm run build
- run: - run:
@ -84,7 +84,7 @@ jobs:
- checkout - checkout
- run: npm install - run: npm install
- run: npm run lint - run: npm run lint
# - run: npm run lint remix-ide-e2e - run: npm run lint remix-ide-e2e
- run: npm run build:libs - run: npm run build:libs
- run: npm run build - run: npm run build
- run: - run:
@ -126,7 +126,7 @@ jobs:
- checkout - checkout
- run: npm install - run: npm install
- run: npm run lint - run: npm run lint
# - run: npm run lint remix-ide-e2e - run: npm run lint remix-ide-e2e
- run: npm run build:libs - run: npm run build:libs
- run: npm run build - run: npm run build
- run: - run:

@ -5,7 +5,9 @@
"files": ["**/*.ts"], "files": ["**/*.ts"],
"rules": { "rules": {
"no-undef": "off", "no-undef": "off",
"@typescript-eslint/no-var-requires": 0 "@typescript-eslint/no-var-requires": 0,
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": "error"
} }
} }
], ],

@ -4,79 +4,79 @@ const crxFile = fs.readFileSync('apps/remix-ide-e2e/src/extensions/chrome/metama
const metamaskExtension = Buffer.from(crxFile).toString('base64') const metamaskExtension = Buffer.from(crxFile).toString('base64')
module.exports = { module.exports = {
'src_folders': ['dist/apps/remix-ide-e2e/src/tests'], src_folders: ['dist/apps/remix-ide-e2e/src/tests'],
'output_folder': './reports/tests', output_folder: './reports/tests',
'custom_commands_path': ['dist/apps/remix-ide-e2e/src/commands'], custom_commands_path: ['dist/apps/remix-ide-e2e/src/commands'],
'custom_assertions_path': '', custom_assertions_path: '',
'page_objects_path': '', page_objects_path: '',
'globals_path': '', globals_path: '',
'test_settings': { test_settings: {
'default': { default: {
'selenium_port': 4444, selenium_port: 4444,
'selenium_host': 'localhost', selenium_host: 'localhost',
'globals': { globals: {
'waitForConditionTimeout': 10000, waitForConditionTimeout: 10000,
'asyncHookTimeout': 100000 asyncHookTimeout: 100000
}, },
'screenshots': { screenshots: {
'enabled': true, enabled: true,
'path': './reports/screenshots', path: './reports/screenshots',
'on_failure': true, on_failure: true,
'on_error': true on_error: true
}, },
'desiredCapabilities': { desiredCapabilities: {
'browserName': 'firefox', browserName: 'firefox',
'javascriptEnabled': true, javascriptEnabled: true,
'acceptSslCerts': true acceptSslCerts: true
}, },
'exclude': ['dist/apps/remix-ide-e2e/src/tests/runAndDeploy.js'] exclude: ['dist/apps/remix-ide-e2e/src/tests/runAndDeploy.js']
}, },
'chrome': { chrome: {
'desiredCapabilities': { desiredCapabilities: {
'browserName': 'chrome', browserName: 'chrome',
'javascriptEnabled': true, javascriptEnabled: true,
'acceptSslCerts': true, acceptSslCerts: true,
'goog:chromeOptions': { 'goog:chromeOptions': {
'args': ['window-size=2560,1440', 'start-fullscreen'] args: ['window-size=2560,1440', 'start-fullscreen']
} }
} }
}, },
'chrome-runAndDeploy': { 'chrome-runAndDeploy': {
'desiredCapabilities': { desiredCapabilities: {
'browserName': 'chrome', browserName: 'chrome',
'javascriptEnabled': true, javascriptEnabled: true,
'acceptSslCerts': true, acceptSslCerts: true,
'goog:chromeOptions': { 'goog:chromeOptions': {
'args': ['window-size=2560,1440', 'start-fullscreen'], args: ['window-size=2560,1440', 'start-fullscreen'],
'extensions': [metamaskExtension] extensions: [metamaskExtension]
} }
} }
}, },
'safari': { safari: {
'desiredCapabilities': { desiredCapabilities: {
'browserName': 'safari', browserName: 'safari',
'javascriptEnabled': true, javascriptEnabled: true,
'acceptSslCerts': true acceptSslCerts: true
} }
}, },
'ie': { ie: {
'desiredCapabilities': { desiredCapabilities: {
'browserName': 'internet explorer', browserName: 'internet explorer',
'javascriptEnabled': true, javascriptEnabled: true,
'acceptSslCerts': true acceptSslCerts: true
} }
}, },
'firefox': { firefox: {
'desiredCapabilities': { desiredCapabilities: {
'browserName': 'firefox', browserName: 'firefox',
'javascriptEnabled': true, javascriptEnabled: true,
'acceptSslCerts': true acceptSslCerts: true
} }
} }
} }

@ -1,5 +1,5 @@
import { NightwatchBrowser } from 'nightwatch' import { NightwatchBrowser } from 'nightwatch'
import EventEmitter from "events" import EventEmitter from 'events'
class addAtAddressInstance extends EventEmitter { class addAtAddressInstance extends EventEmitter {
command (this: NightwatchBrowser, address: string, isValidFormat: boolean, isValidChecksum: boolean): NightwatchBrowser { command (this: NightwatchBrowser, address: string, isValidFormat: boolean, isValidChecksum: boolean): NightwatchBrowser {

@ -1,5 +1,5 @@
import { NightwatchBrowser, NightwatchContractContent } from 'nightwatch' import { NightwatchBrowser, NightwatchContractContent } from 'nightwatch'
import EventEmitter from "events" import EventEmitter from 'events'
class AddFile extends EventEmitter { class AddFile extends EventEmitter {
command (this: NightwatchBrowser, name: string, content: NightwatchContractContent): NightwatchBrowser { command (this: NightwatchBrowser, name: string, content: NightwatchContractContent): NightwatchBrowser {

@ -1,5 +1,5 @@
import { NightwatchBrowser, NightwatchCheckVariableDebugValue } from 'nightwatch' import { NightwatchBrowser, NightwatchCheckVariableDebugValue } from 'nightwatch'
import EventEmitter from "events" import EventEmitter from 'events'
const deepequal = require('deep-equal') const deepequal = require('deep-equal')

@ -1,5 +1,5 @@
import { NightwatchBrowser, NightwatchClickFunctionExpectedInput } from 'nightwatch' import { NightwatchBrowser, NightwatchClickFunctionExpectedInput } from 'nightwatch'
import EventEmitter from "events" import EventEmitter from 'events'
class ClickFunction extends EventEmitter { class ClickFunction extends EventEmitter {
command (this: NightwatchBrowser, fnFullName: string, expectedInput?: NightwatchClickFunctionExpectedInput): NightwatchBrowser { command (this: NightwatchBrowser, fnFullName: string, expectedInput?: NightwatchClickFunctionExpectedInput): NightwatchBrowser {

@ -1,5 +1,5 @@
import { NightwatchBrowser } from 'nightwatch' import { NightwatchBrowser } from 'nightwatch'
import EventEmitter from "events" import EventEmitter from 'events'
class ClickInstance extends EventEmitter { class ClickInstance extends EventEmitter {
command (this: NightwatchBrowser, index: number): NightwatchBrowser { command (this: NightwatchBrowser, index: number): NightwatchBrowser {

@ -1,5 +1,5 @@
import { NightwatchBrowser } from "nightwatch" import { NightwatchBrowser } from 'nightwatch'
import EventEmitter from "events" import EventEmitter from 'events'
class ClickLaunchIcon extends EventEmitter { class ClickLaunchIcon extends EventEmitter {
command (this: NightwatchBrowser, icon: string): NightwatchBrowser { command (this: NightwatchBrowser, icon: string): NightwatchBrowser {

@ -1,5 +1,5 @@
import { NightwatchBrowser } from "nightwatch" import { NightwatchBrowser } from 'nightwatch'
import EventEmitter from "events" import EventEmitter from 'events'
class CreateContract extends EventEmitter { class CreateContract extends EventEmitter {
command (this: NightwatchBrowser, inputParams: string): NightwatchBrowser { command (this: NightwatchBrowser, inputParams: string): NightwatchBrowser {

@ -1,5 +1,5 @@
import { NightwatchBrowser } from "nightwatch" import { NightwatchBrowser } from 'nightwatch'
import EventEmitter from "events" import EventEmitter from 'events'
class debugTransaction extends EventEmitter { class debugTransaction extends EventEmitter {
command (this: NightwatchBrowser, index = 0): NightwatchBrowser { command (this: NightwatchBrowser, index = 0): NightwatchBrowser {

@ -1,5 +1,5 @@
import { NightwatchBrowser } from "nightwatch" import { NightwatchBrowser } from 'nightwatch'
import EventEmitter from "events" import EventEmitter from 'events'
// fix for editor scroll // fix for editor scroll
class ScrollEditor extends EventEmitter { class ScrollEditor extends EventEmitter {

@ -1,5 +1,5 @@
import { NightwatchBrowser } from "nightwatch" import { NightwatchBrowser } from 'nightwatch'
import EventEmitter from "events" import EventEmitter from 'events'
class ExecuteScript extends EventEmitter { class ExecuteScript extends EventEmitter {
command (this: NightwatchBrowser, script: string): NightwatchBrowser { command (this: NightwatchBrowser, script: string): NightwatchBrowser {

@ -1,5 +1,5 @@
import { NightwatchBrowser } from "nightwatch" import { NightwatchBrowser } from 'nightwatch'
import EventEmitter from "events" import EventEmitter from 'events'
class GetAddressAtPosition extends EventEmitter { class GetAddressAtPosition extends EventEmitter {
command (this: NightwatchBrowser, index: number, cb: (pos: string) => void): NightwatchBrowser { command (this: NightwatchBrowser, index: number, cb: (pos: string) => void): NightwatchBrowser {

@ -1,5 +1,5 @@
import { NightwatchBrowser } from "nightwatch" import { NightwatchBrowser } from 'nightwatch'
import EventEmitter from "events" import EventEmitter from 'events'
class GetEditorValue extends EventEmitter { class GetEditorValue extends EventEmitter {
command (this: NightwatchBrowser, callback: (content: string) => void): NightwatchBrowser { command (this: NightwatchBrowser, callback: (content: string) => void): NightwatchBrowser {

@ -1,5 +1,5 @@
import { NightwatchBrowser } from "nightwatch" import { NightwatchBrowser } from 'nightwatch'
import EventEmitter from "events" import EventEmitter from 'events'
class GetInstalledPlugins extends EventEmitter { class GetInstalledPlugins extends EventEmitter {
command (this: NightwatchBrowser, cb: (plugins: string[]) => void): NightwatchBrowser { command (this: NightwatchBrowser, cb: (plugins: string[]) => void): NightwatchBrowser {
@ -7,7 +7,7 @@ class GetInstalledPlugins extends EventEmitter {
browser.waitForElementPresent('[plugin]:not([plugin=""]') browser.waitForElementPresent('[plugin]:not([plugin=""]')
.perform((done) => { .perform((done) => {
browser.execute(function() { browser.execute(function () {
const pluginNames = [] const pluginNames = []
const plugins = document.querySelectorAll('[plugin]:not([plugin=""]') const plugins = document.querySelectorAll('[plugin]:not([plugin=""]')

@ -1,5 +1,5 @@
import { NightwatchBrowser } from "nightwatch" import { NightwatchBrowser } from 'nightwatch'
import EventEmitter from "events" import EventEmitter from 'events'
class GetModalBody extends EventEmitter { class GetModalBody extends EventEmitter {
command (this: NightwatchBrowser, callback: (value: string, cb: VoidFunction) => void) { command (this: NightwatchBrowser, callback: (value: string, cb: VoidFunction) => void) {

@ -1,5 +1,5 @@
import { NightwatchBrowser } from 'nightwatch' import { NightwatchBrowser } from 'nightwatch'
import EventEmitter from "events" import EventEmitter from 'events'
class GoToVmTraceStep extends EventEmitter { class GoToVmTraceStep extends EventEmitter {
command (this: NightwatchBrowser, step: number, incr?: number): NightwatchBrowser { command (this: NightwatchBrowser, step: number, incr?: number): NightwatchBrowser {
goToVMtraceStep(this.api, step, incr, () => { goToVMtraceStep(this.api, step, incr, () => {
@ -15,7 +15,7 @@ function goToVMtraceStep (browser: NightwatchBrowser, step: number, incr: number
return document.querySelector('#stepdetail').innerHTML return document.querySelector('#stepdetail').innerHTML
}, [], function (result) { }, [], function (result) {
console.log('goToVMtraceStep', result) console.log('goToVMtraceStep', result)
if (typeof result.value === 'string' && ( result.value.indexOf('vm trace step:') !== -1 && result.value.indexOf(step.toString()) !== -1)) { if (typeof result.value === 'string' && (result.value.indexOf('vm trace step:') !== -1 && result.value.indexOf(step.toString()) !== -1)) {
done() done()
} else if (incr > 1000) { } else if (incr > 1000) {
browser.assert.fail('goToVMtraceStep fails', 'info about error', '') browser.assert.fail('goToVMtraceStep fails', 'info about error', '')

@ -1,5 +1,5 @@
import { NightwatchBrowser } from 'nightwatch' import { NightwatchBrowser } from 'nightwatch'
import EventEmitter from "events" import EventEmitter from 'events'
/* /*
Checks if any child elements of journal (console) contains a matching value. Checks if any child elements of journal (console) contains a matching value.

@ -1,5 +1,5 @@
import { NightwatchBrowser } from 'nightwatch' import { NightwatchBrowser } from 'nightwatch'
import EventEmitter from "events" import EventEmitter from 'events'
class JournalLastChild extends EventEmitter { class JournalLastChild extends EventEmitter {
command (this: NightwatchBrowser, val: string): NightwatchBrowser { command (this: NightwatchBrowser, val: string): NightwatchBrowser {

@ -1,5 +1,5 @@
import { NightwatchBrowser } from 'nightwatch' import { NightwatchBrowser } from 'nightwatch'
import EventEmitter from "events" import EventEmitter from 'events'
/* /*
Check if the last log in the console contains a specific text Check if the last log in the console contains a specific text

@ -1,5 +1,5 @@
import { NightwatchBrowser } from 'nightwatch' import { NightwatchBrowser } from 'nightwatch'
import EventEmitter from "events" import EventEmitter from 'events'
class ModalFooterOKClick extends EventEmitter { class ModalFooterOKClick extends EventEmitter {
command (this: NightwatchBrowser): NightwatchBrowser { command (this: NightwatchBrowser): NightwatchBrowser {

@ -1,5 +1,5 @@
import { NightwatchBrowser } from "nightwatch" import { NightwatchBrowser } from 'nightwatch'
import EventEmitter from "events" import EventEmitter from 'events'
class ModalFooterOKClick extends EventEmitter { class ModalFooterOKClick extends EventEmitter {
command (this: NightwatchBrowser): NightwatchBrowser { command (this: NightwatchBrowser): NightwatchBrowser {

@ -1,5 +1,5 @@
import { NightwatchBrowser } from "nightwatch" import { NightwatchBrowser } from 'nightwatch'
import EventEmitter from "events" import EventEmitter from 'events'
class NoWorkerErrorFor extends EventEmitter { class NoWorkerErrorFor extends EventEmitter {
command (this: NightwatchBrowser, version: string): NightwatchBrowser { command (this: NightwatchBrowser, version: string): NightwatchBrowser {

@ -1,5 +1,5 @@
import { NightwatchBrowser } from "nightwatch" import { NightwatchBrowser } from 'nightwatch'
import EventEmitter from "events" import EventEmitter from 'events'
class NotContainsText extends EventEmitter { class NotContainsText extends EventEmitter {
command (this: NightwatchBrowser, cssSelector: string, text: string): NightwatchBrowser { command (this: NightwatchBrowser, cssSelector: string, text: string): NightwatchBrowser {

@ -1,4 +1,4 @@
import { NightwatchBrowser } from "nightwatch" import { NightwatchBrowser } from 'nightwatch'
const EventEmitter = require('events') const EventEmitter = require('events')

@ -1,5 +1,5 @@
import { NightwatchBrowser } from 'nightwatch' import { NightwatchBrowser } from 'nightwatch'
import EventEmitter from "events" import EventEmitter from 'events'
class scrollAndClick extends EventEmitter { class scrollAndClick extends EventEmitter {
command (this: NightwatchBrowser, target: string): NightwatchBrowser { command (this: NightwatchBrowser, target: string): NightwatchBrowser {

@ -1,5 +1,5 @@
import { NightwatchBrowser } from 'nightwatch' import { NightwatchBrowser } from 'nightwatch'
import EventEmitter from "events" import EventEmitter from 'events'
class ScrollInto extends EventEmitter { class ScrollInto extends EventEmitter {
command (this: NightwatchBrowser, target: string): NightwatchBrowser { command (this: NightwatchBrowser, target: string): NightwatchBrowser {
@ -15,7 +15,7 @@ class ScrollInto extends EventEmitter {
function _scrollInto (browser: NightwatchBrowser, target: string, cb: VoidFunction): void { function _scrollInto (browser: NightwatchBrowser, target: string, cb: VoidFunction): void {
browser.execute(function (target) { browser.execute(function (target) {
document.querySelector(target).scrollIntoView(({block: 'center'})) document.querySelector(target).scrollIntoView(({ block: 'center' }))
}, [target], function () { }, [target], function () {
cb() cb()
}) })

@ -1,5 +1,5 @@
import { NightwatchBrowser } from 'nightwatch' import { NightwatchBrowser } from 'nightwatch'
import EventEmitter from "events" import EventEmitter from 'events'
class SelectAccount extends EventEmitter { class SelectAccount extends EventEmitter {
command (this: NightwatchBrowser, account?: string): NightwatchBrowser { command (this: NightwatchBrowser, account?: string): NightwatchBrowser {

@ -1,5 +1,5 @@
import { NightwatchBrowser } from 'nightwatch' import { NightwatchBrowser } from 'nightwatch'
import EventEmitter from "events" import EventEmitter from 'events'
const selector = '#runTabView select[class^="contractNames"]' const selector = '#runTabView select[class^="contractNames"]'

@ -1,5 +1,5 @@
import { NightwatchBrowser } from 'nightwatch' import { NightwatchBrowser } from 'nightwatch'
import EventEmitter from "events" import EventEmitter from 'events'
class sendLowLevelTx extends EventEmitter { class sendLowLevelTx extends EventEmitter {
command (this: NightwatchBrowser, address: string, value: string, callData: string): NightwatchBrowser { command (this: NightwatchBrowser, address: string, value: string, callData: string): NightwatchBrowser {

@ -1,4 +1,4 @@
import { NightwatchBrowser } from "nightwatch" import { NightwatchBrowser } from 'nightwatch'
const EventEmitter = require('events') const EventEmitter = require('events')

@ -1,4 +1,4 @@
import { NightwatchBrowser } from "nightwatch" import { NightwatchBrowser } from 'nightwatch'
const EventEmitter = require('events') const EventEmitter = require('events')

@ -1,5 +1,5 @@
import { NightwatchBrowser, NightwatchAPI } from "nightwatch" import { NightwatchBrowser, NightwatchAPI } from 'nightwatch'
import EventEmitter from "events" import EventEmitter from 'events'
/* /*
Switches between browser tabs Switches between browser tabs

@ -1,4 +1,4 @@
import { NightwatchBrowser, NightwatchCallbackResult } from "nightwatch" import { NightwatchBrowser, NightwatchCallbackResult } from 'nightwatch'
const EventEmitter = require('events') const EventEmitter = require('events')

@ -1,5 +1,5 @@
import { NightwatchBrowser, NightwatchTestConstantFunctionExpectedInput } from "nightwatch" import { NightwatchBrowser, NightwatchTestConstantFunctionExpectedInput } from 'nightwatch'
import EventEmitter from "events" import EventEmitter from 'events'
class TestConstantFunction extends EventEmitter { class TestConstantFunction extends EventEmitter {
command (this: NightwatchBrowser, address: string, fnFullName: string, expectedInput: NightwatchTestConstantFunctionExpectedInput | null, expectedOutput: string): NightwatchBrowser { command (this: NightwatchBrowser, address: string, fnFullName: string, expectedInput: NightwatchTestConstantFunctionExpectedInput | null, expectedOutput: string): NightwatchBrowser {

@ -1,8 +1,8 @@
import { NightwatchBrowser, NightwatchContractContent } from 'nightwatch' import { NightwatchBrowser, NightwatchContractContent } from 'nightwatch'
import EventEmitter from "events" import EventEmitter from 'events'
class TestContracts extends EventEmitter { class TestContracts extends EventEmitter {
command (this: NightwatchBrowser,fileName: string, contractCode: NightwatchContractContent, compiledContractNames: string[]): NightwatchBrowser { command (this: NightwatchBrowser, fileName: string, contractCode: NightwatchContractContent, compiledContractNames: string[]): NightwatchBrowser {
this.api.perform((done) => { this.api.perform((done) => {
testContracts(this.api, fileName, contractCode, compiledContractNames, () => { testContracts(this.api, fileName, contractCode, compiledContractNames, () => {
done() done()

@ -1,5 +1,5 @@
import { NightwatchBrowser } from 'nightwatch' import { NightwatchBrowser } from 'nightwatch'
import EventEmitter from "events" import EventEmitter from 'events'
class TestEditorValue extends EventEmitter { class TestEditorValue extends EventEmitter {
command (this: NightwatchBrowser, testvalue: string): NightwatchBrowser { command (this: NightwatchBrowser, testvalue: string): NightwatchBrowser {

@ -1,5 +1,5 @@
import { NightwatchBrowser, NightwatchTestFunctionExpectedInput } from 'nightwatch' import { NightwatchBrowser, NightwatchTestFunctionExpectedInput } from 'nightwatch'
import EventEmitter from "events" import EventEmitter from 'events'
const deepequal = require('deep-equal') const deepequal = require('deep-equal')

@ -1,5 +1,5 @@
import { NightwatchBrowser } from 'nightwatch' import { NightwatchBrowser } from 'nightwatch'
import EventEmitter from "events" import EventEmitter from 'events'
class VerifyCallReturnValue extends EventEmitter { class VerifyCallReturnValue extends EventEmitter {
command (this: NightwatchBrowser, address: string, checks: string[]): NightwatchBrowser { command (this: NightwatchBrowser, address: string, checks: string[]): NightwatchBrowser {

@ -1,8 +1,8 @@
import { NightwatchBrowser, NightwatchCallbackResult } from 'nightwatch' import { NightwatchBrowser, NightwatchCallbackResult } from 'nightwatch'
import EventEmitter from "events" import EventEmitter from 'events'
class VerifyContracts extends EventEmitter { class VerifyContracts extends EventEmitter {
command (this: NightwatchBrowser,compiledContractNames: string[], opts = { wait: 1000, version: null }): NightwatchBrowser { command (this: NightwatchBrowser, compiledContractNames: string[], opts = { wait: 1000, version: null }): NightwatchBrowser {
this.api.perform((done) => { this.api.perform((done) => {
verifyContracts(this.api, compiledContractNames, opts, () => { verifyContracts(this.api, compiledContractNames, opts, () => {
done() done()

@ -214,7 +214,7 @@ contract Ballot {
} }
} }
` `
// eslint-disable-next-line
const ballot_0_4_11 = `pragma solidity >=0.4.10 <0.7.0; const ballot_0_4_11 = `pragma solidity >=0.4.10 <0.7.0;
contract Ballot { contract Ballot {

@ -1,4 +1,4 @@
import { NightwatchBrowser } from "nightwatch" import { NightwatchBrowser } from 'nightwatch'
require('dotenv').config() require('dotenv').config()

@ -6,7 +6,7 @@ import sauce from './sauce'
import examples from '../examples/example-contracts' import examples from '../examples/example-contracts'
const sources = [ const sources = [
{'browser/Untitled.sol': { content: examples.ballot.content }} { 'browser/Untitled.sol': { content: examples.ballot.content } }
] ]
module.exports = { module.exports = {
@ -27,7 +27,7 @@ module.exports = {
.click('*[data-id="Deploy - transact (not payable)"]') .click('*[data-id="Deploy - transact (not payable)"]')
.waitForElementPresent('*[data-id="universalDappUiContractActionWrapper"]') .waitForElementPresent('*[data-id="universalDappUiContractActionWrapper"]')
.click('*[data-id="universalDappUiTitleExpander"]') .click('*[data-id="universalDappUiTitleExpander"]')
.clickFunction('delegate - transact (not payable)', {types: 'address to', values: '"0x4b0897b0513fdc7c541b6d9d7e929c4e5364d2db"'}) .clickFunction('delegate - transact (not payable)', { types: 'address to', values: '"0x4b0897b0513fdc7c541b6d9d7e929c4e5364d2db"' })
.testFunction('0x41fab8ea5b1d9fba5e0a6545ca1a2d62fff518578802c033c2b9a031a01c31b3', .testFunction('0x41fab8ea5b1d9fba5e0a6545ca1a2d62fff518578802c033c2b9a031a01c31b3',
{ {
status: 'true Transaction mined and execution succeed', status: 'true Transaction mined and execution succeed',
@ -60,7 +60,7 @@ module.exports = {
.pause(500) .pause(500)
.waitForElementPresent('*[data-id="universalDappUiContractActionWrapper"]') .waitForElementPresent('*[data-id="universalDappUiContractActionWrapper"]')
.click('*[data-id="universalDappUiTitleExpander"]') .click('*[data-id="universalDappUiTitleExpander"]')
.clickFunction('delegate - transact (not payable)', {types: 'address to', values: '"0x4b0897b0513fdc7c541b6d9d7e929c4e5364d2db"'}) .clickFunction('delegate - transact (not payable)', { types: 'address to', values: '"0x4b0897b0513fdc7c541b6d9d7e929c4e5364d2db"' })
.testFunction('0xca58080c8099429caeeffe43b8104df919c2c543dceb9edf9242fa55f045c803', .testFunction('0xca58080c8099429caeeffe43b8104df919c2c543dceb9edf9242fa55f045c803',
{ {
status: 'false Transaction mined but execution failed', status: 'false Transaction mined but execution failed',
@ -80,7 +80,7 @@ module.exports = {
.click('*[data-id="Deploy - transact (not payable)"]') .click('*[data-id="Deploy - transact (not payable)"]')
.clickInstance(0) .clickInstance(0)
.click('*[data-id="terminalClearConsole"]') .click('*[data-id="terminalClearConsole"]')
.clickFunction('delegate - transact (not payable)', {types: 'address to', values: '0xCA35b7d915458EF540aDe6068dFe2F44E8fa733c'}) .clickFunction('delegate - transact (not payable)', { types: 'address to', values: '0xCA35b7d915458EF540aDe6068dFe2F44E8fa733c' })
.journalLastChildIncludes('Ballot.delegate(address)') .journalLastChildIncludes('Ballot.delegate(address)')
.journalLastChildIncludes('data: 0x5c1...a733c') .journalLastChildIncludes('data: 0x5c1...a733c')
.end() .end()
@ -90,64 +90,64 @@ module.exports = {
} }
const localsCheck = { const localsCheck = {
'to': { to: {
'value': '0x4B0897B0513FDC7C541B6D9D7E929C4E5364D2DB', value: '0x4B0897B0513FDC7C541B6D9D7E929C4E5364D2DB',
'type': 'address' type: 'address'
} }
} }
const stateCheck = { const stateCheck = {
'chairperson': { chairperson: {
'value': '0xCA35B7D915458EF540ADE6068DFE2F44E8FA733C', value: '0xCA35B7D915458EF540ADE6068DFE2F44E8FA733C',
'type': 'address', type: 'address',
'constant': false constant: false
}, },
'voters': { voters: {
'value': { value: {
'000000000000000000000000ca35b7d915458ef540ade6068dfe2f44e8fa733c': { '000000000000000000000000ca35b7d915458ef540ade6068dfe2f44e8fa733c': {
'value': { value: {
'weight': { weight: {
'value': '1', value: '1',
'type': 'uint256' type: 'uint256'
}, },
'voted': { voted: {
'value': false, value: false,
'type': 'bool' type: 'bool'
}, },
'delegate': { delegate: {
'value': '0x0000000000000000000000000000000000000000', value: '0x0000000000000000000000000000000000000000',
'type': 'address' type: 'address'
}, },
'vote': { vote: {
'value': '0', value: '0',
'type': 'uint256' type: 'uint256'
} }
}, },
'type': 'struct Ballot.Voter' type: 'struct Ballot.Voter'
} }
}, },
'type': 'mapping(address => struct Ballot.Voter)', type: 'mapping(address => struct Ballot.Voter)',
'constant': false constant: false
}, },
'proposals': { proposals: {
'value': [ value: [
{ {
'value': { value: {
'name': { name: {
'value': '0x48656C6C6F20576F726C64210000000000000000000000000000000000000000', value: '0x48656C6C6F20576F726C64210000000000000000000000000000000000000000',
'type': 'bytes32' type: 'bytes32'
}, },
'voteCount': { voteCount: {
'value': '0', value: '0',
'type': 'uint256' type: 'uint256'
} }
}, },
'type': 'struct Ballot.Proposal' type: 'struct Ballot.Proposal'
} }
], ],
'length': '0x1', length: '0x1',
'type': 'struct Ballot.Proposal[]', type: 'struct Ballot.Proposal[]',
'constant': false constant: false
} }
} }

@ -6,7 +6,7 @@ import sauce from './sauce'
import examples from '../examples/example-contracts' import examples from '../examples/example-contracts'
const sources = [ const sources = [
{'browser/Untitled.sol': { content: examples.ballot_0_4_11.content }} { 'browser/Untitled.sol': { content: examples.ballot_0_4_11.content } }
] ]
module.exports = { module.exports = {
@ -25,7 +25,6 @@ module.exports = {
.click('[for="autoCompile"]') .click('[for="autoCompile"]')
.verify.elementPresent('[data-id="compilerContainerAutoCompile"]:checked') .verify.elementPresent('[data-id="compilerContainerAutoCompile"]:checked')
.testContracts('Untitled.sol', sources[0]['browser/Untitled.sol'], ['Ballot']) .testContracts('Untitled.sol', sources[0]['browser/Untitled.sol'], ['Ballot'])
}, },
'Deploy Ballot': function (browser: NightwatchBrowser) { 'Deploy Ballot': function (browser: NightwatchBrowser) {
@ -37,7 +36,7 @@ module.exports = {
.click('*[data-id="Deploy - transact (not payable)"]') .click('*[data-id="Deploy - transact (not payable)"]')
.waitForElementPresent('*[data-id="universalDappUiContractActionWrapper"]') .waitForElementPresent('*[data-id="universalDappUiContractActionWrapper"]')
.click('*[data-id="universalDappUiTitleExpander"]') .click('*[data-id="universalDappUiTitleExpander"]')
.clickFunction('delegate - transact (not payable)', {types: 'address to', values: '"0x4b0897b0513fdc7c541b6d9d7e929c4e5364d2db"'}) .clickFunction('delegate - transact (not payable)', { types: 'address to', values: '"0x4b0897b0513fdc7c541b6d9d7e929c4e5364d2db"' })
.testFunction('0x41fab8ea5b1d9fba5e0a6545ca1a2d62fff518578802c033c2b9a031a01c31b3', .testFunction('0x41fab8ea5b1d9fba5e0a6545ca1a2d62fff518578802c033c2b9a031a01c31b3',
{ {
status: 'true Transaction mined and execution succeed', status: 'true Transaction mined and execution succeed',
@ -56,7 +55,7 @@ module.exports = {
.waitForElementVisible('#stepdetail') .waitForElementVisible('#stepdetail')
.goToVMTraceStep(20) .goToVMTraceStep(20)
.pause(1000) .pause(1000)
.checkVariableDebug('callstackpanel', ["0x692a70D2e424a56D2C6C27aA97D1a86395877b3A"]) .checkVariableDebug('callstackpanel', ['0x692a70D2e424a56D2C6C27aA97D1a86395877b3A'])
}, },
'Access Ballot via at address': function (browser: NightwatchBrowser) { 'Access Ballot via at address': function (browser: NightwatchBrowser) {
@ -69,7 +68,7 @@ module.exports = {
.pause(500) .pause(500)
.waitForElementPresent('*[data-id="universalDappUiContractActionWrapper"]') .waitForElementPresent('*[data-id="universalDappUiContractActionWrapper"]')
.click('*[data-id="universalDappUiTitleExpander"]') .click('*[data-id="universalDappUiTitleExpander"]')
.clickFunction('delegate - transact (not payable)', {types: 'address to', values: '"0x4b0897b0513fdc7c541b6d9d7e929c4e5364d2db"'}) .clickFunction('delegate - transact (not payable)', { types: 'address to', values: '"0x4b0897b0513fdc7c541b6d9d7e929c4e5364d2db"' })
.testFunction('0xca58080c8099429caeeffe43b8104df919c2c543dceb9edf9242fa55f045c803', .testFunction('0xca58080c8099429caeeffe43b8104df919c2c543dceb9edf9242fa55f045c803',
{ {
status: 'true Transaction mined and execution succeed', status: 'true Transaction mined and execution succeed',
@ -89,7 +88,7 @@ module.exports = {
.click('*[data-id="Deploy - transact (not payable)"]') .click('*[data-id="Deploy - transact (not payable)"]')
.clickInstance(0) .clickInstance(0)
.click('*[data-id="terminalClearConsole"]') .click('*[data-id="terminalClearConsole"]')
.clickFunction('delegate - transact (not payable)', {types: 'address to', values: '0xCA35b7d915458EF540aDe6068dFe2F44E8fa733c'}) .clickFunction('delegate - transact (not payable)', { types: 'address to', values: '0xCA35b7d915458EF540aDe6068dFe2F44E8fa733c' })
.journalLastChildIncludes('Ballot.delegate(address)') .journalLastChildIncludes('Ballot.delegate(address)')
.journalLastChildIncludes('data: 0x5c1...a733c') .journalLastChildIncludes('data: 0x5c1...a733c')
.end() .end()

@ -6,7 +6,7 @@ import sauce from './sauce'
import examples from '../examples/example-contracts' import examples from '../examples/example-contracts'
const sources = [ const sources = [
{'browser/Untitled.sol': { content: examples.ballot.content }} { 'browser/Untitled.sol': { content: examples.ballot.content } }
] ]
module.exports = { module.exports = {
@ -23,7 +23,7 @@ module.exports = {
.addFile('test_jsCompile.js', { content: jsCompile }) .addFile('test_jsCompile.js', { content: jsCompile })
.executeScript('remix.exeCurrent()') .executeScript('remix.exeCurrent()')
.pause(5000) .pause(5000)
.journalChildIncludes(`"languageversion": "0.6.8+commit.0bbfe453"`) .journalChildIncludes('"languageversion": "0.6.8+commit.0bbfe453"')
}, },
'Should compile using "compileWithParamaters" API with optimization On': function (browser: NightwatchBrowser) { 'Should compile using "compileWithParamaters" API with optimization On': function (browser: NightwatchBrowser) {
@ -31,7 +31,7 @@ module.exports = {
.addFile('test_jsCompileWithOptimization.js', { content: jsCompileWithOptimization }) .addFile('test_jsCompileWithOptimization.js', { content: jsCompileWithOptimization })
.executeScript('remix.exeCurrent()') .executeScript('remix.exeCurrent()')
.pause(10000) .pause(10000)
.journalChildIncludes(`\\"optimizer\\":{\\"enabled\\":true,\\"runs\\":300}`) .journalChildIncludes('\\"optimizer\\":{\\"enabled\\":true,\\"runs\\":300}')
}, },
'Should compile using "compileWithParamaters" API with optimization off check default runs': function (browser: NightwatchBrowser) { 'Should compile using "compileWithParamaters" API with optimization off check default runs': function (browser: NightwatchBrowser) {
@ -39,7 +39,7 @@ module.exports = {
.addFile('test_jsCompileWithOptimizationDefault.js', { content: jsCompileWithOptimizationDefault }) .addFile('test_jsCompileWithOptimizationDefault.js', { content: jsCompileWithOptimizationDefault })
.executeScript('remix.exeCurrent()') .executeScript('remix.exeCurrent()')
.pause(10000) .pause(10000)
.journalChildIncludes(`\\"optimizer\\":{\\"enabled\\":false,\\"runs\\":200}`) .journalChildIncludes('\\"optimizer\\":{\\"enabled\\":false,\\"runs\\":200}')
}, },
'Should update the compiler configuration with "setCompilerConfig" API': function (browser: NightwatchBrowser) { 'Should update the compiler configuration with "setCompilerConfig" API': function (browser: NightwatchBrowser) {
@ -140,7 +140,6 @@ const jsCompileWithOptimizationDefault = `(async () => {
} }
})()` })()`
const updateConfiguration = `(async () => { const updateConfiguration = `(async () => {
try { try {
const params = { const params = {

@ -95,7 +95,7 @@ module.exports = {
browser.assert.ok(content.indexOf(`constructor (string memory name_, string memory symbol_) { browser.assert.ok(content.indexOf(`constructor (string memory name_, string memory symbol_) {
_name = name_; _name = name_;
_symbol = symbol_; _symbol = symbol_;
}`) != -1, }`) !== -1,
'current displayed content is not from the ERC20 source code') 'current displayed content is not from the ERC20 source code')
}) })
}, },
@ -116,7 +116,7 @@ module.exports = {
.selectContract('test') .selectContract('test')
.createContract('') .createContract('')
.clickInstance(2) .clickInstance(2)
.clickFunction('test1 - transact (not payable)', {types: 'bytes userData', values: '0x000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000015b38da6a701c568545dcfcb03fcb875f56beddc4'}) .clickFunction('test1 - transact (not payable)', { types: 'bytes userData', values: '0x000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000015b38da6a701c568545dcfcb03fcb875f56beddc4' })
.debugTransaction(4) .debugTransaction(4)
.pause(2000) .pause(2000)
.waitForElementVisible('#stepdetail') .waitForElementVisible('#stepdetail')
@ -172,7 +172,7 @@ module.exports = {
.clickLaunchIcon('udapp') .clickLaunchIcon('udapp')
.createContract('') .createContract('')
.clickInstance(4) .clickInstance(4)
.clickFunction('f - transact (not payable)', {types: 'uint256[] ', values: '[]'}) .clickFunction('f - transact (not payable)', { types: 'uint256[] ', values: '[]' })
.debugTransaction(8) .debugTransaction(8)
.pause(2000) .pause(2000)
.click('*[data-id="debuggerTransactionStartButton"]') // stop debugging .click('*[data-id="debuggerTransactionStartButton"]') // stop debugging
@ -180,7 +180,7 @@ module.exports = {
.click('*[data-id="debuggerTransactionStartButton"]') // start debugging .click('*[data-id="debuggerTransactionStartButton"]') // start debugging
.pause(2000) .pause(2000)
.getEditorValue((content) => { .getEditorValue((content) => {
browser.assert.ok(content.indexOf('if slt(sub(dataEnd, headStart), 32) { revert(0, 0) }') != -1, 'current displayed content is not a generated source') browser.assert.ok(content.indexOf('if slt(sub(dataEnd, headStart), 32) { revert(0, 0) }') !== -1, 'current displayed content is not a generated source')
}) })
.click('*[data-id="debuggerTransactionStartButton"]') .click('*[data-id="debuggerTransactionStartButton"]')
}, },
@ -190,7 +190,7 @@ module.exports = {
.addFile('test_jsGetTrace.js', { content: jsGetTrace }) .addFile('test_jsGetTrace.js', { content: jsGetTrace })
.executeScript('remix.exeCurrent()') .executeScript('remix.exeCurrent()')
.pause(3000) .pause(3000)
.journalChildIncludes(`{ "gas": "0x2dc6c0", "return": "0x", "structLogs":`) .journalChildIncludes('{ "gas": "0x2dc6c0", "return": "0x", "structLogs":')
}, },
'Should call the debugger api: debug': function (browser: NightwatchBrowser) { 'Should call the debugger api: debug': function (browser: NightwatchBrowser) {
@ -250,10 +250,11 @@ const sources = [
} }
}, },
{ {
'browser/externalImport.sol': {content: 'import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/ERC20.sol"; contract test7 {}'} 'browser/externalImport.sol': { content: 'import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/ERC20.sol"; contract test7 {}' }
}, },
{ {
'browser/withABIEncoderV2.sol': {content: ` 'browser/withABIEncoderV2.sol': {
content: `
pragma experimental ABIEncoderV2; pragma experimental ABIEncoderV2;
contract test { contract test {
@ -272,7 +273,8 @@ const sources = [
return abi.decode(userData[:4], (bytes4)); return abi.decode(userData[:4], (bytes4));
} }
} }
`} `
}
}, },
{ {
'browser/locals.sol': { 'browser/locals.sol': {
@ -302,68 +304,68 @@ const sources = [
} }
] ]
const localVariable_step266_ABIEncoder = { const localVariable_step266_ABIEncoder = { // eslint-disable-line
"<1>": { '<1>': {
"length": "0xNaN", length: '0xNaN',
"type": "bytes", type: 'bytes',
"value": "0x" value: '0x'
}, },
"<2>": { '<2>': {
"type": "bytes32", type: 'bytes32',
"value": "0x0000000000000000000000000000000000000000000000000000000000000000" value: '0x0000000000000000000000000000000000000000000000000000000000000000'
}, },
"<3>": { '<3>': {
"type": "bytes32", type: 'bytes32',
"value": "0x0000000000000000000000000000000000000000000000000000000000000000" value: '0x0000000000000000000000000000000000000000000000000000000000000000'
}, },
"<4>": { '<4>': {
"type": "uint256", type: 'uint256',
"value": "0" value: '0'
}, },
"idAsk": { idAsk: {
"type": "bytes32", type: 'bytes32',
"value": "0x0000000000000000000000000000000000000000000000000000000000000002" value: '0x0000000000000000000000000000000000000000000000000000000000000002'
}, },
"userData": { userData: {
"error": "<decoding failed - no decoder for calldata>", error: '<decoding failed - no decoder for calldata>',
"type": "bytes" type: 'bytes'
} }
} }
const localVariable_step717_ABIEncoder = { const localVariable_step717_ABIEncoder = { // eslint-disable-line
"<1>": { '<1>': {
"length": "0xd0", length: '0xd0',
"type": "bytes", type: 'bytes',
"value": "0x5b38da6a701c568545dcfcb03fcb875f56beddc45b38da6a701c568545dcfcb03fcb875f56beddc400000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000001" value: '0x5b38da6a701c568545dcfcb03fcb875f56beddc45b38da6a701c568545dcfcb03fcb875f56beddc400000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000001'
}, },
"<2>": { '<2>': {
"type": "bytes32", type: 'bytes32',
"value": "0x0000000000000000000000000000000000000000000000000000000000000002" value: '0x0000000000000000000000000000000000000000000000000000000000000002'
}, },
"<3>": { '<3>': {
"type": "bytes32", type: 'bytes32',
"value": "0x0000000000000000000000000000000000000000000000000000000000000001" value: '0x0000000000000000000000000000000000000000000000000000000000000001'
}, },
"<4>": { '<4>': {
"type": "uint256", type: 'uint256',
"value": "84" value: '84'
}, },
"idAsk": { idAsk: {
"type": "bytes32", type: 'bytes32',
"value": "0x0000000000000000000000000000000000000000000000000000000000000002" value: '0x0000000000000000000000000000000000000000000000000000000000000002'
}, },
"idOffer": { idOffer: {
"type": "bytes32", type: 'bytes32',
"value": "0x0000000000000000000000000000000000000000000000000000000000000001" value: '0x0000000000000000000000000000000000000000000000000000000000000001'
}, },
"ro": { ro: {
"length": "0xd0", length: '0xd0',
"type": "bytes", type: 'bytes',
"value": "0x5b38da6a701c568545dcfcb03fcb875f56beddc45b38da6a701c568545dcfcb03fcb875f56beddc400000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000001" value: '0x5b38da6a701c568545dcfcb03fcb875f56beddc45b38da6a701c568545dcfcb03fcb875f56beddc400000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000001'
}, },
"userData": { userData: {
"error": "<decoding failed - no decoder for calldata>", error: '<decoding failed - no decoder for calldata>',
"type": "bytes" type: 'bytes'
} }
} }

@ -1,6 +1,6 @@
'use strict' 'use strict'
import { NightwatchBrowser } from "nightwatch" import { NightwatchBrowser } from 'nightwatch'
import init from '../helpers/init' import init from '../helpers/init'
import sauce from './sauce' import sauce from './sauce'

@ -1,5 +1,5 @@
'use strict' 'use strict'
import { NightwatchBrowser } from "nightwatch" import { NightwatchBrowser } from 'nightwatch'
import init from '../helpers/init' import init from '../helpers/init'
import sauce from './sauce' import sauce from './sauce'
import * as path from 'path' import * as path from 'path'
@ -113,4 +113,3 @@ module.exports = {
tearDown: sauce tearDown: sauce
} }

@ -1,5 +1,5 @@
'use strict' 'use strict'
import { NightwatchBrowser } from "nightwatch" import { NightwatchBrowser } from 'nightwatch'
import init from '../helpers/init' import init from '../helpers/init'
import sauce from './sauce' import sauce from './sauce'
@ -11,7 +11,7 @@ module.exports = {
'Should execute `file` api from file manager external api': function (browser: NightwatchBrowser) { 'Should execute `file` api from file manager external api': function (browser: NightwatchBrowser) {
browser browser
.addFile('file.js', { content: executeFile }) .addFile('file.js', { content: executeFile })
.executeScript(`remix.exeCurrent()`) .executeScript('remix.exeCurrent()')
.pause(5000) .pause(5000)
.journalLastChildIncludes('browser/file.js') .journalLastChildIncludes('browser/file.js')
}, },
@ -19,7 +19,7 @@ module.exports = {
'Should execute `exists` api from file manager external api': function (browser: NightwatchBrowser) { 'Should execute `exists` api from file manager external api': function (browser: NightwatchBrowser) {
browser browser
.addFile('exists.js', { content: executeExists }) .addFile('exists.js', { content: executeExists })
.executeScript(`remix.exeCurrent()`) .executeScript('remix.exeCurrent()')
.pause(2000) .pause(2000)
.journalChildIncludes('browser/exists.js true') .journalChildIncludes('browser/exists.js true')
.journalChildIncludes('browser/non-exists.js false') .journalChildIncludes('browser/non-exists.js false')
@ -28,7 +28,7 @@ module.exports = {
'Should execute `open` api from file manager external api': function (browser: NightwatchBrowser) { 'Should execute `open` api from file manager external api': function (browser: NightwatchBrowser) {
browser browser
.addFile('open.js', { content: executeOpen }) .addFile('open.js', { content: executeOpen })
.executeScript(`remix.exeCurrent()`) .executeScript('remix.exeCurrent()')
.pause(2000) .pause(2000)
.journalLastChildIncludes('browser/contracts/3_Ballot.sol') .journalLastChildIncludes('browser/contracts/3_Ballot.sol')
}, },
@ -36,7 +36,7 @@ module.exports = {
'Should execute `writeFile` api from file manager external api': function (browser: NightwatchBrowser) { 'Should execute `writeFile` api from file manager external api': function (browser: NightwatchBrowser) {
browser browser
.addFile('writeFile.js', { content: executeWriteFile }) .addFile('writeFile.js', { content: executeWriteFile })
.executeScript(`remix.exeCurrent()`) .executeScript('remix.exeCurrent()')
.pause(2000) .pause(2000)
.openFile('browser/new_contract.sol') .openFile('browser/new_contract.sol')
.assert.containsText('[data-id="editorInput"]', 'pragma solidity ^0.6.0') .assert.containsText('[data-id="editorInput"]', 'pragma solidity ^0.6.0')
@ -45,7 +45,7 @@ module.exports = {
'Should execute `readFile` api from file manager external api': function (browser: NightwatchBrowser) { 'Should execute `readFile` api from file manager external api': function (browser: NightwatchBrowser) {
browser browser
.addFile('readFile.js', { content: executeReadFile }) .addFile('readFile.js', { content: executeReadFile })
.executeScript(`remix.exeCurrent()`) .executeScript('remix.exeCurrent()')
.pause(2000) .pause(2000)
.journalLastChildIncludes('pragma solidity ^0.6.0') .journalLastChildIncludes('pragma solidity ^0.6.0')
}, },
@ -53,7 +53,7 @@ module.exports = {
'Should execute `copyFile` api from file manager external api': function (browser: NightwatchBrowser) { 'Should execute `copyFile` api from file manager external api': function (browser: NightwatchBrowser) {
browser browser
.addFile('copyFile.js', { content: executeCopyFile }) .addFile('copyFile.js', { content: executeCopyFile })
.executeScript(`remix.exeCurrent()`) .executeScript('remix.exeCurrent()')
.pause(2000) .pause(2000)
.journalLastChildIncludes('pragma solidity >=0.7.0 <0.8.0;') .journalLastChildIncludes('pragma solidity >=0.7.0 <0.8.0;')
}, },
@ -61,7 +61,7 @@ module.exports = {
'Should execute `rename` api from file manager external api': function (browser: NightwatchBrowser) { 'Should execute `rename` api from file manager external api': function (browser: NightwatchBrowser) {
browser browser
.addFile('renameFile.js', { content: executeRename }) .addFile('renameFile.js', { content: executeRename })
.executeScript(`remix.exeCurrent()`) .executeScript('remix.exeCurrent()')
.pause(2000) .pause(2000)
.waitForElementPresent('[data-id="treeViewLitreeViewItembrowser/old_contract.sol"]') .waitForElementPresent('[data-id="treeViewLitreeViewItembrowser/old_contract.sol"]')
}, },
@ -69,7 +69,7 @@ module.exports = {
'Should execute `mkdir` api from file manager external api': function (browser: NightwatchBrowser) { 'Should execute `mkdir` api from file manager external api': function (browser: NightwatchBrowser) {
browser browser
.addFile('mkdirFile.js', { content: executeMkdir }) .addFile('mkdirFile.js', { content: executeMkdir })
.executeScript(`remix.exeCurrent()`) .executeScript('remix.exeCurrent()')
.pause(2000) .pause(2000)
.waitForElementPresent('[data-id="treeViewLitreeViewItembrowser/Test_Folder"]') .waitForElementPresent('[data-id="treeViewLitreeViewItembrowser/Test_Folder"]')
}, },
@ -77,7 +77,7 @@ module.exports = {
'Should execute `readdir` api from file manager external api': function (browser: NightwatchBrowser) { 'Should execute `readdir` api from file manager external api': function (browser: NightwatchBrowser) {
browser browser
.addFile('readdirFile.js', { content: executeReaddir }) .addFile('readdirFile.js', { content: executeReaddir })
.executeScript(`remix.exeCurrent()`) .executeScript('remix.exeCurrent()')
.pause(2000) .pause(2000)
.journalLastChildIncludes('Test_Folder isDirectory true') .journalLastChildIncludes('Test_Folder isDirectory true')
}, },
@ -85,7 +85,7 @@ module.exports = {
'Should execute `remove` api from file manager external api': function (browser: NightwatchBrowser) { 'Should execute `remove` api from file manager external api': function (browser: NightwatchBrowser) {
browser browser
.addFile('removeFile.js', { content: executeRemove }) .addFile('removeFile.js', { content: executeRemove })
.executeScript(`remix.exeCurrent()`) .executeScript('remix.exeCurrent()')
.pause(2000) .pause(2000)
.waitForElementNotPresent('[data-id="treeViewLitreeViewItembrowser/old_contract.sol"]') .waitForElementNotPresent('[data-id="treeViewLitreeViewItembrowser/old_contract.sol"]')
}, },

@ -1,5 +1,5 @@
'use strict' 'use strict'
import { NightwatchBrowser } from "nightwatch" import { NightwatchBrowser } from 'nightwatch'
import init from '../helpers/init' import init from '../helpers/init'
import sauce from './sauce' import sauce from './sauce'

@ -1,5 +1,5 @@
'use strict' 'use strict'
import { NightwatchBrowser } from "nightwatch" import { NightwatchBrowser } from 'nightwatch'
import init from '../helpers/init' import init from '../helpers/init'
import sauce from './sauce' import sauce from './sauce'

@ -1,5 +1,5 @@
'use strict' 'use strict'
import { NightwatchBrowser } from "nightwatch" import { NightwatchBrowser } from 'nightwatch'
import init from '../helpers/init' import init from '../helpers/init'
import sauce from './sauce' import sauce from './sauce'
@ -93,7 +93,7 @@ function checkDeployShouldSucceed (browser: NightwatchBrowser, address: string,
.getEditorValue((content) => { .getEditorValue((content) => {
config = JSON.parse(content) config = JSON.parse(content)
config.deploy['VM:-'].autoDeployLib = false config.deploy['VM:-'].autoDeployLib = false
config.deploy['VM:-']['linkReferences']['browser/Untitled5.sol'].lib = address config.deploy['VM:-'].linkReferences['browser/Untitled5.sol'].lib = address
}) })
.perform(() => { .perform(() => {
browser.setEditorValue(JSON.stringify(config)) browser.setEditorValue(JSON.stringify(config))
@ -116,7 +116,8 @@ function checkDeployShouldSucceed (browser: NightwatchBrowser, address: string,
const sources = [ const sources = [
{ {
'browser/Untitled5.sol': {content: `library lib { 'browser/Untitled5.sol': {
content: `library lib {
function getInt () public view returns (uint) { function getInt () public view returns (uint) {
return 45; return 45;
} }
@ -126,6 +127,7 @@ const sources = [
function get () public view returns (uint) { function get () public view returns (uint) {
return lib.getInt(); return lib.getInt();
} }
}`} }`
}
} }
] ]

@ -1,5 +1,5 @@
'use strict' 'use strict'
import { NightwatchBrowser } from "nightwatch" import { NightwatchBrowser } from 'nightwatch'
import init from '../helpers/init' import init from '../helpers/init'
import sauce from './sauce' import sauce from './sauce'

@ -1,5 +1,5 @@
'use strict' 'use strict'
import { NightwatchBrowser } from "nightwatch" import { NightwatchBrowser } from 'nightwatch'
import init from '../helpers/init' import init from '../helpers/init'
import sauce from './sauce' import sauce from './sauce'

@ -1,5 +1,5 @@
'use strict' 'use strict'
import { NightwatchBrowser } from "nightwatch" import { NightwatchBrowser } from 'nightwatch'
import init from '../helpers/init' import init from '../helpers/init'
import sauce from './sauce' import sauce from './sauce'
@ -14,7 +14,7 @@ module.exports = {
'Test Recorder': function (browser: NightwatchBrowser) { 'Test Recorder': function (browser: NightwatchBrowser) {
let addressRef let addressRef
browser.addFile('scenario.json', {content: records}) browser.addFile('scenario.json', { content: records })
.pause(5000) .pause(5000)
.clickLaunchIcon('udapp') .clickLaunchIcon('udapp')
.selectAccount('0xCA35b7d915458EF540aDe6068dFe2F44E8fa733c') // this account will be used for this test suite .selectAccount('0xCA35b7d915458EF540aDe6068dFe2F44E8fa733c') // this account will be used for this test suite
@ -42,7 +42,7 @@ module.exports = {
.createContract('12') .createContract('12')
.waitForElementPresent('.instance:nth-of-type(2)') .waitForElementPresent('.instance:nth-of-type(2)')
.click('.instance:nth-of-type(2) > div > button') .click('.instance:nth-of-type(2) > div > button')
.clickFunction('set - transact (not payable)', {types: 'uint256 _p', values: '34'}) .clickFunction('set - transact (not payable)', { types: 'uint256 _p', values: '34' })
.click('i.savetransaction') .click('i.savetransaction')
.modalFooterOKClick() .modalFooterOKClick()
.getEditorValue(function (result) { .getEditorValue(function (result) {
@ -62,7 +62,6 @@ module.exports = {
'Record more than one contract': function (browser: NightwatchBrowser) { 'Record more than one contract': function (browser: NightwatchBrowser) {
// deploy 2 contracts (2 different ABIs), save the record, reexecute and test one of the function. // deploy 2 contracts (2 different ABIs), save the record, reexecute and test one of the function.
let addressRef
browser browser
.click('*[data-id="deployAndRunClearInstances"]') .click('*[data-id="deployAndRunClearInstances"]')
.testContracts('multipleContracts.sol', sources[1]['browser/multipleContracts.sol'], ['t1est', 't2est']) .testContracts('multipleContracts.sol', sources[1]['browser/multipleContracts.sol'], ['t1est', 't2est'])
@ -81,27 +80,33 @@ module.exports = {
.click('#runTabView .runtransaction') .click('#runTabView .runtransaction')
.clickInstance(1) .clickInstance(1)
.pause(1000) .pause(1000)
.clickFunction('set2 - transact (not payable)', {types: 'uint256 _po', values: '10'}) .clickFunction('set2 - transact (not payable)', { types: 'uint256 _po', values: '10' })
.testFunction('0xa88bf726e706480f61f04a066452929030c0a0216cc6923106f863963339bdb7', .testFunction('0xa88bf726e706480f61f04a066452929030c0a0216cc6923106f863963339bdb7',
{ {
status: 'true Transaction mined and execution succeed', status: 'true Transaction mined and execution succeed',
'transaction hash': '0xa88bf726e706480f61f04a066452929030c0a0216cc6923106f863963339bdb7', 'transaction hash': '0xa88bf726e706480f61f04a066452929030c0a0216cc6923106f863963339bdb7',
'decoded input': {"uint256 _po":{"type":"BigNumber","hex":"0x0a"}} 'decoded input': { 'uint256 _po': { type: 'BigNumber', hex: '0x0a' } }
}) })
.end() .end()
}, },
tearDown: sauce tearDown: sauce
} }
const sources = [{'browser/testRecorder.sol': {content: `contract testRecorder { const sources = [{
'browser/testRecorder.sol': {
content: `contract testRecorder {
constructor(uint p) public { constructor(uint p) public {
} }
function set (uint _p) public { function set (uint _p) public {
} }
}`}}, }`
{'browser/multipleContracts.sol': {content: `contract t1est { }
},
{
'browser/multipleContracts.sol': {
content: `contract t1est {
uint p; uint p;
t2est t; t2est t;
constructor () public { constructor () public {
@ -120,7 +125,9 @@ contract t2est {
function set2(uint _po) public { function set2(uint _po) public {
p = _po; p = _po;
} }
}`}} }`
}
}
] ]
const records = `{ const records = `{
@ -282,70 +289,70 @@ const records = `{
}` }`
const scenario = { const scenario = {
'accounts': { accounts: {
'account{10}': '0xCA35b7d915458EF540aDe6068dFe2F44E8fa733c' 'account{10}': '0xCA35b7d915458EF540aDe6068dFe2F44E8fa733c'
}, },
'linkReferences': {}, linkReferences: {},
'transactions': [ transactions: [
{ {
'timestamp': 1512912691086, timestamp: 1512912691086,
'record': { record: {
'value': '0', value: '0',
'parameters': [ parameters: [
"12" // eslint-disable-line "12" // eslint-disable-line
], ],
'abi': '0x54a8c0ab653c15bfb48b47fd011ba2b9617af01cb45cab344acd57c924d56798', abi: '0x54a8c0ab653c15bfb48b47fd011ba2b9617af01cb45cab344acd57c924d56798',
'contractName': 'testRecorder', contractName: 'testRecorder',
'bytecode': '6060604052341561000f57600080fd5b6040516020806100cd833981016040528080519060200190919050505060938061003a6000396000f300606060405260043610603f576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806360fe47b1146044575b600080fd5b3415604e57600080fd5b606260048080359060200190919050506064565b005b505600a165627a7a723058204839660366b94f5f3c8c6da233a2c5fe95ad5635b5c8a2bb630a8b845d68ecdd0029', bytecode: '6060604052341561000f57600080fd5b6040516020806100cd833981016040528080519060200190919050505060938061003a6000396000f300606060405260043610603f576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806360fe47b1146044575b600080fd5b3415604e57600080fd5b606260048080359060200190919050506064565b005b505600a165627a7a723058204839660366b94f5f3c8c6da233a2c5fe95ad5635b5c8a2bb630a8b845d68ecdd0029',
'linkReferences': {}, linkReferences: {},
'name': '', name: '',
'type': 'constructor', type: 'constructor',
'inputs': '(uint256)', inputs: '(uint256)',
'from': 'account{10}' from: 'account{10}'
} }
}, },
{ {
'timestamp': 1512912696128, timestamp: 1512912696128,
'record': { record: {
'value': '0', value: '0',
'parameters': [ parameters: [
"34" // eslint-disable-line "34" // eslint-disable-line
], ],
'to': 'created{1512912691086}', to: 'created{1512912691086}',
'abi': '0x54a8c0ab653c15bfb48b47fd011ba2b9617af01cb45cab344acd57c924d56798', abi: '0x54a8c0ab653c15bfb48b47fd011ba2b9617af01cb45cab344acd57c924d56798',
'name': 'set', name: 'set',
'inputs': '(uint256)', inputs: '(uint256)',
'type': 'function', type: 'function',
'from': 'account{10}' from: 'account{10}'
} }
} }
], ],
'abis': { abis: {
'0x54a8c0ab653c15bfb48b47fd011ba2b9617af01cb45cab344acd57c924d56798': [ '0x54a8c0ab653c15bfb48b47fd011ba2b9617af01cb45cab344acd57c924d56798': [
{ {
'constant': false, constant: false,
'inputs': [ inputs: [
{ {
'name': '_p', name: '_p',
'type': 'uint256' type: 'uint256'
} }
], ],
'name': 'set', name: 'set',
'outputs': [], outputs: [],
'payable': false, payable: false,
'stateMutability': 'nonpayable', stateMutability: 'nonpayable',
'type': 'function' type: 'function'
}, },
{ {
'inputs': [ inputs: [
{ {
'name': 'p', name: 'p',
'type': 'uint256' type: 'uint256'
} }
], ],
'payable': false, payable: false,
'stateMutability': 'nonpayable', stateMutability: 'nonpayable',
'type': 'constructor' type: 'constructor'
} }
] ]
} }

@ -1,5 +1,5 @@
'use strict' 'use strict'
import { NightwatchBrowser } from "nightwatch" import { NightwatchBrowser } from 'nightwatch'
import init from '../helpers/init' import init from '../helpers/init'
import sauce from './sauce' import sauce from './sauce'
@ -21,20 +21,20 @@ const gmbhTestContract = `contract gmbh {
` `
const sources = [ const sources = [
{ {
'localhost/folder1/contract2.sol': {content: 'contract test2 { function get () public returns (uint) { return 11; }}'} 'localhost/folder1/contract2.sol': { content: 'contract test2 { function get () public returns (uint) { return 11; }}' }
}, },
{ {
'localhost/src/gmbh/company.sol': {content: assetsTestContract} 'localhost/src/gmbh/company.sol': { content: assetsTestContract }
}, },
{ {
'localhost/src/gmbh/company.sol': {content: assetsTestContract}, 'localhost/src/gmbh/company.sol': { content: assetsTestContract },
'localhost/src/gmbh/contract.sol': {content: gmbhTestContract} 'localhost/src/gmbh/contract.sol': { content: gmbhTestContract }
}, },
{ {
'browser/test_import_node_modules.sol': {content: 'import "openzeppelin-solidity/contracts/math/SafeMath.sol";'} 'browser/test_import_node_modules.sol': { content: 'import "openzeppelin-solidity/contracts/math/SafeMath.sol";' }
}, },
{ {
'browser/test_import_node_modules_with_github_import.sol': {content: 'import "openzeppelin-solidity/contracts/sample.sol";'} 'browser/test_import_node_modules_with_github_import.sol': { content: 'import "openzeppelin-solidity/contracts/sample.sol";' }
} }
] ]
@ -47,7 +47,7 @@ module.exports = {
return sources return sources
}, },
'Remixd': function (browser) { Remixd: function (browser) {
runTests(browser) runTests(browser)
}, },
'Import from node_modules ': function (browser) { 'Import from node_modules ': function (browser) {

@ -1,6 +1,5 @@
'use strict' 'use strict'
import { doesNotThrow } from 'assert' import { NightwatchBrowser } from 'nightwatch'
import { NightwatchBrowser } from "nightwatch"
import init from '../helpers/init' import init from '../helpers/init'
import sauce from './sauce' import sauce from './sauce'
@ -196,9 +195,9 @@ module.exports = {
'Call web3.eth.getAccounts() using Injected web3 (Metamask)': '' + function (browser: NightwatchBrowser) { 'Call web3.eth.getAccounts() using Injected web3 (Metamask)': '' + function (browser: NightwatchBrowser) {
browser browser
.executeScript(`web3.eth.getAccounts()`) .executeScript('web3.eth.getAccounts()')
.pause(2000) .pause(2000)
.journalLastChildIncludes(`[ "0x76a3ABb5a12dcd603B52Ed22195dED17ee82708f" ]`) .journalLastChildIncludes('[ "0x76a3ABb5a12dcd603B52Ed22195dED17ee82708f" ]')
.end() .end()
}, },
tearDown: sauce tearDown: sauce

@ -1,5 +1,5 @@
'use strict' 'use strict'
import { NightwatchBrowser } from "nightwatch" import { NightwatchBrowser } from 'nightwatch'
import init from '../helpers/init' import init from '../helpers/init'
import sauce from './sauce' import sauce from './sauce'
@ -57,7 +57,8 @@ module.exports = {
const sources = [ const sources = [
{ {
'browser/signMassage.sol': {content: ` 'browser/signMassage.sol': {
content: `
pragma solidity >=0.4.22 <0.8.0; pragma solidity >=0.4.22 <0.8.0;
contract SignMassageTest { contract SignMassageTest {
function testRecovery(bytes32 h, uint8 v, bytes32 r, bytes32 s) public pure returns (address) { function testRecovery(bytes32 h, uint8 v, bytes32 r, bytes32 s) public pure returns (address) {
@ -95,6 +96,7 @@ const sources = [
function ecverify(bytes32 hash, bytes memory sig, address signer) public pure returns (bool) { function ecverify(bytes32 hash, bytes memory sig, address signer) public pure returns (bool) {
return signer == ecrecovery(hash, sig); return signer == ecrecovery(hash, sig);
} }
}`} }`
}
} }
] ]

@ -1,5 +1,5 @@
'use strict' 'use strict'
import { NightwatchBrowser } from "nightwatch" import { NightwatchBrowser } from 'nightwatch'
import init from '../helpers/init' import init from '../helpers/init'
import sauce from './sauce' import sauce from './sauce'
@ -34,7 +34,7 @@ module.exports = {
.setSolidityCompilerVersion('soljson-v0.8.0+commit.c7dfd78e.js') // open-zeppelin moved to pragma ^0.8.0 (master branch) .setSolidityCompilerVersion('soljson-v0.8.0+commit.c7dfd78e.js') // open-zeppelin moved to pragma ^0.8.0 (master branch)
.addFile('Untitled4.sol', sources[3]['browser/Untitled4.sol']) .addFile('Untitled4.sol', sources[3]['browser/Untitled4.sol'])
.clickLaunchIcon('fileExplorers') .clickLaunchIcon('fileExplorers')
.verifyContracts(['test7', 'ERC20'], {wait: 10000}) .verifyContracts(['test7', 'ERC20'], { wait: 10000 })
}, },
'Test Github Import - from other branch': function (browser: NightwatchBrowser) { 'Test Github Import - from other branch': function (browser: NightwatchBrowser) {
@ -42,7 +42,7 @@ module.exports = {
.setSolidityCompilerVersion('soljson-v0.5.0+commit.1d4f565a.js') // switch back to 0.5.0 : release-v2.3.0 branch is not solidity 0.6 compliant .setSolidityCompilerVersion('soljson-v0.5.0+commit.1d4f565a.js') // switch back to 0.5.0 : release-v2.3.0 branch is not solidity 0.6 compliant
.addFile('Untitled5.sol', sources[4]['browser/Untitled5.sol']) .addFile('Untitled5.sol', sources[4]['browser/Untitled5.sol'])
.clickLaunchIcon('fileExplorers') .clickLaunchIcon('fileExplorers')
.verifyContracts(['test8', 'ERC20', 'SafeMath'], {wait: 10000}) .verifyContracts(['test8', 'ERC20', 'SafeMath'], { wait: 10000 })
}, },
'Test Github Import - no branch specified': function (browser: NightwatchBrowser) { 'Test Github Import - no branch specified': function (browser: NightwatchBrowser) {
@ -52,7 +52,7 @@ module.exports = {
.click('li[data-id="treeViewLitreeViewItembrowser/README.txt"') .click('li[data-id="treeViewLitreeViewItembrowser/README.txt"')
.addFile('Untitled6.sol', sources[5]['browser/Untitled6.sol']) .addFile('Untitled6.sol', sources[5]['browser/Untitled6.sol'])
.clickLaunchIcon('fileExplorers') .clickLaunchIcon('fileExplorers')
.verifyContracts(['test10', 'ERC20'], {wait: 10000}) .verifyContracts(['test10', 'ERC20'], { wait: 10000 })
}, },
'Test Github Import - raw URL': function (browser: NightwatchBrowser) { 'Test Github Import - raw URL': function (browser: NightwatchBrowser) {
@ -61,7 +61,7 @@ module.exports = {
.click('li[data-id="treeViewLitreeViewItembrowser/README.txt"') .click('li[data-id="treeViewLitreeViewItembrowser/README.txt"')
.addFile('Untitled7.sol', sources[6]['browser/Untitled7.sol']) .addFile('Untitled7.sol', sources[6]['browser/Untitled7.sol'])
.clickLaunchIcon('fileExplorers') .clickLaunchIcon('fileExplorers')
.verifyContracts(['test11', 'ERC20'], {wait: 10000}) .verifyContracts(['test11', 'ERC20'], { wait: 10000 })
}, },
'Test switch to a github import from a solidity warning': function (browser: NightwatchBrowser) { 'Test switch to a github import from a solidity warning': function (browser: NightwatchBrowser) {
@ -76,7 +76,7 @@ module.exports = {
.scrollAndClick('[data-id="compiledErrors"] div:nth-child(3)') // click on error which point to ERC20 code .scrollAndClick('[data-id="compiledErrors"] div:nth-child(3)') // click on error which point to ERC20 code
.pause(5000) .pause(5000)
.getEditorValue((content) => { .getEditorValue((content) => {
browser.assert.ok(content.indexOf(`contract ERC20 is Context, IERC20`) != -1, browser.assert.ok(content.indexOf('contract ERC20 is Context, IERC20') !== -1,
'current displayed content should be from the ERC20 source code') 'current displayed content should be from the ERC20 source code')
}) })
.end() .end()
@ -86,28 +86,28 @@ module.exports = {
const sources = [ const sources = [
{ {
'browser/Untitled.sol': {content: 'contract test1 {} contract test2 {}'} 'browser/Untitled.sol': { content: 'contract test1 {} contract test2 {}' }
}, },
{ {
'browser/Untitled1.sol': {content: 'import "./Untitled2.sol"; contract test6 {}'}, 'browser/Untitled1.sol': { content: 'import "./Untitled2.sol"; contract test6 {}' },
'browser/Untitled2.sol': {content: 'contract test4 {} contract test5 {}'} 'browser/Untitled2.sol': { content: 'contract test4 {} contract test5 {}' }
}, },
{ {
'browser/Untitled3.sol': {content: 'import "./Untitled11.sol"; contract test6 {}'} 'browser/Untitled3.sol': { content: 'import "./Untitled11.sol"; contract test6 {}' }
}, },
{ {
'browser/Untitled4.sol': {content: 'import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/ERC20.sol"; contract test7 {}'} 'browser/Untitled4.sol': { content: 'import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/ERC20.sol"; contract test7 {}' }
}, },
{ {
'browser/Untitled5.sol': {content: 'import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/release-v2.3.0/contracts/token/ERC20/ERC20.sol"; contract test8 {}'} 'browser/Untitled5.sol': { content: 'import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/release-v2.3.0/contracts/token/ERC20/ERC20.sol"; contract test8 {}' }
}, },
{ {
'browser/Untitled6.sol': {content: 'import "https://github.com/OpenZeppelin/openzeppelin-contracts/contracts/token/ERC20/ERC20.sol"; contract test10 {}'} 'browser/Untitled6.sol': { content: 'import "https://github.com/OpenZeppelin/openzeppelin-contracts/contracts/token/ERC20/ERC20.sol"; contract test10 {}' }
}, },
{ {
'browser/Untitled7.sol': {content: 'import "https://raw.githubusercontent.com/OpenZeppelin/openzeppelin-contracts/master/contracts/token/ERC20/ERC20.sol"; contract test11 {}'} 'browser/Untitled7.sol': { content: 'import "https://raw.githubusercontent.com/OpenZeppelin/openzeppelin-contracts/master/contracts/token/ERC20/ERC20.sol"; contract test11 {}' }
}, },
{ {
'browser/Untitled8.sol': {content: 'import "https://raw.githubusercontent.com/OpenZeppelin/openzeppelin-contracts/master/contracts/token/ERC20/ERC20.sol"; contract test12 {}'} 'browser/Untitled8.sol': { content: 'import "https://raw.githubusercontent.com/OpenZeppelin/openzeppelin-contracts/master/contracts/token/ERC20/ERC20.sol"; contract test12 {}' }
} }
] ]

@ -1,6 +1,6 @@
'use strict' 'use strict'
import { NightwatchBrowser } from "nightwatch" import { NightwatchBrowser } from 'nightwatch'
import init from '../helpers/init' import init from '../helpers/init'
import sauce from './sauce' import sauce from './sauce'
@ -140,7 +140,7 @@ module.exports = {
.scrollAndClick('*[data-id="testTabRunTestsTabRunAction"]') .scrollAndClick('*[data-id="testTabRunTestsTabRunAction"]')
.waitForElementPresent('*[data-id="testTabSolidityUnitTestsOutputheader"]', 40000) .waitForElementPresent('*[data-id="testTabSolidityUnitTestsOutputheader"]', 40000)
.waitForElementPresent('*[data-id="testTabSolidityUnitTestsOutput"]') .waitForElementPresent('*[data-id="testTabSolidityUnitTestsOutput"]')
.assert.containsText('*[data-id="testTabSolidityUnitTestsOutput"]', `Method 'add' can not have parameters inside a test contract`) .assert.containsText('*[data-id="testTabSolidityUnitTestsOutput"]', 'Method \'add\' can not have parameters inside a test contract')
}, },
'Changing current path': function (browser: NightwatchBrowser) { 'Changing current path': function (browser: NightwatchBrowser) {

@ -1,5 +1,5 @@
'use strict' 'use strict'
import { NightwatchBrowser } from "nightwatch" import { NightwatchBrowser } from 'nightwatch'
import init from '../helpers/init' import init from '../helpers/init'
import sauce from './sauce' import sauce from './sauce'
@ -45,7 +45,7 @@ module.exports = {
browser.sendLowLevelTx(address, '0', '0xa') browser.sendLowLevelTx(address, '0', '0xa')
.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)
}) })
}) })
@ -57,7 +57,7 @@ module.exports = {
browser.sendLowLevelTx(address, '0', '0x1aa') browser.sendLowLevelTx(address, '0', '0x1aa')
.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)
}) })
}) })
@ -112,7 +112,7 @@ module.exports = {
browser.sendLowLevelTx(address, '0', '0xaa') browser.sendLowLevelTx(address, '0', '0xaa')
.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)
}) })
}) })
@ -160,7 +160,7 @@ module.exports = {
browser.sendLowLevelTx(address, '1', '') browser.sendLowLevelTx(address, '1', '')
.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)
}) })
}) })
@ -215,7 +215,7 @@ module.exports = {
browser.sendLowLevelTx(address, '0', '') browser.sendLowLevelTx(address, '0', '')
.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)
}) })
}) })

@ -1,11 +1,12 @@
'use strict' 'use strict'
import { NightwatchBrowser } from "nightwatch" import { NightwatchBrowser } from 'nightwatch'
import init from '../helpers/init' import init from '../helpers/init'
import sauce from './sauce' import sauce from './sauce'
const sources = [ const sources = [
{ {
'browser/Untitled.sol': {content: ` 'browser/Untitled.sol': {
content: `
pragma solidity >=0.6.0 <0.8.0; pragma solidity >=0.6.0 <0.8.0;
contract test1 { address test = tx.origin; } contract test1 { address test = tx.origin; }
contract test2 {} contract test2 {}
@ -16,7 +17,9 @@ contract TooMuchGas {
uint test; uint test;
uint test1; uint test1;
} }
}`}} }`
}
}
] ]
module.exports = { module.exports = {
@ -44,7 +47,7 @@ function runTests (browser: NightwatchBrowser) {
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".',
'TooMuchGas.() : Variables have very similar names "test" and "test1".' ], 'TooMuchGas.() : Variables have very similar names "test" and "test1".'],
'#staticanalysisresult .warning', '#staticanalysisresult .warning',
browser, function () { browser, function () {
browser.end() browser.end()

@ -1,5 +1,5 @@
'use strict' 'use strict'
import { NightwatchBrowser } from "nightwatch" import { NightwatchBrowser } from 'nightwatch'
import init from '../helpers/init' import init from '../helpers/init'
import sauce from './sauce' import sauce from './sauce'
@ -46,7 +46,7 @@ module.exports = {
browser browser
.addFile('asyncAwait.js', { content: asyncAwait }) .addFile('asyncAwait.js', { content: asyncAwait })
.openFile('browser/asyncAwait.js') .openFile('browser/asyncAwait.js')
.executeScript(`remix.execute('browser/asyncAwait.js')`) .executeScript('remix.execute(\'browser/asyncAwait.js\')')
.journalLastChild('Waiting Promise') .journalLastChild('Waiting Promise')
.pause(5500) .pause(5500)
.journalLastChild('result - Promise Resolved') .journalLastChild('result - Promise Resolved')
@ -57,16 +57,16 @@ module.exports = {
.addFile('asyncAwaitWithFileManagerAccess.js', { content: asyncAwaitWithFileManagerAccess }) .addFile('asyncAwaitWithFileManagerAccess.js', { content: asyncAwaitWithFileManagerAccess })
.openFile('browser/asyncAwaitWithFileManagerAccess.js') .openFile('browser/asyncAwaitWithFileManagerAccess.js')
.pause(5000) .pause(5000)
.executeScript(`remix.execute('browser/asyncAwaitWithFileManagerAccess.js')`) .executeScript('remix.execute(\'browser/asyncAwaitWithFileManagerAccess.js\')')
.pause(6000) .pause(6000)
.journalLastChildIncludes('contract Ballot {') .journalLastChildIncludes('contract Ballot {')
}, },
'Call web3.eth.getAccounts() using JavaScript VM': function (browser: NightwatchBrowser) { 'Call web3.eth.getAccounts() using JavaScript VM': function (browser: NightwatchBrowser) {
browser browser
.executeScript(`web3.eth.getAccounts()`) .executeScript('web3.eth.getAccounts()')
.pause(2000) .pause(2000)
.journalLastChildIncludes(`[ "0x5B38Da6a701c568545dCfcB03FcB875f56beddC4", "0xAb8483F64d9C6d1EcF9b849Ae677dD3315835cb2", "0x4B20993Bc481177ec7E8f571ceCaE8A9e22C02db", "0x78731D3Ca6b7E34aC0F824c42a7cC18A495cabaB", "0x617F2E2fD72FD9D5503197092aC168c91465E7f2", "0x17F6AD8Ef982297579C203069C1DbfFE4348c372", "0x5c6B0f7Bf3E7ce046039Bd8FABdfD3f9F5021678", "0x03C6FcED478cBbC9a4FAB34eF9f40767739D1Ff7", "0x1aE0EA34a72D944a8C7603FfB3eC30a6669E454C", "0x0A098Eda01Ce92ff4A4CCb7A4fFFb5A43EBC70DC", "0xCA35b7d915458EF540aDe6068dFe2F44E8fa733c", "0x14723A09ACff6D2A60DcdF7aA4AFf308FDDC160C", "0x4B0897b0513fdC7C541B6d9D7E929C4e5364D2dB", "0x583031D1113aD414F02576BD6afaBfb302140225", "0xdD870fA1b7C4700F2BD7f44238821C26f7392148" ]`) .journalLastChildIncludes('[ "0x5B38Da6a701c568545dCfcB03FcB875f56beddC4", "0xAb8483F64d9C6d1EcF9b849Ae677dD3315835cb2", "0x4B20993Bc481177ec7E8f571ceCaE8A9e22C02db", "0x78731D3Ca6b7E34aC0F824c42a7cC18A495cabaB", "0x617F2E2fD72FD9D5503197092aC168c91465E7f2", "0x17F6AD8Ef982297579C203069C1DbfFE4348c372", "0x5c6B0f7Bf3E7ce046039Bd8FABdfD3f9F5021678", "0x03C6FcED478cBbC9a4FAB34eF9f40767739D1Ff7", "0x1aE0EA34a72D944a8C7603FfB3eC30a6669E454C", "0x0A098Eda01Ce92ff4A4CCb7A4fFFb5A43EBC70DC", "0xCA35b7d915458EF540aDe6068dFe2F44E8fa733c", "0x14723A09ACff6D2A60DcdF7aA4AFf308FDDC160C", "0x4B0897b0513fdC7C541B6d9D7E929C4e5364D2dB", "0x583031D1113aD414F02576BD6afaBfb302140225", "0xdD870fA1b7C4700F2BD7f44238821C26f7392148" ]')
}, },
'Call web3.eth.getAccounts() using Web3 Provider': function (browser: NightwatchBrowser) { 'Call web3.eth.getAccounts() using Web3 Provider': function (browser: NightwatchBrowser) {
@ -75,9 +75,9 @@ module.exports = {
.clickLaunchIcon('udapp') .clickLaunchIcon('udapp')
.click('*[data-id="settingsWeb3Mode"]') .click('*[data-id="settingsWeb3Mode"]')
.modalFooterOKClick() .modalFooterOKClick()
.executeScript(`web3.eth.getAccounts()`) .executeScript('web3.eth.getAccounts()')
.pause(2000) .pause(2000)
.journalLastChildIncludes(`[ "`) // we check if an array is present, don't need to check for the content .journalLastChildIncludes('[ "') // we check if an array is present, don't need to check for the content
.journalLastChildIncludes('" ]') .journalLastChildIncludes('" ]')
.journalLastChildIncludes('", "') .journalLastChildIncludes('", "')
}, },
@ -88,7 +88,7 @@ module.exports = {
.addFile('resolveExternalUrlAndSave.js', { content: resolveExternalUrlAndSave }) .addFile('resolveExternalUrlAndSave.js', { content: resolveExternalUrlAndSave })
.openFile('browser/resolveExternalUrlAndSave.js') .openFile('browser/resolveExternalUrlAndSave.js')
.pause(1000) .pause(1000)
.executeScript(`remix.execute('browser/resolveExternalUrlAndSave.js')`) .executeScript('remix.execute(\'browser/resolveExternalUrlAndSave.js\')')
.pause(6000) .pause(6000)
.journalLastChildIncludes('Implementation of the {IERC20} interface.') .journalLastChildIncludes('Implementation of the {IERC20} interface.')
.openFile('browser/github/OpenZeppelin/openzeppelin-contracts/contracts/token/ERC20/ERC20.sol') .openFile('browser/github/OpenZeppelin/openzeppelin-contracts/contracts/token/ERC20/ERC20.sol')
@ -100,7 +100,7 @@ module.exports = {
.addFile('resolveUrl.js', { content: resolveUrl }) .addFile('resolveUrl.js', { content: resolveUrl })
.openFile('browser/resolveUrl.js') .openFile('browser/resolveUrl.js')
.pause(1000) .pause(1000)
.executeScript(`remix.execute('browser/resolveUrl.js')`) .executeScript('remix.execute(\'browser/resolveUrl.js\')')
.pause(6000) .pause(6000)
.journalLastChildIncludes('contract Ballot {') .journalLastChildIncludes('contract Ballot {')
}, },
@ -111,14 +111,13 @@ module.exports = {
.addFile('resolveExternalUrlAndSaveToaPath.js', { content: resolveExternalUrlAndSaveToaPath }) .addFile('resolveExternalUrlAndSaveToaPath.js', { content: resolveExternalUrlAndSaveToaPath })
.openFile('browser/resolveExternalUrlAndSaveToaPath.js') .openFile('browser/resolveExternalUrlAndSaveToaPath.js')
.pause(1000) .pause(1000)
.executeScript(`remix.execute('browser/resolveExternalUrlAndSaveToaPath.js')`) .executeScript('remix.execute(\'browser/resolveExternalUrlAndSaveToaPath.js\')')
.pause(6000) .pause(6000)
.journalLastChildIncludes('abstract contract ERC20Burnable') .journalLastChildIncludes('abstract contract ERC20Burnable')
.openFile('browser/github/newFile.sol') .openFile('browser/github/newFile.sol')
.end() .end()
}, },
tearDown: sauce tearDown: sauce
} }

@ -1,5 +1,5 @@
'use strict' 'use strict'
import { NightwatchBrowser } from "nightwatch" import { NightwatchBrowser } from 'nightwatch'
import init from '../helpers/init' import init from '../helpers/init'
import sauce from './sauce' import sauce from './sauce'
@ -25,7 +25,7 @@ module.exports = {
{ {
status: 'true Transaction mined and execution succeed', status: 'true Transaction mined and execution succeed',
'transaction hash': '0x38bb944fa4709ed9e163d6c670259f97284b4defd916d512a2fcc3f35bb53e03', 'transaction hash': '0x38bb944fa4709ed9e163d6c670259f97284b4defd916d512a2fcc3f35bb53e03',
'decoded output': { '0': 'uint256: 8' } 'decoded output': { 0: 'uint256: 8' }
}) })
.pause(500) .pause(500)
.checkTerminalFilter('0x12332162e2e31397dc1e07ed0a1cf08f728e9b4487c6f9ed79d2f39410c92782', '') .checkTerminalFilter('0x12332162e2e31397dc1e07ed0a1cf08f728e9b4487c6f9ed79d2f39410c92782', '')
@ -35,10 +35,10 @@ module.exports = {
status: 'true Transaction mined and execution succeed', status: 'true Transaction mined and execution succeed',
'transaction hash': '0xab4f794ca0b531f27fc6eace623666b440facbf20e77615a057d728c67b500f0', 'transaction hash': '0xab4f794ca0b531f27fc6eace623666b440facbf20e77615a057d728c67b500f0',
'decoded output': { 'decoded output': {
'0': 'uint256: 345', 0: 'uint256: 345',
'1': 'string: comment_comment_', 1: 'string: comment_comment_',
'2': 'bool: true', 2: 'bool: true',
'3': 'uint256: 4' 3: 'uint256: 4'
} }
}) })
.click('*[data-id="deployAndRunClearInstances"]') .click('*[data-id="deployAndRunClearInstances"]')
@ -56,10 +56,10 @@ module.exports = {
status: 'true Transaction mined and execution succeed', status: 'true Transaction mined and execution succeed',
'transaction hash': '0x09c6716a67f0f8c7a0ca2b3ddf59c25982da856a95aefd640b767f9b9feee39d', 'transaction hash': '0x09c6716a67f0f8c7a0ca2b3ddf59c25982da856a95aefd640b767f9b9feee39d',
'decoded output': { 'decoded output': {
'0': 'bool: _b true', 0: 'bool: _b true',
'1': 'uint256: _u 345', 1: 'uint256: _u 345',
'2': 'int256: _i -345', 2: 'int256: _i -345',
'3': 'address: _a 0xCA35b7d915458EF540aDe6068dFe2F44E8fa733c' 3: 'address: _a 0xCA35b7d915458EF540aDe6068dFe2F44E8fa733c'
} }
}) })
.clickFunction('retunValues2 - transact (not payable)') .clickFunction('retunValues2 - transact (not payable)')
@ -68,16 +68,16 @@ module.exports = {
status: 'true Transaction mined and execution succeed', status: 'true Transaction mined and execution succeed',
'transaction hash': '0xe884953e0695399d60914af3e1ea2dad59fe41f3c0c20665c130fa40dd0fb6bf', 'transaction hash': '0xe884953e0695399d60914af3e1ea2dad59fe41f3c0c20665c130fa40dd0fb6bf',
'decoded output': { 'decoded output': {
'0': 'bytes1: _b 0x12', 0: 'bytes1: _b 0x12',
'1': 'bytes2: _b2 0x1223', 1: 'bytes2: _b2 0x1223',
'2': 'bytes3: _b3 0x000000', 2: 'bytes3: _b3 0x000000',
'3': 'bytes: _blit 0x123498', 3: 'bytes: _blit 0x123498',
'4': 'bytes5: _b5 0x0432450000', 4: 'bytes5: _b5 0x0432450000',
'5': 'bytes6: _b6 0x234553253200', 5: 'bytes6: _b6 0x234553253200',
'6': 'string: _str this is a long string _ this is a long string _ this is a long string _ this is a long string _ this is a long string _ this is a long string _ this is a long string _ this is a long string _ this is a long string _ this is a long string _ this is a long string _ this is a long string _ this is a long string _ this is a long string _ this is a long string', 6: 'string: _str this is a long string _ this is a long string _ this is a long string _ this is a long string _ this is a long string _ this is a long string _ this is a long string _ this is a long string _ this is a long string _ this is a long string _ this is a long string _ this is a long string _ this is a long string _ this is a long string _ this is a long string',
'7': 'bytes7: _b7 0x03252353253253', 7: 'bytes7: _b7 0x03252353253253',
'8': 'bytes22: _b22 0x32523523532532532523532500000000000000000000', 8: 'bytes22: _b22 0x32523523532532532523532500000000000000000000',
'9': 'bytes32: _b32 0x0325235325325235325235325235320000000000000000000000000000000000' 9: 'bytes32: _b32 0x0325235325325235325235325235320000000000000000000000000000000000'
} }
}).pause(500) }).pause(500)
.clickFunction('retunValues3 - transact (not payable)') .clickFunction('retunValues3 - transact (not payable)')
@ -86,8 +86,8 @@ module.exports = {
status: 'true Transaction mined and execution succeed', status: 'true Transaction mined and execution succeed',
'transaction hash': '0xb4108649d5e65a4a0776d6ac98c2c356540a7e99d641705a82352a845d467eb5', 'transaction hash': '0xb4108649d5e65a4a0776d6ac98c2c356540a7e99d641705a82352a845d467eb5',
'decoded output': { 'decoded output': {
'0': 'uint8: _en 2', 0: 'uint8: _en 2',
'1': 'int256[5][]: _a1 1,-45,-78,56,60,-1,42,334,-45455,-446,1,10,-5435,45,-7' 1: 'int256[5][]: _a1 1,-45,-78,56,60,-1,42,334,-45455,-446,1,10,-5435,45,-7'
} }
}).click('*[data-id="deployAndRunClearInstances"]') }).click('*[data-id="deployAndRunClearInstances"]')
}, },
@ -98,40 +98,40 @@ module.exports = {
.click('#runTabView button[class^="instanceButton"]') .click('#runTabView button[class^="instanceButton"]')
.waitForElementPresent('.instance:nth-of-type(2)') .waitForElementPresent('.instance:nth-of-type(2)')
.click('.instance:nth-of-type(2) > div > button') .click('.instance:nth-of-type(2) > div > button')
.clickFunction('inputValue1 - transact (not payable)', {types: 'uint256 _u, int256 _i, string _str', values: '"2343242", "-4324324", "string _ string _ string _ string _ string _ string _ string _ string _ string _ string _"'}) .clickFunction('inputValue1 - transact (not payable)', { types: 'uint256 _u, int256 _i, string _str', values: '"2343242", "-4324324", "string _ string _ string _ string _ string _ string _ string _ string _ string _ string _"' })
.testFunction('0xe9678b5486674a0425301a1d7e925c22cfb9f7f7ec6242697d742009f7ef5b97', .testFunction('0xe9678b5486674a0425301a1d7e925c22cfb9f7f7ec6242697d742009f7ef5b97',
{ {
status: 'true Transaction mined and execution succeed', status: 'true Transaction mined and execution succeed',
'transaction hash': '0xe9678b5486674a0425301a1d7e925c22cfb9f7f7ec6242697d742009f7ef5b97', 'transaction hash': '0xe9678b5486674a0425301a1d7e925c22cfb9f7f7ec6242697d742009f7ef5b97',
'decoded output': { 'decoded output': {
'0': 'uint256: _uret 2343242', 0: 'uint256: _uret 2343242',
'1': 'int256: _iret -4324324', 1: 'int256: _iret -4324324',
'2': 'string: _strret string _ string _ string _ string _ string _ string _ string _ string _ string _ string _' 2: 'string: _strret string _ string _ string _ string _ string _ string _ string _ string _ string _ string _'
} }
}) })
.pause(500) .pause(500)
.clickFunction('inputValue2 - transact (not payable)', {types: 'uint256[3] _n, bytes8[4] _b8', values: '[1,2,3], ["0x1234000000000000", "0x1234000000000000","0x1234000000000000","0x1234000000000000"]'}) .clickFunction('inputValue2 - transact (not payable)', { types: 'uint256[3] _n, bytes8[4] _b8', values: '[1,2,3], ["0x1234000000000000", "0x1234000000000000","0x1234000000000000","0x1234000000000000"]' })
.testFunction('0x21724b08c3699bda8375803f8dc842194aea370f2aac284e55144b452dca321f', { .testFunction('0x21724b08c3699bda8375803f8dc842194aea370f2aac284e55144b452dca321f', {
status: 'true Transaction mined and execution succeed', status: 'true Transaction mined and execution succeed',
'transaction hash': '0x21724b08c3699bda8375803f8dc842194aea370f2aac284e55144b452dca321f', 'transaction hash': '0x21724b08c3699bda8375803f8dc842194aea370f2aac284e55144b452dca321f',
'decoded output': { 'decoded output': {
'0': 'uint256[3]: _nret 1,2,3', 0: 'uint256[3]: _nret 1,2,3',
'1': 'bytes8[4]: _b8ret 0x1234000000000000,0x1234000000000000,0x1234000000000000,0x1234000000000000' 1: 'bytes8[4]: _b8ret 0x1234000000000000,0x1234000000000000,0x1234000000000000,0x1234000000000000'
}, },
logs: [ logs: [
{ {
'from': '0x8c1eD7e19abAa9f23c476dA86Dc1577F1Ef401f5', from: '0x8c1eD7e19abAa9f23c476dA86Dc1577F1Ef401f5',
'topic': '0xd30981760edbf605bda8689e945f622877f230c9a77cbfbd448aa4b7d8ac6e7f', topic: '0xd30981760edbf605bda8689e945f622877f230c9a77cbfbd448aa4b7d8ac6e7f',
'event': 'event1', event: 'event1',
'args': { args: {
'0': '-123', 0: '-123',
'1': '123', 1: '123',
'2': { 2: {
"_isIndexed":true, _isIndexed: true,
'hash': '0x9c22ff5f21f0b81b113e63f7db6da94fedef11b2119b4088b89664fb9a3cb658' hash: '0x9c22ff5f21f0b81b113e63f7db6da94fedef11b2119b4088b89664fb9a3cb658'
}, },
'3': '0x12340000', 3: '0x12340000',
'4': 'test _ test _ test _ test test _ test test _ test test _ test test _ test test _ test test _ test ' 4: 'test _ test _ test _ test test _ test test _ test test _ test test _ test test _ test test _ test '
} }
} }
] ]
@ -154,15 +154,21 @@ module.exports = {
// @TODO test: bytes8[3][] type as input // @TODO test: bytes8[3][] type as input
const sources = [ const sources = [
{'browser/Untitled.sol': {content: ` {
'browser/Untitled.sol': {
content: `
contract TestContract { function f() public returns (uint) { return 8; } contract TestContract { function f() public returns (uint) { return 8; }
function g() public returns (uint, string memory, bool, uint) { function g() public returns (uint, string memory, bool, uint) {
uint payment = 345; uint payment = 345;
bool payed = true; bool payed = true;
string memory comment = "comment_comment_"; string memory comment = "comment_comment_";
uint month = 4; uint month = 4;
return (payment, comment, payed, month); } }`}}, return (payment, comment, payed, month); } }`
{'browser/returnValues.sol': {content: ` }
},
{
'browser/returnValues.sol': {
content: `
contract testReturnValues { contract testReturnValues {
enum ActionChoices { GoLeft, GoRight, GoStraight, SitStill } enum ActionChoices { GoLeft, GoRight, GoStraight, SitStill }
function retunValues1 () public returns (bool _b, uint _u, int _i, address _a) { function retunValues1 () public returns (bool _b, uint _u, int _i, address _a) {
@ -192,8 +198,12 @@ const sources = [
a[2] = [int(1),10,-5435,45,-7]; a[2] = [int(1),10,-5435,45,-7];
_a1 = a; _a1 = a;
} }
}`}}, }`
{'browser/inputValues.sol': {content: ` }
},
{
'browser/inputValues.sol': {
content: `
contract test { contract test {
event event1(int _i, uint indexed _u, string indexed _str, bytes4 _b, string _notIndexed); event event1(int _i, uint indexed _u, string indexed _str, bytes4 _b, string _notIndexed);
function inputValue1 (uint _u, int _i, string memory _str) public returns (uint _uret, int _iret, string memory _strret) { function inputValue1 (uint _u, int _i, string memory _str) public returns (uint _uret, int _iret, string memory _strret) {
@ -206,11 +216,17 @@ const sources = [
_b8ret = _b8; _b8ret = _b8;
emit event1(-123, 123, "test", hex"1234", "test _ test _ test _ test test _ test test _ test test _ test test _ test test _ test test _ test "); emit event1(-123, 123, "test", hex"1234", "test _ test _ test _ test test _ test test _ test test _ test test _ test test _ test test _ test ");
} }
}`}}, }`
// https://github.com/ethereum/remix-project/issues/404 }
{'browser/eventFunctionInput.sol': {content: ` },
// https://github.com/ethereum/remix-project/issues/404
{
'browser/eventFunctionInput.sol': {
content: `
pragma solidity >= 0.7.0; pragma solidity >= 0.7.0;
contract C { contract C {
event Test(function() external); event Test(function() external);
}`}} }`
}
}
] ]

@ -5,8 +5,8 @@ import sauce from './sauce'
import examples from '../examples/example-contracts' import examples from '../examples/example-contracts'
const sources = [ const sources = [
{'browser/Untitled.sol': {content: examples.ballot.content}}, { 'browser/Untitled.sol': { content: examples.ballot.content } },
{'browser/Untitled1.sol': {content: `contract test {}`}} { 'browser/Untitled1.sol': { content: 'contract test {}' } }
] ]
module.exports = { module.exports = {
@ -28,7 +28,7 @@ module.exports = {
.click('*[data-id="Deploy - transact (not payable)"]') .click('*[data-id="Deploy - transact (not payable)"]')
.waitForElementPresent('*[data-id="universalDappUiContractActionWrapper"]') .waitForElementPresent('*[data-id="universalDappUiContractActionWrapper"]')
.click('*[data-id="universalDappUiTitleExpander"]') .click('*[data-id="universalDappUiTitleExpander"]')
.clickFunction('delegate - transact (not payable)', {types: 'address to', values: '"0x4b0897b0513fdc7c541b6d9d7e929c4e5364d2db"'}) .clickFunction('delegate - transact (not payable)', { types: 'address to', values: '"0x4b0897b0513fdc7c541b6d9d7e929c4e5364d2db"' })
.testFunction('0x41fab8ea5b1d9fba5e0a6545ca1a2d62fff518578802c033c2b9a031a01c31b3', .testFunction('0x41fab8ea5b1d9fba5e0a6545ca1a2d62fff518578802c033c2b9a031a01c31b3',
{ {
status: 'true Transaction mined and execution succeed', status: 'true Transaction mined and execution succeed',
@ -38,7 +38,7 @@ module.exports = {
.clickLaunchIcon('solidity') .clickLaunchIcon('solidity')
.testContracts('Untitled1.sol', sources[1]['browser/Untitled1.sol'], ['test']) .testContracts('Untitled1.sol', sources[1]['browser/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: '' })
.pause(5000) .pause(5000)
.testFunction('0xca58080c8099429caeeffe43b8104df919c2c543dceb9edf9242fa55f045c803', .testFunction('0xca58080c8099429caeeffe43b8104df919c2c543dceb9edf9242fa55f045c803',
{ {

@ -6,7 +6,7 @@ import sauce from './sauce'
import examples from '../examples/example-contracts' import examples from '../examples/example-contracts'
const sources = [ const sources = [
{'browser/Untitled.sol': { content: examples.ballot.content }} { 'browser/Untitled.sol': { content: examples.ballot.content } }
] ]
module.exports = { module.exports = {
@ -22,7 +22,7 @@ module.exports = {
browser browser
.getEditorValue((content) => { .getEditorValue((content) => {
browser.assert.ok(content.indexOf( browser.assert.ok(content.indexOf(
'https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable.sol') != -1, 'https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable.sol') !== -1,
'code has not been loaded') 'code has not been loaded')
}) })
}, },

@ -4,7 +4,9 @@ import init from '../helpers/init'
import sauce from './sauce' import sauce from './sauce'
const sources = [ const sources = [
{'browser/basic.sol': { content: {
'browser/basic.sol': {
content:
`pragma solidity >=0.2.0 <0.7.0; `pragma solidity >=0.2.0 <0.7.0;
/** /**
@ -14,7 +16,8 @@ const sources = [
uint someVar; uint someVar;
constructor() public {} constructor() public {}
}` }`
}} }
}
] ]
module.exports = { module.exports = {
@ -30,7 +33,7 @@ module.exports = {
.clickLaunchIcon('fileExplorers') .clickLaunchIcon('fileExplorers')
.addFile('basic.sol', sources[0]['browser/basic.sol']) .addFile('basic.sol', sources[0]['browser/basic.sol'])
.clickLaunchIcon('solidity') .clickLaunchIcon('solidity')
.execute(function() { .execute(function () {
const elem = document.getElementById('nightlies') as HTMLInputElement const elem = document.getElementById('nightlies') as HTMLInputElement
elem.checked = true elem.checked = true
@ -40,7 +43,7 @@ module.exports = {
.noWorkerErrorFor('soljson-v0.6.8-nightly.2020.5.14+commit.a6d0067b.js') .noWorkerErrorFor('soljson-v0.6.8-nightly.2020.5.14+commit.a6d0067b.js')
.noWorkerErrorFor('soljson-v0.6.0-nightly.2019.12.17+commit.d13438ee.js') .noWorkerErrorFor('soljson-v0.6.0-nightly.2019.12.17+commit.d13438ee.js')
.noWorkerErrorFor('soljson-v0.4.26+commit.4563c3fc.js') .noWorkerErrorFor('soljson-v0.4.26+commit.4563c3fc.js')
.execute(function() { .execute(function () {
const elem = document.getElementById('nightlies') as HTMLInputElement const elem = document.getElementById('nightlies') as HTMLInputElement
elem.checked = false elem.checked = false

@ -8,7 +8,7 @@ module.exports = {
init(browser, done, 'http://127.0.0.1:8080?activate=solidity,udapp&call=fileManager//open//contracts/3_Ballot.sol&deactivate=home', false) init(browser, done, 'http://127.0.0.1:8080?activate=solidity,udapp&call=fileManager//open//contracts/3_Ballot.sol&deactivate=home', false)
}, },
'CheckSolidityActivatedAndUDapp': function (browser: NightwatchBrowser) { CheckSolidityActivatedAndUDapp: function (browser: NightwatchBrowser) {
browser browser
.waitForElementVisible('#icon-panel', 10000) .waitForElementVisible('#icon-panel', 10000)
.clickLaunchIcon('solidity') .clickLaunchIcon('solidity')
@ -19,7 +19,7 @@ module.exports = {
browser browser
.pause(5000) .pause(5000)
.getEditorValue((content) => { .getEditorValue((content) => {
browser.assert.ok(content.indexOf('contract Ballot {') != -1, 'content doesn\'t include Ballot contract') browser.assert.ok(content.indexOf('contract Ballot {') !== -1, 'content doesn\'t include Ballot contract')
}) })
}, },

Loading…
Cancel
Save