Merge branch 'master' into yann300-patch-36

pull/5370/head
bunsenstraat 3 years ago committed by GitHub
commit e7579dba9a
  1. 272
      .circleci/config.yml
  2. 2
      .gitignore
  3. 35
      apps/remix-ide-e2e/nightwatch.ts
  4. 4
      apps/remix-ide-e2e/seleniumConfig.js
  5. 33
      apps/remix-ide-e2e/src/buildGroupTests.js
  6. 15
      apps/remix-ide-e2e/src/checkGroupTests.js
  7. 14
      apps/remix-ide-e2e/src/commands/clearConsole.ts
  8. 24
      apps/remix-ide-e2e/src/commands/clearTransactions.ts
  9. 12
      apps/remix-ide-e2e/src/helpers/buildgrouptest.ts
  10. 47
      apps/remix-ide-e2e/src/select_tests.sh
  11. 0
      apps/remix-ide-e2e/src/tests/ballot_0_4_11.test.ts
  12. 11
      apps/remix-ide-e2e/src/tests/compiler_api.test.ts
  13. 67
      apps/remix-ide-e2e/src/tests/debugger.test.ts
  14. 30
      apps/remix-ide-e2e/src/tests/fileManager_api.test.ts
  15. 0
      apps/remix-ide-e2e/src/tests/gist.test.ts
  16. 73
      apps/remix-ide-e2e/src/tests/plugin_api.ts
  17. 0
      apps/remix-ide-e2e/src/tests/recorder.test.ts
  18. 25
      apps/remix-ide-e2e/src/tests/remixd.test.ts
  19. 22
      apps/remix-ide-e2e/src/tests/runAndDeploy.test.ts
  20. 19
      apps/remix-ide-e2e/src/tests/solidityImport.test.ts
  21. 6
      apps/remix-ide-e2e/src/tests/solidityImport_group1.spec.ts
  22. 68
      apps/remix-ide-e2e/src/tests/solidityUnittests.test.ts
  23. 53
      apps/remix-ide-e2e/src/tests/specialFunctions.test.ts
  24. 0
      apps/remix-ide-e2e/src/tests/staticAnalysis.test.ts
  25. 47
      apps/remix-ide-e2e/src/tests/terminal.test.ts
  26. 19
      apps/remix-ide-e2e/src/tests/transactionExecution.test.ts
  27. 0
      apps/remix-ide-e2e/src/tests/verticalIconsPanel.test.ts
  28. 2
      apps/remix-ide-e2e/src/types/index.d.ts
  29. 6
      apps/remix-ide/ci/browser_test.sh
  30. 2
      apps/remix-ide/ci/browser_tests.sh
  31. 27
      apps/remix-ide/ci/browser_tests_chrome_2.sh
  32. 27
      apps/remix-ide/ci/browser_tests_firefox_1.sh
  33. 27
      apps/remix-ide/ci/browser_tests_firefox_2.sh
  34. 8
      apps/remix-ide/ci/browser_tests_plugin_api.sh
  35. 21
      apps/remix-ide/ci/browser_tests_run_deploy.sh
  36. 22
      apps/remix-ide/ci/lint.sh
  37. 9
      apps/solidity-compiler/src/app/app.tsx
  38. 3
      apps/solidity-compiler/src/app/compiler-api.ts
  39. 16
      apps/solidity-compiler/src/app/compiler.ts
  40. 2
      apps/solidity-compiler/src/environments/environment.prod.ts
  41. 2
      apps/solidity-compiler/src/environments/environment.ts
  42. 2
      apps/solidity-compiler/src/index.ts
  43. 9
      apps/solidity-compiler/src/main.tsx
  44. 4
      apps/solidity-compiler/src/polyfills.ts
  45. 2
      libs/remix-ui/clipboard/jest.config.js
  46. 2
      libs/remix-ui/clipboard/src/index.ts
  47. 2
      libs/remix-ui/utils/jest.config.js
  48. 885
      package-lock.json
  49. 38
      package.json

@ -2,12 +2,14 @@
# #
# Check https://circleci.com/docs/2.0/language-javascript/ for more details # Check https://circleci.com/docs/2.0/language-javascript/ for more details
# #
version: 2 version: 2.1
orbs:
browser-tools: circleci/browser-tools@1.2.3
jobs: jobs:
lint: build:
docker: docker:
# specify the version you desire here # specify the version you desire here
- image: circleci/node:14.17.6-browsers - image: cimg/node:14.17.6-browsers
# Specify service dependencies here if necessary # Specify service dependencies here if necessary
# CircleCI maintains a library of pre-built images # CircleCI maintains a library of pre-built images
@ -21,76 +23,29 @@ jobs:
steps: steps:
- checkout - checkout
- run: npm install
- run:
name: Remix Libs Linting
command: npm run lint:libs
- run:
name: Remix IDE Linting
command: npm run lint
- run:
name: Remix IDE e2e Linting
command: npm run lint remix-ide-e2e
remix-libs:
docker:
# specify the version you desire here
- image: circleci/node:14.17.6-browsers
# Specify service dependencies here if necessary
# CircleCI maintains a library of pre-built images
# documented at https://circleci.com/docs/2.0/circleci-images/
resource_class: xlarge
# - image: circleci/mongo:3.4.4
environment:
- COMMIT_AUTHOR_EMAIL: "yann@ethereum.org"
- COMMIT_AUTHOR: "Circle CI"
working_directory: ~/remix-project
steps: - restore_cache:
- checkout keys:
- v1-deps-{{ checksum "package-lock.json" }}
- run: npm install - run: npm install
- run: npm run build:libs - save_cache:
- run: cd dist/libs/remix-tests && npm install key: v1-deps-{{ checksum "package-lock.json" }}
- run: npm run test:libs paths:
- node_modules
remix-ide-chrome-1: - run: npm run downloadsolc_assets
docker: - run: npx nx build remix-ide
# specify the version you desire here - run: npx nx build remix-ide-e2e-src-local-plugin
- image: circleci/node:14.17.6-browsers
# Specify service dependencies here if necessary
# CircleCI maintains a library of pre-built images
# documented at https://circleci.com/docs/2.0/circleci-images/
resource_class: xlarge
# - image: circleci/mongo:3.4.4
environment:
- COMMIT_AUTHOR_EMAIL: "yann@ethereum.org"
- COMMIT_AUTHOR: "Circle CI"
working_directory: ~/remix-project
parallelism: 12
steps:
- checkout
- run: npm install
- run: npx nx build remix-ide --with-deps
- run:
name: Download Selenium
command: ./node_modules/.bin/selenium-standalone install --drivers.chrome.version=2.39 --drivers.chrome.baseURL=https://chromedriver.storage.googleapis.com
- run:
name: Start Selenium
command: ./node_modules/.bin/selenium-standalone start --drivers.chrome.version=2.39 --drivers.chrome.baseURL=https://chromedriver.storage.googleapis.com
background: true
- run: ./apps/remix-ide/ci/browser_tests_chrome_1.sh
- store_test_results:
path: ./reports/tests
- store_artifacts:
path: ./reports/screenshots
remix-ide-chrome-2: - run: npm run build:libs
- run: mkdir persist && zip -r persist/dist.zip dist
- persist_to_workspace:
root: .
paths:
- 'persist'
lint:
docker: docker:
# specify the version you desire here # specify the version you desire here
- image: circleci/node:14.17.6-browsers - image: cimg/node:14.17.6-browsers
# Specify service dependencies here if necessary # Specify service dependencies here if necessary
# CircleCI maintains a library of pre-built images # CircleCI maintains a library of pre-built images
@ -101,30 +56,20 @@ jobs:
- COMMIT_AUTHOR_EMAIL: "yann@ethereum.org" - COMMIT_AUTHOR_EMAIL: "yann@ethereum.org"
- COMMIT_AUTHOR: "Circle CI" - COMMIT_AUTHOR: "Circle CI"
working_directory: ~/remix-project working_directory: ~/remix-project
parallelism: 35
parallelism: 12
steps: steps:
- checkout - checkout
- restore_cache:
keys:
- v1-deps-{{ checksum "package-lock.json" }}
- run: npm install - run: npm install
- run: npm run downloadsolc_assets
- run: npx nx build remix-ide --with-deps
- run:
name: Download Selenium
command: ./node_modules/.bin/selenium-standalone install --drivers.chrome.version=2.39 --drivers.chrome.baseURL=https://chromedriver.storage.googleapis.com
- run: - run:
name: Start Selenium name: Remix Libs Linting
command: ./node_modules/.bin/selenium-standalone start --drivers.chrome.version=2.39 --drivers.chrome.baseURL=https://chromedriver.storage.googleapis.com command: ./apps/remix-ide/ci/lint.sh
background: true remix-libs:
- run: ./apps/remix-ide/ci/browser_tests_chrome_2.sh
- store_test_results:
path: ./reports/tests
- store_artifacts:
path: ./reports/screenshots
remix-ide-firefox-1:
docker: docker:
# specify the version you desire here # specify the version you desire here
- image: circleci/node:14.17.6-browsers - image: cimg/node:14.17.6-browsers
# Specify service dependencies here if necessary # Specify service dependencies here if necessary
# CircleCI maintains a library of pre-built images # CircleCI maintains a library of pre-built images
@ -136,28 +81,22 @@ jobs:
- COMMIT_AUTHOR: "Circle CI" - COMMIT_AUTHOR: "Circle CI"
working_directory: ~/remix-project working_directory: ~/remix-project
parallelism: 12
steps: steps:
- checkout - checkout
- run: npm install - attach_workspace:
- run: npx nx build remix-ide --with-deps at: .
- run: - run: unzip ./persist/dist.zip
name: Download Selenium - restore_cache:
command: ./node_modules/.bin/selenium-standalone install --config=../remix-project/apps/remix-ide-e2e/seleniumConfig.js keys:
- run: - v1-deps-{{ checksum "package-lock.json" }}
name: Start Selenium - run: npm i
command: ./node_modules/.bin/selenium-standalone start --config=../remix-project/apps/remix-ide-e2e/seleniumConfig.js - run: cd dist/libs/remix-tests && npm install
background: true - run: npm run test:libs
- run: ./apps/remix-ide/ci/browser_tests_firefox_1.sh
- store_test_results:
path: ./reports/tests
- store_artifacts:
path: ./reports/screenshots
remix-ide-firefox-2: remix-ide-chrome:
docker: docker:
# specify the version you desire here # specify the version you desire here
- image: circleci/node:14.17.6-browsers - image: cimg/node:14.17.6-browsers
# Specify service dependencies here if necessary # Specify service dependencies here if necessary
# CircleCI maintains a library of pre-built images # CircleCI maintains a library of pre-built images
@ -169,29 +108,33 @@ jobs:
- COMMIT_AUTHOR: "Circle CI" - COMMIT_AUTHOR: "Circle CI"
working_directory: ~/remix-project working_directory: ~/remix-project
parallelism: 12 parallelism: 70
steps: steps:
- browser-tools/install-chrome
- browser-tools/install-chromedriver
- checkout - checkout
- attach_workspace:
at: .
- run: unzip ./persist/dist.zip
- restore_cache:
keys:
- v1-deps-{{ checksum "package-lock.json" }}
- run: npm install - run: npm install
- run: npm run downloadsolc_assets - run: npm run selenium-install
- run: npx nx build remix-ide --with-deps
- run:
name: Download Selenium
command: ./node_modules/.bin/selenium-standalone install --config=../remix-project/apps/remix-ide-e2e/seleniumConfig.js
- run: - run:
name: Start Selenium name: Start Selenium
command: ./node_modules/.bin/selenium-standalone start --config=../remix-project/apps/remix-ide-e2e/seleniumConfig.js command: npx selenium-standalone start
background: true background: true
- run: ./apps/remix-ide/ci/browser_tests_firefox_2.sh - run: ./apps/remix-ide/ci/browser_test.sh chrome
- store_test_results: - store_test_results:
path: ./reports/tests path: ./reports/tests
- store_artifacts: - store_artifacts:
path: ./reports/screenshots path: ./reports/screenshots
remix-ide-run-deploy: remix-ide-firefox:
docker: docker:
# specify the version you desire here # specify the version you desire here
- image: circleci/node:14.17.6-browsers - image: cimg/node:14.17.6-browsers
# Specify service dependencies here if necessary # Specify service dependencies here if necessary
# CircleCI maintains a library of pre-built images # CircleCI maintains a library of pre-built images
@ -201,21 +144,26 @@ jobs:
environment: environment:
- COMMIT_AUTHOR_EMAIL: "yann@ethereum.org" - COMMIT_AUTHOR_EMAIL: "yann@ethereum.org"
- COMMIT_AUTHOR: "Circle CI" - COMMIT_AUTHOR: "Circle CI"
- FILES_TO_PACKAGE: "dist/apps/remix-ide/assets dist/apps/remix-ide/index.html dist/apps/remix-ide/main.js dist/apps/remix-ide/polyfills.js dist/apps/remix-ide/runtime.js dist/apps/remix-ide/vendor.js dist/apps/remix-ide/favicon.ico"
working_directory: ~/remix-project working_directory: ~/remix-project
parallelism: 70
steps: steps:
- browser-tools/install-firefox
- browser-tools/install-geckodriver
- checkout - checkout
- attach_workspace:
at: .
- run: unzip ./persist/dist.zip
- restore_cache:
keys:
- v1-deps-{{ checksum "package-lock.json" }}
- run: npm install - run: npm install
- run: npx nx build remix-ide --with-deps - run: npm run selenium-install
- run:
name: Download Selenium
command: ./node_modules/.bin/selenium-standalone install --drivers.chrome.version=2.39 --drivers.chrome.baseURL=https://chromedriver.storage.googleapis.com
- run: - run:
name: Start Selenium name: Start Selenium
command: ./node_modules/.bin/selenium-standalone start --drivers.chrome.version=2.39 --drivers.chrome.baseURL=https://chromedriver.storage.googleapis.com command: npx selenium-standalone start
background: true background: true
- run: ./apps/remix-ide/ci/browser_tests_run_deploy.sh - run: ./apps/remix-ide/ci/browser_test.sh firefox
- store_test_results: - store_test_results:
path: ./reports/tests path: ./reports/tests
- store_artifacts: - store_artifacts:
@ -224,7 +172,7 @@ jobs:
remix-ide-plugin-api: remix-ide-plugin-api:
docker: docker:
# specify the version you desire here # specify the version you desire here
- image: circleci/node:14.17.6-browsers - image: cimg/node:14.17.6-browsers
# Specify service dependencies here if necessary # Specify service dependencies here if necessary
# CircleCI maintains a library of pre-built images # CircleCI maintains a library of pre-built images
@ -236,18 +184,22 @@ jobs:
- COMMIT_AUTHOR: "Circle CI" - COMMIT_AUTHOR: "Circle CI"
- FILES_TO_PACKAGE: "dist/apps/remix-ide/assets dist/apps/remix-ide/index.html dist/apps/remix-ide/main.js dist/apps/remix-ide/polyfills.js dist/apps/remix-ide/runtime.js dist/apps/remix-ide/vendor.js dist/apps/remix-ide/favicon.ico" - FILES_TO_PACKAGE: "dist/apps/remix-ide/assets dist/apps/remix-ide/index.html dist/apps/remix-ide/main.js dist/apps/remix-ide/polyfills.js dist/apps/remix-ide/runtime.js dist/apps/remix-ide/vendor.js dist/apps/remix-ide/favicon.ico"
working_directory: ~/remix-project working_directory: ~/remix-project
parallelism: 7
steps: steps:
- browser-tools/install-chrome
- browser-tools/install-chromedriver
- checkout - checkout
- attach_workspace:
at: .
- run: unzip ./persist/dist.zip
- restore_cache:
keys:
- v1-deps-{{ checksum "package-lock.json" }}
- run: npm install - run: npm install
- run: npx nx build remix-ide --with-deps - run: npm run selenium-install
- run: npx nx build remix-ide-e2e-src-local-plugin
- run:
name: Download Selenium
command: ./node_modules/.bin/selenium-standalone install --drivers.chrome.version=2.39 --drivers.chrome.baseURL=https://chromedriver.storage.googleapis.com
- run: - run:
name: Start Selenium name: Start Selenium
command: ./node_modules/.bin/selenium-standalone start --drivers.chrome.version=2.39 --drivers.chrome.baseURL=https://chromedriver.storage.googleapis.com command: npx selenium-standalone start
background: true background: true
- run: ./apps/remix-ide/ci/browser_tests_plugin_api.sh - run: ./apps/remix-ide/ci/browser_tests_plugin_api.sh
- store_test_results: - store_test_results:
@ -258,7 +210,7 @@ jobs:
deploy-remix-live: deploy-remix-live:
docker: docker:
# specify the version you desire here # specify the version you desire here
- image: circleci/node:14.17.6-browsers - image: cimg/node:14.17.6-browsers
# Specify service dependencies here if necessary # Specify service dependencies here if necessary
# CircleCI maintains a library of pre-built images # CircleCI maintains a library of pre-built images
@ -286,7 +238,7 @@ jobs:
publish: publish:
docker: docker:
# specify the version you desire here # specify the version you desire here
- image: circleci/node:14.17.6-browsers - image: cimg/node:14.17.6-browsers
# Specify service dependencies here if necessary # Specify service dependencies here if necessary
# CircleCI maintains a library of pre-built images # CircleCI maintains a library of pre-built images
@ -312,7 +264,7 @@ jobs:
deploy-remix-alpha: deploy-remix-alpha:
docker: docker:
# specify the version you desire here # specify the version you desire here
- image: circleci/node:14.17.6-browsers - image: cimg/node:14.17.6-browsers
# Specify service dependencies here if necessary # Specify service dependencies here if necessary
# CircleCI maintains a library of pre-built images # CircleCI maintains a library of pre-built images
@ -340,7 +292,7 @@ jobs:
deploy-remix-beta: deploy-remix-beta:
docker: docker:
# specify the version you desire here # specify the version you desire here
- image: circleci/node:14.17.6-browsers - image: cimg/node:14.17.6-browsers
# Specify service dependencies here if necessary # Specify service dependencies here if necessary
# CircleCI maintains a library of pre-built images # CircleCI maintains a library of pre-built images
@ -370,60 +322,48 @@ workflows:
version: 2 version: 2
build_all: build_all:
jobs: jobs:
- lint - build
- lint:
requires:
- build
- remix-libs: - remix-libs:
requires: requires:
- lint - build
- remix-ide-plugin-api: - remix-ide-plugin-api:
requires: requires:
- lint - build
- remix-ide-chrome-1: - remix-ide-chrome:
requires: requires:
- lint - build
- remix-ide-chrome-2: - remix-ide-firefox:
requires: requires:
- lint - build
- remix-ide-firefox-1:
requires:
- lint
- remix-ide-firefox-2:
requires:
- lint
- remix-ide-run-deploy:
requires:
- lint
- publish:
requires:
- lint
- deploy-remix-live: - deploy-remix-live:
requires: requires:
- remix-ide-chrome-1 - lint
- remix-ide-chrome-2 - remix-libs
- remix-ide-firefox-1 - remix-ide-chrome
- remix-ide-firefox-2 - remix-ide-firefox
- remix-ide-run-deploy
- remix-ide-plugin-api - remix-ide-plugin-api
filters: filters:
branches: branches:
only: remix_live only: remix_live
- deploy-remix-alpha: - deploy-remix-alpha:
requires: requires:
- remix-ide-chrome-1 - lint
- remix-ide-chrome-2 - remix-libs
- remix-ide-firefox-1 - remix-ide-chrome
- remix-ide-firefox-2 - remix-ide-firefox
- remix-ide-run-deploy
- remix-ide-plugin-api - remix-ide-plugin-api
filters: filters:
branches: branches:
only: master only: master
- deploy-remix-beta: - deploy-remix-beta:
requires: requires:
- remix-ide-chrome-1 - lint
- remix-ide-chrome-2 - remix-libs
- remix-ide-firefox-1 - remix-ide-chrome
- remix-ide-firefox-2 - remix-ide-firefox
- remix-ide-run-deploy
- remix-ide-plugin-api - remix-ide-plugin-api
filters: filters:
branches: branches:

2
.gitignore vendored

@ -12,6 +12,8 @@ docs/_build
TODO TODO
soljson.js soljson.js
*~ *~
*_group*.*.ts
*_group*.ts
# compiled output # compiled output

@ -1,8 +1,3 @@
import * as fs from 'fs'
const crxFile = fs.readFileSync('apps/remix-ide-e2e/src/extensions/chrome/metamask.crx')
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',
@ -28,7 +23,10 @@ module.exports = {
desiredCapabilities: { desiredCapabilities: {
browserName: 'firefox', browserName: 'firefox',
javascriptEnabled: true, javascriptEnabled: true,
acceptSslCerts: true acceptSslCerts: true,
'moz:firefoxOptions': {
args: ['-headless']
}
}, },
exclude: ['dist/apps/remix-ide-e2e/src/tests/runAndDeploy.js', 'dist/apps/remix-ide-e2e/src/tests/pluginManager.spec.ts'] exclude: ['dist/apps/remix-ide-e2e/src/tests/runAndDeploy.js', 'dist/apps/remix-ide-e2e/src/tests/pluginManager.spec.ts']
}, },
@ -39,34 +37,36 @@ module.exports = {
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', '--no-sandbox', '--headless', '--verbose']
} }
} }
}, },
'chrome-runAndDeploy': { chromeDesktop: {
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', '--no-sandbox']
extensions: [metamaskExtension]
} }
} }
}, },
safari: { 'chrome-runAndDeploy': {
desiredCapabilities: { desiredCapabilities: {
browserName: 'safari', browserName: 'chrome',
javascriptEnabled: true, javascriptEnabled: true,
acceptSslCerts: true acceptSslCerts: true,
'goog:chromeOptions': {
args: ['window-size=2560,1440', 'start-fullscreen', '--no-sandbox', '--headless', '--verbose']
}
} }
}, },
ie: { firefoxDesktop: {
desiredCapabilities: { desiredCapabilities: {
browserName: 'internet explorer', browserName: 'firefox',
javascriptEnabled: true, javascriptEnabled: true,
acceptSslCerts: true acceptSslCerts: true
} }
@ -76,7 +76,10 @@ module.exports = {
desiredCapabilities: { desiredCapabilities: {
browserName: 'firefox', browserName: 'firefox',
javascriptEnabled: true, javascriptEnabled: true,
acceptSslCerts: true acceptSslCerts: true,
'moz:firefoxOptions': {
args: ['-headless']
}
} }
} }
} }

@ -1,10 +1,10 @@
/* eslint-disable */ /* eslint-disable */
module.exports = { module.exports = {
version: '3.8.1', version: '4.0.0',
baseURL: 'https://selenium-release.storage.googleapis.com', baseURL: 'https://selenium-release.storage.googleapis.com',
drivers: { drivers: {
chrome: { chrome: {
version: '2.39', version: '96.0.4664.35',
arch: process.arch, arch: process.arch,
baseURL: 'https://chromedriver.storage.googleapis.com' baseURL: 'https://chromedriver.storage.googleapis.com'
} }

@ -0,0 +1,33 @@
const testFolder = './apps/remix-ide-e2e/src/tests/'
const fs = require('fs')
// build group tests
const source = `'use strict'
import * as test from './#file'
import buildGroupTest from '../helpers/buildgrouptest'
const group = '#groupname'
module.exports = buildGroupTest(group, test)
`
fs.readdirSync(testFolder).forEach(file => {
if (!file.includes('group')) {
const content = fs.readFileSync(testFolder + file, 'utf8')
const matches = content.match(/group\d+/g)
if (matches) {
const unique = matches.filter(onlyUnique)
unique.map((group) => {
const rewrite = source.replace('#groupname', group).replace('#file', file.replace('.ts', ''))
const extension = file.split('.')
extension.shift()
const filename = `${testFolder}${file.split('.').shift()}_${group}.${extension.join('.')}`
fs.writeFileSync(filename, rewrite)
})
}
}
})
function onlyUnique (value, index, self) {
return self.indexOf(value) === index
}

@ -0,0 +1,15 @@
const testFolder = './apps/remix-ide-e2e/src/tests/'
const fs = require('fs')
fs.readdirSync(testFolder).forEach(file => {
if (!file.includes('group')) {
const content = fs.readFileSync(testFolder + file, 'utf8')
const matches = content.match(/group\d+/g)
if (matches) {
const disabled = content.includes('@disabled')
if (!disabled) {
console.log(`WARNING ${file} has group tests but is not disabled`)
}
}
}
})

@ -0,0 +1,14 @@
import { NightwatchBrowser } from 'nightwatch'
import EventEmitter from 'events'
class clearConsole extends EventEmitter {
command (this: NightwatchBrowser): NightwatchBrowser {
this.api.waitForElementVisible('*[data-id="terminalCli"]').click('#clearConsole').perform((done) => {
done()
this.emit('complete')
})
return this
}
}
module.exports = clearConsole

@ -0,0 +1,24 @@
import { NightwatchBrowser } from 'nightwatch'
import EventEmitter from 'events'
class clearTransactions extends EventEmitter {
command (this: NightwatchBrowser): NightwatchBrowser {
const browser = this
this.api.clickLaunchIcon('udapp').element('css selector', '*[data-id="universalDappUiUdappClose"]', function (visible: any) {
if (visible.status && visible.status === -1) {
browser.api.perform((done) => {
done()
browser.emit('complete')
})
} else {
browser.api.pause(500).click('*[data-id="universalDappUiUdappClose"]').perform((done) => {
done()
browser.emit('complete')
})
}
})
return this
}
}
module.exports = clearTransactions

@ -0,0 +1,12 @@
export default function buildGroupTest (group: string, test: any) {
const ob = {}
// eslint-disable-next-line dot-notation
const defaults = test['default']
for (const key of Object.keys(defaults)) {
if (typeof defaults[key] === 'function' && (key.indexOf(`#${group}`) > -1 || key.indexOf('#group') === -1)) {
ob[key.replace(`#${group}`, '')] = defaults[key]
}
}
console.log(ob)
return ob
}

@ -0,0 +1,47 @@
#!/bin/bash
# Bash Menu Script Example
PS3='Select a browser: '
BROWSERS=( "chrome" "firefox" "exit" )
select opt in "${BROWSERS[@]}"
do
case $opt in
"chrome")
echo "Chrome selected"
BROWSER="chromeDesktop"
break
;;
"firefox")
echo "Firefox selected"
BROWSER="firefoxDesktop"
break
;;
"exit")
echo "Exiting"
exit 0
;;
*) echo "invalid option $REPLY";;
esac
done
npm run build:e2e
PS3='Select a test or command: '
TESTFILES=( $(grep -IRiL "disabled" "dist/apps/remix-ide-e2e/src/tests" | grep "\.spec\|\.test" | sort ) )
# declare -p TESTFILES
TESTFILES+=("list")
TESTFILES+=("exit")
select opt in "${TESTFILES[@]}"
do
if [ "$opt" = "exit" ]; then
break
fi
if [ "$opt" = "list" ]; then
for i in "${!TESTFILES[@]}"; do
printf "%s) %s\n" "$((i+1))" "${TESTFILES[$i]}"
done
else
# run the selected test
npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js $opt --env=$BROWSER
fi
done

@ -9,6 +9,7 @@ const sources = [
] ]
module.exports = { module.exports = {
'@disabled': true,
before: function (browser: NightwatchBrowser, done: VoidFunction) { before: function (browser: NightwatchBrowser, done: VoidFunction) {
init(browser, done) init(browser, done)
}, },
@ -17,7 +18,7 @@ module.exports = {
return sources return sources
}, },
'Should compile using "compileWithParamaters" API': function (browser: NightwatchBrowser) { 'Should compile using "compileWithParamaters" API #group1': function (browser: NightwatchBrowser) {
browser browser
.addFile('test_jsCompile.js', { content: jsCompile }) .addFile('test_jsCompile.js', { content: jsCompile })
.executeScript('remix.exeCurrent()') .executeScript('remix.exeCurrent()')
@ -25,7 +26,7 @@ module.exports = {
.click('*[data-id="terminalClearConsole"]') .click('*[data-id="terminalClearConsole"]')
}, },
'Should compile using "compileWithParamaters" API with optimization On': function (browser: NightwatchBrowser) { 'Should compile using "compileWithParamaters" API with optimization On #group2': function (browser: NightwatchBrowser) {
browser browser
.addFile('test_jsCompileWithOptimization.js', { content: jsCompileWithOptimization }) .addFile('test_jsCompileWithOptimization.js', { content: jsCompileWithOptimization })
.executeScript('remix.exeCurrent()') .executeScript('remix.exeCurrent()')
@ -33,7 +34,7 @@ module.exports = {
.click('*[data-id="terminalClearConsole"]') .click('*[data-id="terminalClearConsole"]')
}, },
'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 #group3': function (browser: NightwatchBrowser) {
browser browser
.addFile('test_jsCompileWithOptimizationDefault.js', { content: jsCompileWithOptimizationDefault }) .addFile('test_jsCompileWithOptimizationDefault.js', { content: jsCompileWithOptimizationDefault })
.executeScript('remix.exeCurrent()') .executeScript('remix.exeCurrent()')
@ -41,7 +42,7 @@ module.exports = {
.click('*[data-id="terminalClearConsole"]') .click('*[data-id="terminalClearConsole"]')
}, },
'Should update the compiler configuration with "setCompilerConfig" API': function (browser: NightwatchBrowser) { 'Should update the compiler configuration with "setCompilerConfig" API #group4': function (browser: NightwatchBrowser) {
browser browser
.addFile('test_updateConfiguration.js', { content: updateConfiguration }) .addFile('test_updateConfiguration.js', { content: updateConfiguration })
.executeScript('remix.exeCurrent()') .executeScript('remix.exeCurrent()')
@ -50,7 +51,7 @@ module.exports = {
.verifyContracts(['StorageTestUpdateConfiguration'], { wait: 5000, version: '0.6.8+commit.0bbfe453' }) .verifyContracts(['StorageTestUpdateConfiguration'], { wait: 5000, version: '0.6.8+commit.0bbfe453' })
}, },
'Should produce a stack too deep error': function (browser: NightwatchBrowser) { 'Should produce a stack too deep error #group5': function (browser: NightwatchBrowser) {
browser browser
.setSolidityCompilerVersion('soljson-v0.8.1+commit.df193b15.js') .setSolidityCompilerVersion('soljson-v0.8.1+commit.df193b15.js')
.addFile('ContractStackLimit.sol', { content: contractStackLimit }) .addFile('ContractStackLimit.sol', { content: contractStackLimit })

@ -3,7 +3,7 @@ import { NightwatchBrowser } from 'nightwatch'
import init from '../helpers/init' import init from '../helpers/init'
module.exports = { module.exports = {
'@disabled': true,
before: function (browser: NightwatchBrowser, done: VoidFunction) { before: function (browser: NightwatchBrowser, done: VoidFunction) {
init(browser, done) init(browser, done)
}, },
@ -12,16 +12,17 @@ module.exports = {
return sources return sources
}, },
'Should launch debugger': function (browser: NightwatchBrowser) { 'Should launch debugger #group1': function (browser: NightwatchBrowser) {
browser.addFile('blah.sol', sources[0]['blah.sol']) browser.addFile('blah.sol', sources[0]['blah.sol'])
.clickLaunchIcon('udapp') .clickLaunchIcon('udapp')
.waitForElementPresent('*[title="Deploy - transact (not payable)"]', 65000) .waitForElementPresent('*[title="Deploy - transact (not payable)"]', 65000)
.click('*[title="Deploy - transact (not payable)"]') .click('*[title="Deploy - transact (not payable)"]')
.debugTransaction(0) .debugTransaction(0)
.waitForElementContainsText('*[data-id="sidePanelSwapitTitle"]', 'DEBUGGER', 60000) .waitForElementContainsText('*[data-id="sidePanelSwapitTitle"]', 'DEBUGGER', 60000)
.clearConsole()
}, },
'Should debug failing transaction': function (browser: NightwatchBrowser) { 'Should debug failing transaction #group1': function (browser: NightwatchBrowser) {
browser.waitForElementVisible('*[data-id="verticalIconsKindudapp"]') browser.waitForElementVisible('*[data-id="verticalIconsKindudapp"]')
.clickLaunchIcon('udapp') .clickLaunchIcon('udapp')
.waitForElementPresent('*[data-id="universalDappUiTitleExpander"]') .waitForElementPresent('*[data-id="universalDappUiTitleExpander"]')
@ -29,14 +30,14 @@ module.exports = {
.scrollAndClick('*[title="string name, uint256 goal"]') .scrollAndClick('*[title="string name, uint256 goal"]')
.setValue('*[title="string name, uint256 goal"]', '"toast", 999') .setValue('*[title="string name, uint256 goal"]', '"toast", 999')
.click('*[data-id="createProject - transact (not payable)"]') .click('*[data-id="createProject - transact (not payable)"]')
.debugTransaction(1) .debugTransaction(0)
.pause(2000) .pause(2000)
.scrollAndClick('*[data-id="solidityLocals"]') .scrollAndClick('*[data-id="solidityLocals"]')
.waitForElementContainsText('*[data-id="solidityLocals"]', 'toast', 60000) .waitForElementContainsText('*[data-id="solidityLocals"]', 'toast', 60000)
.waitForElementContainsText('*[data-id="solidityLocals"]', '999', 60000) .waitForElementContainsText('*[data-id="solidityLocals"]', '999', 60000)
}, },
'Should debug transaction using slider': function (browser: NightwatchBrowser) { 'Should debug transaction using slider #group1': function (browser: NightwatchBrowser) {
browser.waitForElementVisible('*[data-id="verticalIconsKindudapp"]') browser.waitForElementVisible('*[data-id="verticalIconsKindudapp"]')
.waitForElementVisible('*[data-id="slider"]') .waitForElementVisible('*[data-id="slider"]')
// eslint-disable-next-line dot-notation // eslint-disable-next-line dot-notation
@ -48,7 +49,7 @@ module.exports = {
.waitForElementContainsText('*[data-id="stepdetail"]', 'vm trace step:\n51', 60000) .waitForElementContainsText('*[data-id="stepdetail"]', 'vm trace step:\n51', 60000)
}, },
'Should step back and forward transaction': function (browser: NightwatchBrowser) { 'Should step back and forward transaction #group1': function (browser: NightwatchBrowser) {
browser.waitForElementVisible('*[data-id="verticalIconsKindudapp"]') browser.waitForElementVisible('*[data-id="verticalIconsKindudapp"]')
.waitForElementPresent('*[data-id="buttonNavigatorIntoBack"]') .waitForElementPresent('*[data-id="buttonNavigatorIntoBack"]')
.scrollAndClick('*[data-id="buttonNavigatorIntoBack"]') .scrollAndClick('*[data-id="buttonNavigatorIntoBack"]')
@ -61,7 +62,7 @@ module.exports = {
.waitForElementContainsText('*[data-id="stepdetail"]', 'execution step:\n51', 60000) .waitForElementContainsText('*[data-id="stepdetail"]', 'execution step:\n51', 60000)
}, },
'Should jump through breakpoints': function (browser: NightwatchBrowser) { 'Should jump through breakpoints #group1': function (browser: NightwatchBrowser) {
browser.waitForElementVisible('#editorView') browser.waitForElementVisible('#editorView')
.execute(() => { .execute(() => {
(window as any).addRemixBreakpoint(11) (window as any).addRemixBreakpoint(11)
@ -80,15 +81,17 @@ module.exports = {
.waitForElementContainsText('*[data-id="stepdetail"]', 'execution step:\n352', 60000) .waitForElementContainsText('*[data-id="stepdetail"]', 'execution step:\n352', 60000)
}, },
'Should display solidity imported code while debugging github import': function (browser: NightwatchBrowser) { 'Should display solidity imported code while debugging github import #group2': function (browser: NightwatchBrowser) {
browser browser
.clearConsole()
.clearTransactions()
.clickLaunchIcon('solidity') .clickLaunchIcon('solidity')
.testContracts('externalImport.sol', sources[1]['externalImport.sol'], ['ERC20']) .testContracts('externalImport.sol', sources[1]['externalImport.sol'], ['ERC20'])
.clickLaunchIcon('udapp') .clickLaunchIcon('udapp')
.waitForElementPresent('*[title="Deploy - transact (not payable)"]', 35000) .waitForElementPresent('*[title="Deploy - transact (not payable)"]', 35000)
.selectContract('ERC20') .selectContract('ERC20')
.createContract('"tokenName", "symbol"') .createContract('"tokenName", "symbol"')
.debugTransaction(2) .debugTransaction(0)
.pause(2000) .pause(2000)
.waitForElementVisible('#stepdetail') .waitForElementVisible('#stepdetail')
.goToVMTraceStep(10) .goToVMTraceStep(10)
@ -101,13 +104,14 @@ module.exports = {
}) })
}, },
'Should display correct source highlighting while debugging a contract which has ABIEncoderV2': function (browser: NightwatchBrowser) { 'Should display correct source highlighting while debugging a contract which has ABIEncoderV2 #group2': function (browser: NightwatchBrowser) {
/* /*
localVariable_step266_ABIEncoder and localVariable_step717_ABIEncoder localVariable_step266_ABIEncoder and localVariable_step717_ABIEncoder
still contains unwanted values (related to decoding calldata types) still contains unwanted values (related to decoding calldata types)
This is still an issue @todo(https://github.com/ethereum/remix-project/issues/481), so this test will fail when this issue is fixed This is still an issue @todo(https://github.com/ethereum/remix-project/issues/481), so this test will fail when this issue is fixed
*/ */
browser browser
.clearConsole().clearTransactions()
.clickLaunchIcon('solidity') .clickLaunchIcon('solidity')
.setSolidityCompilerVersion('soljson-v0.6.12+commit.27d51765.js') .setSolidityCompilerVersion('soljson-v0.6.12+commit.27d51765.js')
.clickLaunchIcon('filePanel') .clickLaunchIcon('filePanel')
@ -116,9 +120,10 @@ module.exports = {
.clickLaunchIcon('udapp') .clickLaunchIcon('udapp')
.selectContract('test') .selectContract('test')
.createContract('') .createContract('')
.clickInstance(2) .clearConsole()
.clickInstance(0)
.clickFunction('test1 - transact (not payable)', { types: 'bytes userData', values: '0x000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000015b38da6a701c568545dcfcb03fcb875f56beddc4' }) .clickFunction('test1 - transact (not payable)', { types: 'bytes userData', values: '0x000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000015b38da6a701c568545dcfcb03fcb875f56beddc4' })
.debugTransaction(4) .debugTransaction(0)
.pause(2000) .pause(2000)
.waitForElementVisible('#stepdetail') .waitForElementVisible('#stepdetail')
.goToVMTraceStep(261) .goToVMTraceStep(261)
@ -138,11 +143,10 @@ module.exports = {
.goToVMTraceStep(717) .goToVMTraceStep(717)
.pause(5000) .pause(5000)
.checkVariableDebug('soliditylocals', localVariable_step717_ABIEncoder) // all locals should be initiaed .checkVariableDebug('soliditylocals', localVariable_step717_ABIEncoder) // all locals should be initiaed
.clickLaunchIcon('udapp') .clearTransactions()
.clickInstance(2)
}, },
'Should load more solidity locals array': function (browser: NightwatchBrowser) { 'Should load more solidity locals array #group3': function (browser: NightwatchBrowser) {
browser browser
.clickLaunchIcon('solidity') .clickLaunchIcon('solidity')
.testContracts('locals.sol', sources[3]['locals.sol'], ['testLocals']) .testContracts('locals.sol', sources[3]['locals.sol'], ['testLocals'])
@ -150,32 +154,37 @@ module.exports = {
.waitForElementPresent('*[title="Deploy - transact (not payable)"]', 40000) .waitForElementPresent('*[title="Deploy - transact (not payable)"]', 40000)
.createContract('') .createContract('')
.pause(2000) .pause(2000)
.clickInstance(3) .clearConsole()
.clickInstance(0)
.clickFunction('t - transact (not payable)') .clickFunction('t - transact (not payable)')
.pause(2000) .pause(2000)
.debugTransaction(6) .debugTransaction(0)
.waitForElementVisible('*[data-id="slider"]') .waitForElementVisible('*[data-id="slider"]').pause(2000)
// .setValue('*[data-id="slider"]', '5000') // Like this, setValue doesn't work properly for input type = range // .setValue('*[data-id="slider"]', '5000') // Like this, setValue doesn't work properly for input type = range
// eslint-disable-next-line dot-notation // eslint-disable-next-line dot-notation
.execute(function () { document.getElementById('slider')['value'] = '7450' }) // It only moves slider to 7450 but vm traces are not updated .execute(function () { document.getElementById('slider')['value'] = '7450' }).pause(10000) // It only moves slider to 7450 but vm traces are not updated
.setValue('*[data-id="slider"]', new Array(3).fill(browser.Keys.RIGHT_ARROW)) // This will press NEXT 3 times and will update the trace details .setValue('*[data-id="slider"]', new Array(3).fill(browser.Keys.RIGHT_ARROW)) // This will press NEXT 3 times and will update the trace details
.waitForElementPresent('*[data-id="treeViewDivtreeViewItemarray"]') .waitForElementPresent('*[data-id="treeViewDivtreeViewItemarray"]')
.click('*[data-id="treeViewDivtreeViewItemarray"]') .click('*[data-id="treeViewDivtreeViewItemarray"]')
.waitForElementPresent('*[data-id="treeViewDivtreeViewLoadMore"]') .waitForElementPresent('*[data-id="treeViewDivtreeViewLoadMore"]')
.waitForElementVisible('*[data-id="solidityLocals"]')
.waitForElementContainsText('*[data-id="solidityLocals"]', '9: 9 uint256', 60000) .waitForElementContainsText('*[data-id="solidityLocals"]', '9: 9 uint256', 60000)
.notContainsText('*[data-id="solidityLocals"]', '10: 10 uint256') .notContainsText('*[data-id="solidityLocals"]', '10: 10 uint256')
.clearTransactions()
.clearConsole().pause(2000)
}, },
'Should debug using generated sources': function (browser: NightwatchBrowser) { 'Should debug using generated sources #group4': function (browser: NightwatchBrowser) {
browser browser
.clickLaunchIcon('solidity') .clickLaunchIcon('solidity')
.pause(2000) .pause(2000)
.testContracts('withGeneratedSources.sol', sources[4]['withGeneratedSources.sol'], ['A']) .testContracts('withGeneratedSources.sol', sources[4]['withGeneratedSources.sol'], ['A'])
.clickLaunchIcon('udapp') .clickLaunchIcon('udapp')
.createContract('') .createContract('')
.clickInstance(4) .clearConsole()
.clickInstance(0)
.clickFunction('f - transact (not payable)', { types: 'uint256[] ', values: '[]' }) .clickFunction('f - transact (not payable)', { types: 'uint256[] ', values: '[]' })
.debugTransaction(8) .debugTransaction(0)
.pause(2000) .pause(2000)
.click('*[data-id="debuggerTransactionStartButton"]') // stop debugging .click('*[data-id="debuggerTransactionStartButton"]') // stop debugging
.click('*[data-id="debugGeneratedSourcesLabel"]') // select debug with generated sources .click('*[data-id="debugGeneratedSourcesLabel"]') // select debug with generated sources
@ -186,16 +195,16 @@ module.exports = {
}) })
.click('*[data-id="debuggerTransactionStartButton"]') .click('*[data-id="debuggerTransactionStartButton"]')
}, },
// depends on Should debug using generated sources
'Should call the debugger api: getTrace': function (browser: NightwatchBrowser) { 'Should call the debugger api: getTrace #group4': function (browser: NightwatchBrowser) {
browser browser
.addFile('test_jsGetTrace.js', { content: jsGetTrace }) .addFile('test_jsGetTrace.js', { content: jsGetTrace })
.executeScript('remix.exeCurrent()') .executeScript('remix.exeCurrent()')
.pause(1000) .pause(1000)
.waitForElementContainsText('*[data-id="terminalJournal"]', '{"gas":"0x575f","return":"0x0000000000000000000000000000000000000000000000000000000000000000","structLogs":', 60000) .waitForElementContainsText('*[data-id="terminalJournal"]', '{"gas":"0x575f","return":"0x0000000000000000000000000000000000000000000000000000000000000000","structLogs":', 60000)
}, },
// depends on Should debug using generated sources
'Should call the debugger api: debug': function (browser: NightwatchBrowser) { 'Should call the debugger api: debug #group4': function (browser: NightwatchBrowser) {
browser browser
.addFile('test_jsDebug.js', { content: jsDebug }) .addFile('test_jsDebug.js', { content: jsDebug })
.executeScript('remix.exeCurrent()') .executeScript('remix.exeCurrent()')
@ -214,7 +223,7 @@ module.exports = {
.waitForElementContainsText('*[data-id="stepdetail"]', 'vm trace step:\n154', 60000) .waitForElementContainsText('*[data-id="stepdetail"]', 'vm trace step:\n154', 60000)
}, },
'Should start debugging using remix debug nodes (rinkeby)': '' + function (browser: NightwatchBrowser) { 'Should start debugging using remix debug nodes (rinkeby) #group4': '' + function (browser: NightwatchBrowser) {
browser browser
.clickLaunchIcon('solidity') .clickLaunchIcon('solidity')
.setSolidityCompilerVersion('soljson-v0.8.7+commit.e28d00a7.js') .setSolidityCompilerVersion('soljson-v0.8.7+commit.e28d00a7.js')
@ -428,7 +437,7 @@ const localVariable_step717_ABIEncoder = { // eslint-disable-line
const jsGetTrace = `(async () => { const jsGetTrace = `(async () => {
try { try {
const result = await remix.call('debugger', 'getTrace', '0x9341be49e911afe99bf1abc67cbcf36739d2e6470a08a69511c205a0737d7332') const result = await remix.call('debugger', 'getTrace', '0x16be5c31014a7e1552d136f7ed7bc7788f3bb9e45e31b059df253173f2df31e7')
console.log('result ', result) console.log('result ', result)
} catch (e) { } catch (e) {
console.log(e.message) console.log(e.message)
@ -437,7 +446,7 @@ const jsGetTrace = `(async () => {
const jsDebug = `(async () => { const jsDebug = `(async () => {
try { try {
const result = await remix.call('debugger', 'debug', '0x9341be49e911afe99bf1abc67cbcf36739d2e6470a08a69511c205a0737d7332') const result = await remix.call('debugger', 'debug', '0x16be5c31014a7e1552d136f7ed7bc7788f3bb9e45e31b059df253173f2df31e7')
console.log('result ', result) console.log('result ', result)
} catch (e) { } catch (e) {
console.log(e.message) console.log(e.message)

@ -3,11 +3,12 @@ import { NightwatchBrowser } from 'nightwatch'
import init from '../helpers/init' import init from '../helpers/init'
module.exports = { module.exports = {
'@disabled': true,
before: function (browser: NightwatchBrowser, done: VoidFunction) { before: function (browser: NightwatchBrowser, done: VoidFunction) {
init(browser, done) init(browser, done)
}, },
'Should execute `file` api from file manager external api': function (browser: NightwatchBrowser) { 'Should execute `file` api from file manager external api #group1': function (browser: NightwatchBrowser) {
browser browser
.addFile('file.js', { content: executeFile }) .addFile('file.js', { content: executeFile })
.executeScript('remix.exeCurrent()') .executeScript('remix.exeCurrent()')
@ -15,7 +16,7 @@ module.exports = {
.waitForElementContainsText('*[data-id="terminalJournal"]', 'file.js', 60000) .waitForElementContainsText('*[data-id="terminalJournal"]', 'file.js', 60000)
}, },
'Should execute `exists` api from file manager external api': function (browser: NightwatchBrowser) { 'Should execute `exists` api from file manager external api #group1': function (browser: NightwatchBrowser) {
browser browser
.addFile('exists.js', { content: executeExists }) .addFile('exists.js', { content: executeExists })
.executeScript('remix.exeCurrent()') .executeScript('remix.exeCurrent()')
@ -23,14 +24,14 @@ module.exports = {
.waitForElementContainsText('*[data-id="terminalJournal"]', 'non-exists.js false', 60000) .waitForElementContainsText('*[data-id="terminalJournal"]', 'non-exists.js false', 60000)
}, },
'Should execute `open` api from file manager external api': function (browser: NightwatchBrowser) { 'Should execute `open` api from file manager external api #group1': function (browser: NightwatchBrowser) {
browser browser
.addFile('open.js', { content: executeOpen }) .addFile('open.js', { content: executeOpen })
.executeScript('remix.exeCurrent()') .executeScript('remix.exeCurrent()')
.waitForElementContainsText('*[data-id="terminalJournal"]', 'contracts/3_Ballot.sol', 60000) .waitForElementContainsText('*[data-id="terminalJournal"]', 'contracts/3_Ballot.sol', 60000)
}, },
'Should execute `writeFile` api from file manager external api': function (browser: NightwatchBrowser) { 'Should execute `writeFile` api from file manager external api #group1': function (browser: NightwatchBrowser) {
browser browser
.addFile('writeFile.js', { content: executeWriteFile }) .addFile('writeFile.js', { content: executeWriteFile })
.executeScript('remix.exeCurrent()') .executeScript('remix.exeCurrent()')
@ -41,21 +42,23 @@ module.exports = {
}) })
}, },
'Should execute `readFile` api from file manager external api': function (browser: NightwatchBrowser) { 'Should execute `readFile` api from file manager external api #group2': function (browser: NightwatchBrowser) {
browser browser
.addFile('writeFile.js', { content: executeWriteFile })
.executeScript('remix.exeCurrent()')
.addFile('readFile.js', { content: executeReadFile }) .addFile('readFile.js', { content: executeReadFile })
.executeScript('remix.exeCurrent()') .executeScript('remix.exeCurrent()')
.waitForElementContainsText('*[data-id="terminalJournal"]', 'pragma solidity ^0.6.0', 60000) .waitForElementContainsText('*[data-id="terminalJournal"]', 'pragma solidity ^0.6.0', 60000)
}, },
'Should execute `copyFile` api from file manager external api': function (browser: NightwatchBrowser) { 'Should execute `copyFile` api from file manager external api #group2': function (browser: NightwatchBrowser) {
browser browser
.addFile('copyFile.js', { content: executeCopyFile }) .addFile('copyFile.js', { content: executeCopyFile })
.executeScript('remix.exeCurrent()') .executeScript('remix.exeCurrent()')
.waitForElementContainsText('*[data-id="terminalJournal"]', 'pragma solidity >=0.7.0 <0.9.0;', 60000) .waitForElementContainsText('*[data-id="terminalJournal"]', 'pragma solidity >=0.7.0 <0.9.0;', 60000)
}, },
'Should execute `rename` api from file manager external api': function (browser: NightwatchBrowser) { 'Should execute `rename` api from file manager external api #group2': function (browser: NightwatchBrowser) {
browser browser
.addFile('renameFile.js', { content: executeRename }) .addFile('renameFile.js', { content: executeRename })
.executeScript('remix.exeCurrent()') .executeScript('remix.exeCurrent()')
@ -63,7 +66,7 @@ module.exports = {
.waitForElementPresent('[data-id="treeViewLitreeViewItemold_contract.sol"]', 60000) .waitForElementPresent('[data-id="treeViewLitreeViewItemold_contract.sol"]', 60000)
}, },
'Should execute `mkdir` api from file manager external api': function (browser: NightwatchBrowser) { 'Should execute `mkdir` api from file manager external api #group3': function (browser: NightwatchBrowser) {
browser browser
.addFile('mkdirFile.js', { content: executeMkdir }) .addFile('mkdirFile.js', { content: executeMkdir })
.executeScript('remix.exeCurrent()') .executeScript('remix.exeCurrent()')
@ -71,7 +74,7 @@ module.exports = {
.waitForElementPresent('[data-id="treeViewLitreeViewItemTest_Folder"]', 60000) .waitForElementPresent('[data-id="treeViewLitreeViewItemTest_Folder"]', 60000)
}, },
'Should execute `readdir` api from file manager external api': function (browser: NightwatchBrowser) { 'Should execute `readdir` api from file manager external api #group3': function (browser: NightwatchBrowser) {
browser browser
.addFile('readdirFile.js', { content: executeReaddir }) .addFile('readdirFile.js', { content: executeReaddir })
.executeScript('remix.exeCurrent()') .executeScript('remix.exeCurrent()')
@ -79,8 +82,9 @@ module.exports = {
.waitForElementContainsText('*[data-id="terminalJournal"]', 'true', 5000) .waitForElementContainsText('*[data-id="terminalJournal"]', 'true', 5000)
}, },
'Should execute `remove` api from file manager external api': function (browser: NightwatchBrowser) { 'Should execute `remove` api from file manager external api #group4': function (browser: NightwatchBrowser) {
browser browser
.addFile('old_contract.sol', { content: 'test' })
.addFile('removeFile.js', { content: executeRemove }) .addFile('removeFile.js', { content: executeRemove })
.executeScript('remix.exeCurrent()') .executeScript('remix.exeCurrent()')
.pause(2000) .pause(2000)
@ -88,12 +92,12 @@ module.exports = {
}, },
// TODO: Fix remove root directory prefix for browser and localhost // TODO: Fix remove root directory prefix for browser and localhost
'Should execute `remove` api from file manager external api on a folder': function (browser: NightwatchBrowser) { 'Should execute `remove` api from file manager external api on a folder #group4': function (browser: NightwatchBrowser) {
browser browser
.addFile('test_jsRemoveFolder.js', { content: executeRemoveOnFolder }) .addFile('test_jsRemoveFolder.js', { content: executeRemoveOnFolder })
.executeScript('remix.exeCurrent()') .executeScript('remix.exeCurrent()')
.pause(2000) .pause(2000)
.waitForElementNotPresent('[data-id="treeViewLitreeViewItemTest_Folder"]', 60000) .waitForElementNotPresent('[data-id="treeViewLitreeViewItemcontracts"]', 60000)
.end() .end()
} }
} }
@ -196,7 +200,7 @@ const executeRemove = `
const executeRemoveOnFolder = `(async () => { const executeRemoveOnFolder = `(async () => {
try { try {
await remix.call('fileManager', 'remove', 'Test_Folder') await remix.call('fileManager', 'remove', 'contracts')
} catch (e) { } catch (e) {
console.log(e.message) console.log(e.message)
} }

@ -10,7 +10,7 @@ declare global {
const localPluginData: Profile & LocationProfile & ExternalProfile = { const localPluginData: Profile & LocationProfile & ExternalProfile = {
name: 'localPlugin', name: 'localPlugin',
displayName: 'Local Plugin', displayName: 'Local Plugin',
canActivate: ['dGitProvider', 'flattener', 'solidityUnitTesting'], canActivate: ['dGitProvider', 'flattener', 'solidityUnitTesting', 'udapp'],
url: 'http://localhost:2020', url: 'http://localhost:2020',
location: 'sidePanel' location: 'sidePanel'
} }
@ -127,8 +127,9 @@ const assertPluginIsActive = function (browser: NightwatchBrowser, id: string, s
} }
module.exports = { module.exports = {
'@disabled': true,
before: function (browser: NightwatchBrowser, done: VoidFunction) { before: function (browser: NightwatchBrowser, done: VoidFunction) {
init(browser, done, 'http://127.0.0.1:8080', false) init(browser, done) // , 'http://localhost:8080', false)
}, },
afterEach: function (browser: NightwatchBrowser) { afterEach: function (browser: NightwatchBrowser) {
@ -144,13 +145,13 @@ module.exports = {
}, },
// UDAPP // UDAPP
'Should get accounts': async function (browser: NightwatchBrowser) { 'Should get accounts #group1': async function (browser: NightwatchBrowser) {
await clickAndCheckLog(browser, 'udapp:getAccounts', '0x5B38Da6a701c568545dCfcB03FcB875f56beddC4', null, null) await clickAndCheckLog(browser, 'udapp:getAccounts', '0x5B38Da6a701c568545dCfcB03FcB875f56beddC4', null, null)
}, },
// context menu item // context menu item
'Should create context menu item': async function (browser: NightwatchBrowser) { 'Should create context menu item #group1': async function (browser: NightwatchBrowser) {
await clickAndCheckLog(browser, 'filePanel:registerContextMenuItem', null, null, { await clickAndCheckLog(browser, 'filePanel:registerContextMenuItem', null, null, {
id: 'localPlugin', id: 'localPlugin',
name: 'testCommand', name: 'testCommand',
@ -179,118 +180,118 @@ module.exports = {
// FILESYSTEM // FILESYSTEM
'Should get current workspace': async function (browser: NightwatchBrowser) { 'Should get current workspace #group7': async function (browser: NightwatchBrowser) {
await clickAndCheckLog(browser, 'filePanel:getCurrentWorkspace', { name: 'default_workspace', isLocalhost: false, absolutePath: '.workspaces/default_workspace' }, null, null) await clickAndCheckLog(browser, 'filePanel:getCurrentWorkspace', { name: 'default_workspace', isLocalhost: false, absolutePath: '.workspaces/default_workspace' }, null, null)
}, },
'Should get current files': async function (browser: NightwatchBrowser) { 'Should get current files #group7': async function (browser: NightwatchBrowser) {
await clickAndCheckLog(browser, 'fileManager:readdir', { contracts: { isDirectory: true }, scripts: { isDirectory: true }, tests: { isDirectory: true }, 'README.txt': { isDirectory: false } }, null, '/') await clickAndCheckLog(browser, 'fileManager:readdir', { contracts: { isDirectory: true }, scripts: { isDirectory: true }, tests: { isDirectory: true }, 'README.txt': { isDirectory: false } }, null, '/')
}, },
'Should throw error on current file': async function (browser: NightwatchBrowser) { 'Should throw error on current file #group7': async function (browser: NightwatchBrowser) {
await clickAndCheckLog(browser, 'fileManager:getCurrentFile', 'Error from IDE : Error: No such file or directory No file selected', null, null) await clickAndCheckLog(browser, 'fileManager:getCurrentFile', 'Error from IDE : Error: No such file or directory No file selected', null, null)
}, },
'Should open readme.txt': async function (browser: NightwatchBrowser) { 'Should open readme.txt #group7': async function (browser: NightwatchBrowser) {
await clickAndCheckLog(browser, 'fileManager:open', null, { event: 'currentFileChanged', args: ['README.txt'] }, 'README.txt') await clickAndCheckLog(browser, 'fileManager:open', null, { event: 'currentFileChanged', args: ['README.txt'] }, 'README.txt')
}, },
'Should have current file': async function (browser: NightwatchBrowser) { 'Should have current file #group7': async function (browser: NightwatchBrowser) {
await clickAndCheckLog(browser, 'fileManager:getCurrentFile', 'README.txt', null, null) await clickAndCheckLog(browser, 'fileManager:getCurrentFile', 'README.txt', null, null)
}, },
'Should create dir': async function (browser: NightwatchBrowser) { 'Should create dir #group7': async function (browser: NightwatchBrowser) {
await clickAndCheckLog(browser, 'fileManager:mkdir', null, null, 'testdir') await clickAndCheckLog(browser, 'fileManager:mkdir', null, null, 'testdir')
await clickAndCheckLog(browser, 'fileManager:readdir', 'testdir', null, '/') await clickAndCheckLog(browser, 'fileManager:readdir', 'testdir', null, '/')
}, },
'Should get file': async function (browser: NightwatchBrowser) { 'Should get file #group7': async function (browser: NightwatchBrowser) {
await clickAndCheckLog(browser, 'fileManager:getFile', 'REMIX EXAMPLE PROJECT', null, 'README.txt') await clickAndCheckLog(browser, 'fileManager:getFile', 'REMIX EXAMPLE PROJECT', null, 'README.txt')
}, },
'Should close all files': async function (browser: NightwatchBrowser) { 'Should close all files #group7': async function (browser: NightwatchBrowser) {
await clickAndCheckLog(browser, 'fileManager:closeAllFiles', null, { event: 'noFileSelected', args: [] }, null) await clickAndCheckLog(browser, 'fileManager:closeAllFiles', null, { event: 'noFileSelected', args: [] }, null)
}, },
'Should switch to file': async function (browser: NightwatchBrowser) { 'Should switch to file #group2': async function (browser: NightwatchBrowser) {
await clickAndCheckLog(browser, 'fileManager:switchFile', null, { event: 'currentFileChanged', args: ['contracts/1_Storage.sol'] }, 'contracts/1_Storage.sol') await clickAndCheckLog(browser, 'fileManager:switchFile', null, { event: 'currentFileChanged', args: ['contracts/1_Storage.sol'] }, 'contracts/1_Storage.sol')
await clickAndCheckLog(browser, 'fileManager:getCurrentFile', 'contracts/1_Storage.sol', null, null) await clickAndCheckLog(browser, 'fileManager:getCurrentFile', 'contracts/1_Storage.sol', null, null)
await clickAndCheckLog(browser, 'fileManager:switchFile', null, { event: 'currentFileChanged', args: ['README.txt'] }, 'README.txt') await clickAndCheckLog(browser, 'fileManager:switchFile', null, { event: 'currentFileChanged', args: ['README.txt'] }, 'README.txt')
await clickAndCheckLog(browser, 'fileManager:getCurrentFile', 'README.txt', null, null) await clickAndCheckLog(browser, 'fileManager:getCurrentFile', 'README.txt', null, null)
}, },
'Should write to file': async function (browser: NightwatchBrowser) { 'Should write to file #group2': async function (browser: NightwatchBrowser) {
await clickAndCheckLog(browser, 'fileManager:writeFile', null, { event: 'fileSaved', args: ['README.txt'] }, ['README.txt', 'test']) await clickAndCheckLog(browser, 'fileManager:writeFile', null, { event: 'fileSaved', args: ['README.txt'] }, ['README.txt', 'test'])
await clickAndCheckLog(browser, 'fileManager:readFile', 'test', null, 'README.txt') await clickAndCheckLog(browser, 'fileManager:readFile', 'test', null, 'README.txt')
}, },
'Should set file': async function (browser: NightwatchBrowser) { 'Should set file #group2': async function (browser: NightwatchBrowser) {
await clickAndCheckLog(browser, 'fileManager:setFile', null, { event: 'fileAdded', args: ['new.sol'] }, ['new.sol', 'test']) await clickAndCheckLog(browser, 'fileManager:setFile', null, { event: 'fileAdded', args: ['new.sol'] }, ['new.sol', 'test'])
await clickAndCheckLog(browser, 'fileManager:readFile', 'test', null, 'new.sol') await clickAndCheckLog(browser, 'fileManager:readFile', 'test', null, 'new.sol')
}, },
'Should write to new file': async function (browser: NightwatchBrowser) { 'Should write to new file #group2': async function (browser: NightwatchBrowser) {
await clickAndCheckLog(browser, 'fileManager:writeFile', null, { event: 'fileAdded', args: ['testing.txt'] }, ['testing.txt', 'test']) await clickAndCheckLog(browser, 'fileManager:writeFile', null, { event: 'fileAdded', args: ['testing.txt'] }, ['testing.txt', 'test'])
await clickAndCheckLog(browser, 'fileManager:readFile', 'test', null, 'testing.txt') await clickAndCheckLog(browser, 'fileManager:readFile', 'test', null, 'testing.txt')
}, },
'Should rename file': async function (browser: NightwatchBrowser) { 'Should rename file #group2': async function (browser: NightwatchBrowser) {
await clickAndCheckLog(browser, 'fileManager:rename', null, null, ['testing.txt', 'testrename.txt']) await clickAndCheckLog(browser, 'fileManager:rename', null, null, ['testing.txt', 'testrename.txt'])
await clickAndCheckLog(browser, 'fileManager:readFile', 'test', null, 'testrename.txt') await clickAndCheckLog(browser, 'fileManager:readFile', 'test', null, 'testrename.txt')
}, },
'Should create empty workspace': async function (browser: NightwatchBrowser) { 'Should create empty workspace #group2': async function (browser: NightwatchBrowser) {
await clickAndCheckLog(browser, 'filePanel:createWorkspace', null, null, ['emptyworkspace', true]) await clickAndCheckLog(browser, 'filePanel:createWorkspace', null, null, ['emptyworkspace', true])
await clickAndCheckLog(browser, 'filePanel:getCurrentWorkspace', { name: 'emptyworkspace', isLocalhost: false, absolutePath: '.workspaces/emptyworkspace' }, null, null) await clickAndCheckLog(browser, 'filePanel:getCurrentWorkspace', { name: 'emptyworkspace', isLocalhost: false, absolutePath: '.workspaces/emptyworkspace' }, null, null)
await clickAndCheckLog(browser, 'fileManager:readdir', {}, null, '/') await clickAndCheckLog(browser, 'fileManager:readdir', {}, null, '/')
}, },
'Should create workspace': async function (browser: NightwatchBrowser) { 'Should create workspace #group2': async function (browser: NightwatchBrowser) {
await clickAndCheckLog(browser, 'filePanel:createWorkspace', null, null, 'testspace') await clickAndCheckLog(browser, 'filePanel:createWorkspace', null, null, 'testspace')
await clickAndCheckLog(browser, 'filePanel:getCurrentWorkspace', { name: 'testspace', isLocalhost: false, absolutePath: '.workspaces/testspace' }, null, null) await clickAndCheckLog(browser, 'filePanel:getCurrentWorkspace', { name: 'testspace', isLocalhost: false, absolutePath: '.workspaces/testspace' }, null, null)
await clickAndCheckLog(browser, 'fileManager:readdir', { contracts: { isDirectory: true }, scripts: { isDirectory: true }, tests: { isDirectory: true }, 'README.txt': { isDirectory: false } }, null, null) await clickAndCheckLog(browser, 'fileManager:readdir', { contracts: { isDirectory: true }, scripts: { isDirectory: true }, tests: { isDirectory: true }, 'README.txt': { isDirectory: false } }, null, null)
}, },
'Should get all workspaces': async function (browser: NightwatchBrowser) { 'Should get all workspaces #group2': async function (browser: NightwatchBrowser) {
await clickAndCheckLog(browser, 'filePanel:getWorkspaces', ['default_workspace', 'emptyworkspace', 'testspace'], null, null) await clickAndCheckLog(browser, 'filePanel:getWorkspaces', ['default_workspace', 'emptyworkspace', 'testspace'], null, null)
}, },
'Should have set workspace event': async function (browser: NightwatchBrowser) { 'Should have set workspace event #group2': async function (browser: NightwatchBrowser) {
await clickAndCheckLog(browser, 'filePanel:createWorkspace', null, { event: 'setWorkspace', args: [{ name: 'newspace', isLocalhost: false }] }, 'newspace') await clickAndCheckLog(browser, 'filePanel:createWorkspace', null, { event: 'setWorkspace', args: [{ name: 'newspace', isLocalhost: false }] }, 'newspace')
}, },
'Should have event when switching workspace': async function (browser: NightwatchBrowser) { 'Should have event when switching workspace #group2': async function (browser: NightwatchBrowser) {
// @ts-ignore // @ts-ignore
browser.frameParent().useCss().clickLaunchIcon('filePanel').click('*[data-id="workspacesSelect"] option[value="default_workspace"]').useXpath().click('//*[@data-id="verticalIconsKindlocalPlugin"]').frame(0, async () => { browser.frameParent().useCss().clickLaunchIcon('filePanel').click('*[data-id="workspacesSelect"] option[value="default_workspace"]').useXpath().click('//*[@data-id="verticalIconsKindlocalPlugin"]').frame(0, async () => {
await clickAndCheckLog(browser, null, null, { event: 'setWorkspace', args: [{ name: 'default_workspace', isLocalhost: false }] }, null) await clickAndCheckLog(browser, null, null, { event: 'setWorkspace', args: [{ name: 'default_workspace', isLocalhost: false }] }, null)
}) })
}, },
'Should rename workspace': async function (browser: NightwatchBrowser) { 'Should rename workspace #group2': async function (browser: NightwatchBrowser) {
await clickAndCheckLog(browser, 'filePanel:renameWorkspace', null, null, ['default_workspace', 'renamed']) await clickAndCheckLog(browser, 'filePanel:renameWorkspace', null, null, ['default_workspace', 'renamed'])
await clickAndCheckLog(browser, 'filePanel:getWorkspaces', ['emptyworkspace', 'testspace', 'newspace', 'renamed'], null, null) await clickAndCheckLog(browser, 'filePanel:getWorkspaces', ['emptyworkspace', 'testspace', 'newspace', 'renamed'], null, null)
}, },
'Should delete workspace': async function (browser: NightwatchBrowser) { 'Should delete workspace #group2': async function (browser: NightwatchBrowser) {
await clickAndCheckLog(browser, 'filePanel:deleteWorkspace', null, null, ['testspace']) await clickAndCheckLog(browser, 'filePanel:deleteWorkspace', null, null, ['testspace'])
await clickAndCheckLog(browser, 'filePanel:getWorkspaces', ['emptyworkspace', 'newspace', 'renamed'], null, null) await clickAndCheckLog(browser, 'filePanel:getWorkspaces', ['emptyworkspace', 'newspace', 'renamed'], null, null)
}, },
// DGIT // DGIT
'Should have changes on new workspace': async function (browser: NightwatchBrowser) { 'Should have changes on new workspace #group3': async function (browser: NightwatchBrowser) {
await clickAndCheckLog(browser, 'filePanel:createWorkspace', null, null, 'dgit') await clickAndCheckLog(browser, 'filePanel:createWorkspace', null, null, 'dgit')
await clickAndCheckLog(browser, 'dGitProvider:status', [['README.txt', 0, 2, 0], ['contracts/1_Storage.sol', 0, 2, 0], ['contracts/2_Owner.sol', 0, 2, 0], ['contracts/3_Ballot.sol', 0, 2, 0], ['scripts/deploy_ethers.js', 0, 2, 0], ['scripts/deploy_web3.js', 0, 2, 0], ['tests/4_Ballot_test.sol', 0, 2, 0]], null, null) await clickAndCheckLog(browser, 'dGitProvider:status', [['README.txt', 0, 2, 0], ['contracts/1_Storage.sol', 0, 2, 0], ['contracts/2_Owner.sol', 0, 2, 0], ['contracts/3_Ballot.sol', 0, 2, 0], ['scripts/deploy_ethers.js', 0, 2, 0], ['scripts/deploy_web3.js', 0, 2, 0], ['tests/4_Ballot_test.sol', 0, 2, 0]], null, null)
}, },
'Should stage contract': async function (browser: NightwatchBrowser) { 'Should stage contract #group3': async function (browser: NightwatchBrowser) {
await clickAndCheckLog(browser, 'dGitProvider:add', null, null, { await clickAndCheckLog(browser, 'dGitProvider:add', null, null, {
filepath: 'contracts/1_Storage.sol' filepath: 'contracts/1_Storage.sol'
}) })
await clickAndCheckLog(browser, 'dGitProvider:status', [['README.txt', 0, 2, 0], ['contracts/1_Storage.sol', 0, 2, 2], ['contracts/2_Owner.sol', 0, 2, 0], ['contracts/3_Ballot.sol', 0, 2, 0], ['scripts/deploy_ethers.js', 0, 2, 0], ['scripts/deploy_web3.js', 0, 2, 0], ['tests/4_Ballot_test.sol', 0, 2, 0]], null, null) await clickAndCheckLog(browser, 'dGitProvider:status', [['README.txt', 0, 2, 0], ['contracts/1_Storage.sol', 0, 2, 2], ['contracts/2_Owner.sol', 0, 2, 0], ['contracts/3_Ballot.sol', 0, 2, 0], ['scripts/deploy_ethers.js', 0, 2, 0], ['scripts/deploy_web3.js', 0, 2, 0], ['tests/4_Ballot_test.sol', 0, 2, 0]], null, null)
}, },
'Should commit changes': async function (browser: NightwatchBrowser) { 'Should commit changes #group3': async function (browser: NightwatchBrowser) {
await clickAndCheckLog(browser, 'dGitProvider:commit', null, null, { author: { name: 'Remix', email: 'Remix' }, message: 'commit-message' }) await clickAndCheckLog(browser, 'dGitProvider:commit', null, null, { author: { name: 'Remix', email: 'Remix' }, message: 'commit-message' })
await clickAndCheckLog(browser, 'dGitProvider:log', 'commit-message', null, null) await clickAndCheckLog(browser, 'dGitProvider:log', 'commit-message', null, null)
}, },
'Should have git log': async function (browser: NightwatchBrowser) { 'Should have git log #group3': async function (browser: NightwatchBrowser) {
await clickAndCheckLog(browser, 'dGitProvider:log', 'commit-message', null, null) await clickAndCheckLog(browser, 'dGitProvider:log', 'commit-message', null, null)
}, },
'Should have branches': async function (browser: NightwatchBrowser) { 'Should have branches #group3': async function (browser: NightwatchBrowser) {
await clickAndCheckLog(browser, 'dGitProvider:branches', [{ name: 'main' }], null, null) await clickAndCheckLog(browser, 'dGitProvider:branches', [{ name: 'main' }], null, null)
}, },
// resolver // resolver
'Should resolve url': async function (browser: NightwatchBrowser) { 'Should resolve url #group4': async function (browser: NightwatchBrowser) {
await clickAndCheckLog(browser, 'contentImport:resolve', '# Remix Project', null, 'https://github.com/ethereum/remix-project/blob/master/README.md') await clickAndCheckLog(browser, 'contentImport:resolve', '# Remix Project', null, 'https://github.com/ethereum/remix-project/blob/master/README.md')
}, },
'Should resolve and save url': async function (browser: NightwatchBrowser) { 'Should resolve and save url #group4': async function (browser: NightwatchBrowser) {
await clickAndCheckLog(browser, 'contentImport:resolveAndSave', '# Remix Project', { event: 'fileAdded', args: ['.deps/github/ethereum/remix-project/README.md'] }, 'https://github.com/ethereum/remix-project/blob/master/README.md') await clickAndCheckLog(browser, 'contentImport:resolveAndSave', '# Remix Project', { event: 'fileAdded', args: ['.deps/github/ethereum/remix-project/README.md'] }, 'https://github.com/ethereum/remix-project/blob/master/README.md')
}, },
// UNIT TESTING // UNIT TESTING
'Should activate solidityUnitTesting': async function (browser: NightwatchBrowser) { 'Should activate solidityUnitTesting #group5': async function (browser: NightwatchBrowser) {
await clickAndCheckLog(browser, 'manager:activatePlugin', null, null, 'solidityUnitTesting') await clickAndCheckLog(browser, 'manager:activatePlugin', null, null, 'solidityUnitTesting')
browser.frameParent() browser.frameParent()
assertPluginIsActive(browser, 'solidityUnitTesting', true) assertPluginIsActive(browser, 'solidityUnitTesting', true)
@ -299,11 +300,11 @@ module.exports = {
await clickAndCheckLog(browser, 'manager:isActive', true, null, 'solidityUnitTesting') await clickAndCheckLog(browser, 'manager:isActive', true, null, 'solidityUnitTesting')
}, },
'Should test from path with solidityUnitTesting': async function (browser: NightwatchBrowser) { 'Should test from path with solidityUnitTesting #group5': async function (browser: NightwatchBrowser) {
await clickAndCheckLog(browser, 'solidityUnitTesting:testFromPath', '"totalPassing":2,"totalFailing":0', null, 'tests/4_Ballot_test.sol') await clickAndCheckLog(browser, 'solidityUnitTesting:testFromPath', '"totalPassing":2,"totalFailing":0', null, 'tests/4_Ballot_test.sol')
}, },
'Should deactivate solidityUnitTesting': async function (browser: NightwatchBrowser) { 'Should deactivate solidityUnitTesting #group5': async function (browser: NightwatchBrowser) {
await clickAndCheckLog(browser, 'manager:deactivatePlugin', null, null, 'solidityUnitTesting') await clickAndCheckLog(browser, 'manager:deactivatePlugin', null, null, 'solidityUnitTesting')
browser.frameParent() browser.frameParent()
assertPluginIsActive(browser, 'solidityUnitTesting', false) assertPluginIsActive(browser, 'solidityUnitTesting', false)
@ -314,14 +315,14 @@ module.exports = {
// COMPILER // COMPILER
'Should compile a file': async function (browser: NightwatchBrowser) { 'Should compile a file #group6': async function (browser: NightwatchBrowser) {
await clickAndCheckLog(browser, 'solidity:compile', null, null, 'contracts/1_Storage.sol') await clickAndCheckLog(browser, 'solidity:compile', null, null, 'contracts/1_Storage.sol')
browser.pause(5000, async () => { browser.pause(5000, async () => {
await clickAndCheckLog(browser, 'solidity:compile', null, 'compilationFinished', null) await clickAndCheckLog(browser, 'solidity:compile', null, 'compilationFinished', null)
}) })
}, },
'Should get compilationresults': async function (browser: NightwatchBrowser) { 'Should get compilationresults #group6': async function (browser: NightwatchBrowser) {
await clickAndCheckLog(browser, 'solidity:getCompilationResult', 'contracts/1_Storage.sol', null, null) await clickAndCheckLog(browser, 'solidity:getCompilationResult', 'contracts/1_Storage.sol', null, null)
} }
} }

@ -45,6 +45,7 @@ const sources = [
] ]
module.exports = { module.exports = {
'@disabled': true,
before: function (browser, done) { before: function (browser, done) {
init(browser, done) init(browser, done)
}, },
@ -52,25 +53,27 @@ module.exports = {
'@sources': function () { '@sources': function () {
return sources return sources
}, },
'start Remixd': function (browser) {
Remixd: function (browser) { startRemixd(browser)
},
'run Remixd tests #group4': function (browser) {
runTests(browser) runTests(browser)
}, },
'Import from node_modules ': function (browser) { 'Import from node_modules #group1': function (browser) {
/* /*
when a relative import is used (i.e import "openzeppelin-solidity/contracts/math/SafeMath.sol") when a relative import is used (i.e import "openzeppelin-solidity/contracts/math/SafeMath.sol")
remix (as well as truffle) try to resolve it against the node_modules and installed_contracts folder. remix (as well as truffle) try to resolve it against the node_modules and installed_contracts folder.
*/ */
browser.waitForElementVisible('#icon-panel', 2000) browser.waitForElementVisible('#icon-panel', 2000)
// .clickLaunchIcon('filePanel') .clickLaunchIcon('filePanel')
.click('[data-path="ballot.sol"]') .click('[data-path="ballot.sol"]')
.addFile('test_import_node_modules.sol', sources[3]['test_import_node_modules.sol']) .addFile('test_import_node_modules.sol', sources[3]['test_import_node_modules.sol'])
.clickLaunchIcon('solidity') .clickLaunchIcon('solidity')
.setSolidityCompilerVersion('soljson-v0.5.0+commit.1d4f565a.js') .setSolidityCompilerVersion('soljson-v0.5.0+commit.1d4f565a.js')
.testContracts('test_import_node_modules.sol', sources[3]['test_import_node_modules.sol'], ['SafeMath']) .testContracts('test_import_node_modules.sol', sources[3]['test_import_node_modules.sol'], ['SafeMath'])
}, },
'Import from node_modules and reference a github import': function (browser) { 'Import from node_modules and reference a github import #group2': function (browser) {
browser.waitForElementVisible('#icon-panel', 2000) browser.waitForElementVisible('#icon-panel', 2000)
.clickLaunchIcon('filePanel') .clickLaunchIcon('filePanel')
.addFile('test_import_node_modules_with_github_import.sol', sources[4]['test_import_node_modules_with_github_import.sol']) .addFile('test_import_node_modules_with_github_import.sol', sources[4]['test_import_node_modules_with_github_import.sol'])
@ -78,7 +81,7 @@ module.exports = {
.setSolidityCompilerVersion('soljson-v0.8.0+commit.c7dfd78e.js') // open-zeppelin moved to pragma ^0.8.0 .setSolidityCompilerVersion('soljson-v0.8.0+commit.c7dfd78e.js') // open-zeppelin moved to pragma ^0.8.0
.testContracts('test_import_node_modules_with_github_import.sol', sources[4]['test_import_node_modules_with_github_import.sol'], ['ERC20', 'test11']) .testContracts('test_import_node_modules_with_github_import.sol', sources[4]['test_import_node_modules_with_github_import.sol'], ['ERC20', 'test11'])
}, },
'Static Analysis run with remixd': function (browser) { 'Static Analysis run with remixd #group3': function (browser) {
browser.testContracts('test_static_analysis_with_remixd_and_hardhat.sol', sources[5]['test_static_analysis_with_remixd_and_hardhat.sol'], ['test5']) browser.testContracts('test_static_analysis_with_remixd_and_hardhat.sol', sources[5]['test_static_analysis_with_remixd_and_hardhat.sol'], ['test5'])
.clickLaunchIcon('solidityStaticAnalysis') .clickLaunchIcon('solidityStaticAnalysis')
.click('#staticanalysisButton button') .click('#staticanalysisButton button')
@ -101,7 +104,7 @@ module.exports = {
.journalLastChildIncludes('On branch ') .journalLastChildIncludes('On branch ')
}, },
'Close Remixd': function (browser) { 'Close Remixd #group3': function (browser) {
browser browser
.clickLaunchIcon('pluginManager') .clickLaunchIcon('pluginManager')
.scrollAndClick('#pluginManager *[data-id="pluginManagerComponentDeactivateButtonremixd"]') .scrollAndClick('#pluginManager *[data-id="pluginManagerComponentDeactivateButtonremixd"]')
@ -109,7 +112,7 @@ module.exports = {
} }
} }
function runTests (browser: NightwatchBrowser) { function startRemixd (browser: NightwatchBrowser) {
const browserName = browser.options.desiredCapabilities.browserName const browserName = browser.options.desiredCapabilities.browserName
if (browserName === 'safari' || browserName === 'internet explorer') { if (browserName === 'safari' || browserName === 'internet explorer') {
console.log('do not run remixd test for ' + browserName + ': sauce labs doesn\'t seems to handle websocket') console.log('do not run remixd test for ' + browserName + ': sauce labs doesn\'t seems to handle websocket')
@ -126,7 +129,11 @@ function runTests (browser: NightwatchBrowser) {
.pause(2000) .pause(2000)
.click('#modal-footer-ok') .click('#modal-footer-ok')
// .click('*[data-id="workspacesModalDialog-modal-footer-ok-react"]') // .click('*[data-id="workspacesModalDialog-modal-footer-ok-react"]')
.clickLaunchIcon('filePanel') }
function runTests (browser: NightwatchBrowser) {
const browserName = browser.options.desiredCapabilities.browserName
browser.clickLaunchIcon('filePanel')
.waitForElementVisible('[data-path="folder1"]') .waitForElementVisible('[data-path="folder1"]')
.click('[data-path="folder1"]') .click('[data-path="folder1"]')
.waitForElementVisible('[data-path="contract1.sol"]') .waitForElementVisible('[data-path="contract1.sol"]')

@ -6,7 +6,7 @@ const passphrase = process.env.account_passphrase
const password = process.env.account_password const password = process.env.account_password
module.exports = { module.exports = {
'@disabled': true,
before: function (browser: NightwatchBrowser, done: VoidFunction) { before: function (browser: NightwatchBrowser, done: VoidFunction) {
init(browser, done) init(browser, done)
}, },
@ -15,14 +15,14 @@ module.exports = {
return sources return sources
}, },
'Should load run and deploy tab': function (browser: NightwatchBrowser) { 'Should load run and deploy tab #group1 #group2': function (browser: NightwatchBrowser) {
browser.waitForElementPresent('*[data-id="remixIdeSidePanel"]') browser.waitForElementPresent('*[data-id="remixIdeSidePanel"]')
.clickLaunchIcon('udapp') .clickLaunchIcon('udapp')
.waitForElementPresent('*[data-id="sidePanelSwapitTitle"]') .waitForElementPresent('*[data-id="sidePanelSwapitTitle"]')
.assert.containsText('*[data-id="sidePanelSwapitTitle"]', 'DEPLOY & RUN TRANSACTIONS') .assert.containsText('*[data-id="sidePanelSwapitTitle"]', 'DEPLOY & RUN TRANSACTIONS')
}, },
'Should load run and deploy tab and check value validation': function (browser: NightwatchBrowser) { 'Should load run and deploy tab and check value validation #group1': function (browser: NightwatchBrowser) {
browser.waitForElementPresent('*[data-id="remixIdeSidePanel"]') browser.waitForElementPresent('*[data-id="remixIdeSidePanel"]')
.assert.containsText('*[data-id="sidePanelSwapitTitle"]', 'DEPLOY & RUN TRANSACTIONS') .assert.containsText('*[data-id="sidePanelSwapitTitle"]', 'DEPLOY & RUN TRANSACTIONS')
.validateValueInput('#value', '0000', '0') .validateValueInput('#value', '0000', '0')
@ -30,30 +30,30 @@ module.exports = {
.validateValueInput('#value', 'dragon', '0') .validateValueInput('#value', 'dragon', '0')
}, },
'Should sign message using account key': function (browser: NightwatchBrowser) { 'Should sign message using account key #group2': function (browser: NightwatchBrowser) {
browser.waitForElementPresent('*[data-id="settingsRemixRunSignMsg"]') browser.waitForElementVisible('*[data-id="settingsRemixRunSignMsg"]')
.click('select[id="selectExEnvOptions"] option[value="vm-berlin"]') .click('select[id="selectExEnvOptions"] option[value="vm-berlin"]')
.pause(2000) .pause(2000)
.click('*[data-id="settingsRemixRunSignMsg"]') .click('*[data-id="settingsRemixRunSignMsg"]')
.pause(2000) .pause(2000)
.waitForElementPresent('*[data-id="modalDialogCustomPromptText"]') .waitForElementVisible('*[data-id="modalDialogCustomPromptText"]', 120000)
.setValue('*[data-id="modalDialogCustomPromptText"]', 'Remix is cool!') .setValue('*[data-id="modalDialogCustomPromptText"]', 'Remix is cool!')
.assert.elementNotPresent('*[data-id="settingsRemixRunSignMsgHash"]') .assert.elementNotPresent('*[data-id="settingsRemixRunSignMsgHash"]')
.assert.elementNotPresent('*[data-id="settingsRemixRunSignMsgSignature"]') .assert.elementNotPresent('*[data-id="settingsRemixRunSignMsgSignature"]')
.modalFooterOKClick() .modalFooterOKClick()
.waitForElementPresent('*[data-id="modalDialogContainer"]', 12000) .waitForElementVisible('*[data-id="modalDialogContainer"]', 12000)
.assert.elementPresent('*[data-id="settingsRemixRunSignMsgHash"]') .assert.elementPresent('*[data-id="settingsRemixRunSignMsgHash"]')
.assert.elementPresent('*[data-id="settingsRemixRunSignMsgSignature"]') .assert.elementPresent('*[data-id="settingsRemixRunSignMsgSignature"]')
.modalFooterOKClick() .modalFooterOKClick()
}, },
'Should deploy contract on JavascriptVM': function (browser: NightwatchBrowser) { 'Should deploy contract on JavascriptVM #group3': function (browser: NightwatchBrowser) {
browser.waitForElementPresent('*[data-id="remixIdeSidePanel"]') browser.waitForElementVisible('*[data-id="remixIdeSidePanel"]')
.clickLaunchIcon('filePanel') .clickLaunchIcon('filePanel')
.addFile('Greet.sol', sources[0]['Greet.sol']) .addFile('Greet.sol', sources[0]['Greet.sol'])
.clickLaunchIcon('udapp') .clickLaunchIcon('udapp')
.selectAccount('0xCA35b7d915458EF540aDe6068dFe2F44E8fa733c') .selectAccount('0xCA35b7d915458EF540aDe6068dFe2F44E8fa733c')
.waitForElementPresent('*[data-id="Deploy - transact (not payable)"]', 45000) .waitForElementVisible('*[data-id="Deploy - transact (not payable)"]', 45000)
.click('*[data-id="Deploy - transact (not payable)"]') .click('*[data-id="Deploy - transact (not payable)"]')
.pause(5000) .pause(5000)
.testFunction('last', { .testFunction('last', {
@ -61,7 +61,7 @@ module.exports = {
}) })
}, },
'Should run low level interaction (fallback function)': function (browser: NightwatchBrowser) { 'Should run low level interaction (fallback function) #group3': function (browser: NightwatchBrowser) {
browser.waitForElementPresent('*[data-id="remixIdeSidePanel"]') browser.waitForElementPresent('*[data-id="remixIdeSidePanel"]')
.waitForElementPresent('*[data-id="universalDappUiTitleExpander"]') .waitForElementPresent('*[data-id="universalDappUiTitleExpander"]')
.click('*[data-id="universalDappUiTitleExpander"]') .click('*[data-id="universalDappUiTitleExpander"]')

@ -3,6 +3,7 @@ import { NightwatchBrowser } from 'nightwatch'
import init from '../helpers/init' import init from '../helpers/init'
module.exports = { module.exports = {
'@disabled': true,
before: function (browser: NightwatchBrowser, done: VoidFunction) { before: function (browser: NightwatchBrowser, done: VoidFunction) {
init(browser, done) init(browser, done)
}, },
@ -11,11 +12,11 @@ module.exports = {
return sources return sources
}, },
'Test Simple Contract': function (browser: NightwatchBrowser) { 'Test Simple Contract #group1': function (browser: NightwatchBrowser) {
browser.testContracts('Untitled.sol', sources[0]['Untitled.sol'], ['test1', 'test2']) browser.testContracts('Untitled.sol', sources[0]['Untitled.sol'], ['test1', 'test2'])
}, },
'Test Success Import': function (browser: NightwatchBrowser) { 'Test Success Import #group1': function (browser: NightwatchBrowser) {
browser.addFile('Untitled1.sol', sources[1]['Untitled1.sol']) browser.addFile('Untitled1.sol', sources[1]['Untitled1.sol'])
.addFile('Untitled2.sol', sources[1]['Untitled2.sol']) .addFile('Untitled2.sol', sources[1]['Untitled2.sol'])
.openFile('Untitled1.sol') .openFile('Untitled1.sol')
@ -23,13 +24,13 @@ module.exports = {
.pause(1000) .pause(1000)
}, },
'Test Failed Import': function (browser: NightwatchBrowser) { 'Test Failed Import #group1': function (browser: NightwatchBrowser) {
browser.addFile('Untitled3.sol', sources[2]['Untitled3.sol']) browser.addFile('Untitled3.sol', sources[2]['Untitled3.sol'])
.clickLaunchIcon('solidity') .clickLaunchIcon('solidity')
.assert.containsText('#compileTabView .error pre', 'not found Untitled11.sol') .assert.containsText('#compileTabView .error pre', 'not found Untitled11.sol')
}, },
'Test Github Import - from master branch': function (browser: NightwatchBrowser) { 'Test Github Import - from master branch #group1': function (browser: NightwatchBrowser) {
browser browser
.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]['Untitled4.sol']) .addFile('Untitled4.sol', sources[3]['Untitled4.sol'])
@ -37,7 +38,7 @@ module.exports = {
.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 #group2': function (browser: NightwatchBrowser) {
browser browser
.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]['Untitled5.sol']) .addFile('Untitled5.sol', sources[4]['Untitled5.sol'])
@ -45,7 +46,7 @@ module.exports = {
.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 #group2': function (browser: NightwatchBrowser) {
browser browser
.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)
.clickLaunchIcon('filePanel') .clickLaunchIcon('filePanel')
@ -55,7 +56,7 @@ module.exports = {
.verifyContracts(['test10', 'ERC20'], { wait: 10000 }) .verifyContracts(['test10', 'ERC20'], { wait: 10000 })
}, },
'Test Github Import - raw URL': function (browser: NightwatchBrowser) { 'Test Github Import - raw URL #group4': function (browser: NightwatchBrowser) {
browser browser
.clickLaunchIcon('filePanel') .clickLaunchIcon('filePanel')
.click('li[data-id="treeViewLitreeViewItemREADME.txt"') .click('li[data-id="treeViewLitreeViewItemREADME.txt"')
@ -64,7 +65,7 @@ module.exports = {
.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 #group3': function (browser: NightwatchBrowser) {
browser browser
.setSolidityCompilerVersion('soljson-v0.7.4+commit.3f05b770.js') .setSolidityCompilerVersion('soljson-v0.7.4+commit.3f05b770.js')
.clickLaunchIcon('filePanel') .clickLaunchIcon('filePanel')
@ -80,7 +81,7 @@ module.exports = {
}) })
}, },
'Test NPM Import (with unpkg.com)': function (browser: NightwatchBrowser) { 'Test NPM Import (with unpkg.com) #group3': function (browser: NightwatchBrowser) {
browser browser
.setSolidityCompilerVersion('soljson-v0.8.7+commit.e28d00a7.js') .setSolidityCompilerVersion('soljson-v0.8.7+commit.e28d00a7.js')
.clickLaunchIcon('filePanel') .clickLaunchIcon('filePanel')

@ -0,0 +1,6 @@
'use strict'
import * as test from './solidityImport.test'
import buildGroupTest from '../helpers/buildgrouptest'
const group = 'group1'
module.exports = buildGroupTest(group, test)

@ -4,7 +4,7 @@ import { NightwatchBrowser } from 'nightwatch'
import init from '../helpers/init' import init from '../helpers/init'
module.exports = { module.exports = {
'@disabled': true,
before: function (browser: NightwatchBrowser, done) { before: function (browser: NightwatchBrowser, done) {
init(browser, done) init(browser, done)
}, },
@ -12,18 +12,24 @@ module.exports = {
'@sources': function () { '@sources': function () {
return sources return sources
}, },
'open SUT plugin': function (browser: NightwatchBrowser) {
'Should launch solidity unit test plugin and create test files in FE': function (browser: NightwatchBrowser) {
browser.waitForElementPresent('*[data-id="verticalIconsKindfilePanel"]') browser.waitForElementPresent('*[data-id="verticalIconsKindfilePanel"]')
.clickLaunchIcon('filePanel')
.addFile('simple_storage.sol', sources[0]['simple_storage.sol'])
.addFile('ks2a.sol', sources[0]['ks2a.sol'])
.clickLaunchIcon('pluginManager') .clickLaunchIcon('pluginManager')
.scrollAndClick('*[data-id="pluginManagerComponentActivateButtonsolidityUnitTesting"]') .scrollAndClick('*[data-id="pluginManagerComponentActivateButtonsolidityUnitTesting"]')
.click('*[data-id="verticalIconsKindsolidityUnitTesting"]') .click('*[data-id="verticalIconsKindsolidityUnitTesting"]')
.waitForElementPresent('*[data-id="sidePanelSwapitTitle"]') .waitForElementPresent('*[data-id="sidePanelSwapitTitle"]')
.assert.containsText('*[data-id="sidePanelSwapitTitle"]', 'SOLIDITY UNIT TESTING') .assert.containsText('*[data-id="sidePanelSwapitTitle"]', 'SOLIDITY UNIT TESTING')
.clickLaunchIcon('filePanel') .clickLaunchIcon('filePanel')
.waitForElementPresent('[data-id="treeViewDivtreeViewItemtests"]')
.click('[data-id="treeViewDivtreeViewItemtests"]')
.clickLaunchIcon('pluginManager')
},
'Should launch solidity unit test plugin and create test files in FE #group1 #group2': function (browser: NightwatchBrowser) {
browser.waitForElementPresent('*[data-id="verticalIconsKindfilePanel"]')
.clickLaunchIcon('filePanel')
.addFile('simple_storage.sol', sources[0]['simple_storage.sol'])
.addFile('ks2a.sol', sources[0]['ks2a.sol'])
.waitForElementVisible('li[data-id="treeViewLitreeViewItem.deps/remix-tests/remix_tests.sol"]') .waitForElementVisible('li[data-id="treeViewLitreeViewItem.deps/remix-tests/remix_tests.sol"]')
.waitForElementVisible('li[data-id="treeViewLitreeViewItem.deps/remix-tests/remix_accounts.sol"]') .waitForElementVisible('li[data-id="treeViewLitreeViewItem.deps/remix-tests/remix_accounts.sol"]')
.openFile('.deps/remix-tests/remix_tests.sol') .openFile('.deps/remix-tests/remix_tests.sol')
@ -34,22 +40,19 @@ module.exports = {
.getEditorValue((content) => browser.assert.ok(content.indexOf('library TestsAccounts {') !== -1)) .getEditorValue((content) => browser.assert.ok(content.indexOf('library TestsAccounts {') !== -1))
}, },
'Should generate test file': function (browser: NightwatchBrowser) { 'Should generate test file #group1': function (browser: NightwatchBrowser) {
browser.waitForElementPresent('*[data-id="verticalIconsKindfilePanel"]') browser.waitForElementPresent('*[data-id="verticalIconsKindfilePanel"]')
.clickLaunchIcon('filePanel') .clickLaunchIcon('filePanel')
.openFile('simple_storage.sol') .openFile('simple_storage.sol')
.click('*[data-id="verticalIconsKindsolidityUnitTesting"]') .click('*[data-id="verticalIconsKindsolidityUnitTesting"]')
.waitForElementPresent('*[data-id="testTabGenerateTestFile"]') .waitForElementPresent('*[data-id="testTabGenerateTestFile"]')
.click('*[data-id="testTabGenerateTestFile"]') .click('*[data-id="testTabGenerateTestFile"]')
.waitForElementPresent('*[title="default_workspace/tests/simple_storage_test.sol"]')
.clickLaunchIcon('filePanel') .clickLaunchIcon('filePanel')
.waitForElementPresent('[data-id="treeViewDivtreeViewItemtests"]') .waitForElementPresent('*[title="default_workspace/tests/simple_storage_test.sol"]')
.click('[data-id="treeViewDivtreeViewItemtests"]')
.openFile('tests/simple_storage_test.sol')
.removeFile('tests/simple_storage_test.sol', 'default_workspace') .removeFile('tests/simple_storage_test.sol', 'default_workspace')
}, },
'Should run simple unit test `simple_storage_test.sol` ': function (browser: NightwatchBrowser) { 'Should run simple unit test `simple_storage_test.sol` #group1': function (browser: NightwatchBrowser) {
browser.waitForElementPresent('*[data-id="verticalIconsKindfilePanel"]') browser.waitForElementPresent('*[data-id="verticalIconsKindfilePanel"]')
.addFile('tests/simple_storage_test.sol', sources[0]['tests/simple_storage_test.sol']) .addFile('tests/simple_storage_test.sol', sources[0]['tests/simple_storage_test.sol'])
.click('*[data-id="verticalIconsKindsolidityUnitTesting"]') .click('*[data-id="verticalIconsKindsolidityUnitTesting"]')
@ -66,14 +69,14 @@ module.exports = {
.waitForElementContainsText('*[data-id="testTabSolidityUnitTestsOutput"]', 'FAIL MyTest (tests/simple_storage_test.sol)', 120000) .waitForElementContainsText('*[data-id="testTabSolidityUnitTestsOutput"]', 'FAIL MyTest (tests/simple_storage_test.sol)', 120000)
}, },
'Should run advance unit test using natspec and experimental ABIEncoderV2 `ks2b_test.sol` ': function (browser: NightwatchBrowser) { 'Should run advance unit test using natspec and experimental ABIEncoderV2 `ks2b_test.sol` #group2': function (browser: NightwatchBrowser) {
browser.waitForElementPresent('*[data-id="verticalIconsKindfilePanel"]') browser.waitForElementPresent('*[data-id="verticalIconsKindfilePanel"]')
.clickLaunchIcon('filePanel') .clickLaunchIcon('filePanel')
.addFile('tests/ks2b_test.sol', sources[0]['tests/ks2b_test.sol']) .addFile('tests/ks2b_test.sol', sources[0]['tests/ks2b_test.sol'])
.click('*[data-id="verticalIconsKindsolidityUnitTesting"]') .click('*[data-id="verticalIconsKindsolidityUnitTesting"]')
.waitForElementPresent('*[data-id="testTabCheckAllTests"]') .waitForElementPresent('*[data-id="testTabCheckAllTests"]')
.click('*[data-id="testTabCheckAllTests"]') .click('*[data-id="testTabCheckAllTests"]')
.clickElementAtPosition('.singleTestLabel', 2) .clickElementAtPosition('.singleTestLabel', 1)
.scrollAndClick('*[data-id="testTabRunTestsTabRunAction"]') .scrollAndClick('*[data-id="testTabRunTestsTabRunAction"]')
.waitForElementContainsText('*[data-id="testTabSolidityUnitTestsOutput"]', 'tests/ks2b_test.sol', 120000) .waitForElementContainsText('*[data-id="testTabSolidityUnitTestsOutput"]', 'tests/ks2b_test.sol', 120000)
.waitForElementContainsText('*[data-id="testTabSolidityUnitTestsOutput"]', '✓ Check project exists', 120000) .waitForElementContainsText('*[data-id="testTabSolidityUnitTestsOutput"]', '✓ Check project exists', 120000)
@ -86,11 +89,10 @@ module.exports = {
.waitForElementContainsText('*[data-id="testTabSolidityUnitTestsOutput"]', 'wrong value', 120000) .waitForElementContainsText('*[data-id="testTabSolidityUnitTestsOutput"]', 'wrong value', 120000)
}, },
'Should stop unit tests during test execution` ': function (browser: NightwatchBrowser) { 'Should stop unit tests during test execution` #group2': function (browser: NightwatchBrowser) {
browser.waitForElementPresent('*[data-id="verticalIconsKindfilePanel"]') browser.waitForElementPresent('*[data-id="verticalIconsKindfilePanel"]')
.waitForElementPresent('*[data-id="testTabRunTestsTabRunAction"]') .waitForElementPresent('*[data-id="testTabRunTestsTabRunAction"]')
.clickElementAtPosition('.singleTestLabel', 0) .clickElementAtPosition('.singleTestLabel', 0)
.clickElementAtPosition('.singleTestLabel', 1)
.scrollAndClick('*[data-id="testTabRunTestsTabRunAction"]') .scrollAndClick('*[data-id="testTabRunTestsTabRunAction"]')
.pause(2000) .pause(2000)
.click('*[data-id="testTabRunTestsTabStopAction"]') .click('*[data-id="testTabRunTestsTabStopAction"]')
@ -100,14 +102,15 @@ module.exports = {
.waitForElementContainsText('*[data-id="testTabTestsExecutionStopped"]', 'The test execution has been stopped', 60000) .waitForElementContainsText('*[data-id="testTabTestsExecutionStopped"]', 'The test execution has been stopped', 60000)
}, },
'Should fail on compilation, open file on error click, not disappear error': function (browser: NightwatchBrowser) { 'Should fail on compilation, open file on error click, not disappear error #group2': function (browser: NightwatchBrowser) {
browser.waitForElementPresent('*[data-id="verticalIconsKindfilePanel"]') browser.waitForElementPresent('*[data-id="verticalIconsKindfilePanel"]')
.addFile('tests/compilationError_test.sol', sources[0]['compilationError_test.sol']) .addFile('tests/compilationError_test.sol', sources[0]['compilationError_test.sol'])
.click('div[title="default_workspace/tests/compilationError_test.sol"] span[class="close-tabs"]') .click('div[title="default_workspace/tests/compilationError_test.sol"] span[class="close-tabs"]')
.clickLaunchIcon('solidityUnitTesting') .clickLaunchIcon('solidityUnitTesting')
.pause(2000) .pause(2000)
.click('*[data-id="testTabCheckAllTests"]') .click('*[data-id="testTabCheckAllTests"]')
.clickElementAtPosition('.singleTestLabel', 3) // .click('#singleTesttests/compilationError_test.sol')
.clickElementAtPosition('.singleTestLabel', 2)
.scrollAndClick('*[data-id="testTabRunTestsTabRunAction"]') .scrollAndClick('*[data-id="testTabRunTestsTabRunAction"]')
.waitForElementContainsText('*[data-id="testTabSolidityUnitTestsOutput"]', 'SyntaxError: No visibility specified', 120000) .waitForElementContainsText('*[data-id="testTabSolidityUnitTestsOutput"]', 'SyntaxError: No visibility specified', 120000)
.waitForElementContainsText('*[data-id="testTabTestsExecutionStoppedError"]', 'The test execution has been stopped because of error(s) in your test file', 120000) .waitForElementContainsText('*[data-id="testTabTestsExecutionStoppedError"]', 'The test execution has been stopped because of error(s) in your test file', 120000)
@ -119,31 +122,31 @@ module.exports = {
.verify.elementPresent('#solidityUnittestsOutput *[data-id="tests/compilationError_test.sol"]') .verify.elementPresent('#solidityUnittestsOutput *[data-id="tests/compilationError_test.sol"]')
}, },
'Should fail on deploy': function (browser: NightwatchBrowser) { 'Should fail on deploy #group3': function (browser: NightwatchBrowser) {
browser.waitForElementPresent('*[data-id="verticalIconsKindfilePanel"]') browser.waitForElementPresent('*[data-id="verticalIconsKindfilePanel"]')
.addFile('tests/deployError_test.sol', sources[0]['tests/deployError_test.sol']) .addFile('tests/deployError_test.sol', sources[0]['tests/deployError_test.sol'])
.clickLaunchIcon('filePanel') .clickLaunchIcon('filePanel')
.openFile('tests/deployError_test.sol') .openFile('tests/deployError_test.sol')
.clickLaunchIcon('solidityUnitTesting') .clickLaunchIcon('solidityUnitTesting')
.click('*[data-id="testTabCheckAllTests"]') .click('*[data-id="testTabCheckAllTests"]')
.clickElementAtPosition('.singleTestLabel', 4) .clickElementAtPosition('.singleTestLabel', 1)
.scrollAndClick('*[data-id="testTabRunTestsTabRunAction"]') .scrollAndClick('*[data-id="testTabRunTestsTabRunAction"]')
.waitForElementContainsText('*[data-id="testTabSolidityUnitTestsOutput"]', 'contract deployment failed after trying twice', 120000) .waitForElementContainsText('*[data-id="testTabSolidityUnitTestsOutput"]', 'contract deployment failed after trying twice', 120000)
}, },
'Should fail when parameters are passed to method in test contract': function (browser: NightwatchBrowser) { 'Should fail when parameters are passed to method in test contract #group3': function (browser: NightwatchBrowser) {
browser.waitForElementPresent('*[data-id="verticalIconsKindfilePanel"]') browser.waitForElementPresent('*[data-id="verticalIconsKindfilePanel"]')
.addFile('tests/methodFailure_test.sol', sources[0]['tests/methodFailure_test.sol']) .addFile('tests/methodFailure_test.sol', sources[0]['tests/methodFailure_test.sol'])
.clickLaunchIcon('filePanel') .clickLaunchIcon('filePanel')
.openFile('tests/methodFailure_test.sol') .openFile('tests/methodFailure_test.sol')
.clickLaunchIcon('solidityUnitTesting') .clickLaunchIcon('solidityUnitTesting')
.click('*[data-id="testTabCheckAllTests"]') .click('*[data-id="testTabCheckAllTests"]')
.clickElementAtPosition('.singleTestLabel', 5) .clickElementAtPosition('.singleTestLabel', 2)
.scrollAndClick('*[data-id="testTabRunTestsTabRunAction"]') .scrollAndClick('*[data-id="testTabRunTestsTabRunAction"]')
.waitForElementContainsText('*[data-id="testTabSolidityUnitTestsOutput"]', 'Method \'add\' can not have parameters inside a test contract', 120000) .waitForElementContainsText('*[data-id="testTabSolidityUnitTestsOutput"]', 'Method \'add\' can not have parameters inside a test contract', 120000)
}, },
'Changing current path': function (browser: NightwatchBrowser) { 'Changing current path #group3': function (browser: NightwatchBrowser) {
browser browser
.waitForElementPresent('*[data-id="verticalIconsKindfilePanel"]') .waitForElementPresent('*[data-id="verticalIconsKindfilePanel"]')
.addFile('myTests/simple_storage_test.sol', sources[0]['tests/simple_storage_test.sol']) .addFile('myTests/simple_storage_test.sol', sources[0]['tests/simple_storage_test.sol'])
@ -159,7 +162,7 @@ module.exports = {
.click('*[data-id="testTabGenerateTestFolder"]') .click('*[data-id="testTabGenerateTestFolder"]')
}, },
'Changing current path when workspace changed and checking test files creation': function (browser: NightwatchBrowser) { 'Changing current path when workspace changed and checking test files creation #group4': function (browser: NightwatchBrowser) {
browser browser
.waitForElementPresent('*[data-id="verticalIconsKindfilePanel"]') .waitForElementPresent('*[data-id="verticalIconsKindfilePanel"]')
.clickLaunchIcon('settings') .clickLaunchIcon('settings')
@ -191,7 +194,7 @@ module.exports = {
.verify.attributeEquals('*[data-id="uiPathInput"]', 'value', 'tests') .verify.attributeEquals('*[data-id="uiPathInput"]', 'value', 'tests')
}, },
'Solidity Unit tests Basic': function (browser: NightwatchBrowser) { 'Solidity Unit tests Basic #group4': function (browser: NightwatchBrowser) {
browser browser
.waitForElementPresent('*[data-id="verticalIconsKindfilePanel"]') .waitForElementPresent('*[data-id="verticalIconsKindfilePanel"]')
.clickLaunchIcon('filePanel') .clickLaunchIcon('filePanel')
@ -209,7 +212,7 @@ module.exports = {
.waitForElementContainsText('#solidityUnittestsOutput', '✓ Check winnin proposal with return value', 60000) .waitForElementContainsText('#solidityUnittestsOutput', '✓ Check winnin proposal with return value', 60000)
}, },
'Solidity Unit tests with hardhat console log': function (browser: NightwatchBrowser) { 'Solidity Unit tests with hardhat console log #group4': function (browser: NightwatchBrowser) {
const runtimeBrowser = browser.options.desiredCapabilities.browserName const runtimeBrowser = browser.options.desiredCapabilities.browserName
browser browser
@ -241,7 +244,7 @@ module.exports = {
.removeFile('tests/hhLogs_test.sol', 'workspace_new') .removeFile('tests/hhLogs_test.sol', 'workspace_new')
}, },
'Solidity Unit tests with hardhat console log for EVM revert': function (browser: NightwatchBrowser) { 'Solidity Unit tests with hardhat console log for EVM revert #group5': function (browser: NightwatchBrowser) {
browser browser
.waitForElementPresent('*[data-id="verticalIconsKindfilePanel"]') .waitForElementPresent('*[data-id="verticalIconsKindfilePanel"]')
.addFile('tests/ballotFailedLog_test.sol', sources[0]['tests/ballotFailedLog_test.sol']) .addFile('tests/ballotFailedLog_test.sol', sources[0]['tests/ballotFailedLog_test.sol'])
@ -252,13 +255,13 @@ module.exports = {
.pause(2000) .pause(2000)
.waitForElementVisible('*[data-id="testTabSolidityUnitTestsOutputheader"]', 120000) .waitForElementVisible('*[data-id="testTabSolidityUnitTestsOutputheader"]', 120000)
.waitForElementContainsText('#solidityUnittestsOutput', 'tests/ballotFailedLog_test.sol', 60000) .waitForElementContainsText('#solidityUnittestsOutput', 'tests/ballotFailedLog_test.sol', 60000)
.assert.containsText('#journal > div:nth-child(5) > span', 'Check winning proposal:') .assert.containsText('#journal', 'Check winning proposal:')
.assert.containsText('#journal > div:nth-child(5) > span', 'Inside checkWinningProposal') .assert.containsText('#journal', 'Inside checkWinningProposal')
.openFile('tests/ballotFailedLog_test.sol') .openFile('tests/ballotFailedLog_test.sol')
.removeFile('tests/ballotFailedLog_test.sol', 'workspace_new') .removeFile('tests/ballotFailedLog_test.sol', 'workspace_new')
}, },
'Debug tests using debugger': function (browser: NightwatchBrowser) { 'Debug tests using debugger #group5': function (browser: NightwatchBrowser) {
browser browser
.waitForElementPresent('*[data-id="verticalIconsKindfilePanel"]') .waitForElementPresent('*[data-id="verticalIconsKindfilePanel"]')
.addFile('tests/ballotFailedDebug_test.sol', sources[0]['tests/ballotFailedDebug_test.sol']) .addFile('tests/ballotFailedDebug_test.sol', sources[0]['tests/ballotFailedDebug_test.sol'])
@ -275,6 +278,7 @@ module.exports = {
.click('#Check_winning_proposal_failed') .click('#Check_winning_proposal_failed')
.waitForElementContainsText('*[data-id="sidePanelSwapitTitle"]', 'DEBUGGER', 60000) .waitForElementContainsText('*[data-id="sidePanelSwapitTitle"]', 'DEBUGGER', 60000)
.waitForElementContainsText('*[data-id="functionPanel"]', 'checkWinningProposalFailed()', 60000) .waitForElementContainsText('*[data-id="functionPanel"]', 'checkWinningProposalFailed()', 60000)
.waitForElementVisible('*[data-id="dropdownPanelSolidityLocals"]').pause(1000)
.click('*[data-id="dropdownPanelSolidityLocals"]') .click('*[data-id="dropdownPanelSolidityLocals"]')
.waitForElementContainsText('*[data-id="solidityLocals"]', 'no locals', 60000) .waitForElementContainsText('*[data-id="solidityLocals"]', 'no locals', 60000)
// eslint-disable-next-line dot-notation // eslint-disable-next-line dot-notation
@ -320,10 +324,12 @@ module.exports = {
.removeFile('tests/ballotFailedDebug_test.sol', 'workspace_new') .removeFile('tests/ballotFailedDebug_test.sol', 'workspace_new')
}, },
'Basic Solidity Unit tests with local compiler': function (browser: NightwatchBrowser) { 'Basic Solidity Unit tests with local compiler #group6': function (browser: NightwatchBrowser) {
browser browser
.clickLaunchIcon('solidity') .clickLaunchIcon('solidity')
.setSolidityCompilerVersion('builtin') .setSolidityCompilerVersion('builtin')
.clickLaunchIcon('filePanel')
.click('*[data-id="treeViewLitreeViewItemcontracts"]')
.openFile('contracts/3_Ballot.sol') .openFile('contracts/3_Ballot.sol')
.clickLaunchIcon('pluginManager') .clickLaunchIcon('pluginManager')
.scrollAndClick('[data-id="pluginManagerComponentDeactivateButtonsolidityUnitTesting"]') .scrollAndClick('[data-id="pluginManagerComponentDeactivateButtonsolidityUnitTesting"]')

@ -3,6 +3,7 @@ import { NightwatchBrowser } from 'nightwatch'
import init from '../helpers/init' import init from '../helpers/init'
module.exports = { module.exports = {
'@disabled': true,
before: function (browser: NightwatchBrowser, done: VoidFunction) { before: function (browser: NightwatchBrowser, done: VoidFunction) {
// this test suite also contribute testing https://github.com/ethereum/remix/pull/1497 and https://github.com/ethereum/remix-ide/pull/2898 // this test suite also contribute testing https://github.com/ethereum/remix/pull/1497 and https://github.com/ethereum/remix-ide/pull/2898
// quick explanation: // quick explanation:
@ -17,7 +18,7 @@ module.exports = {
return sources return sources
}, },
'Use special functions receive/fallback - both are declared, sending data': function (browser: NightwatchBrowser) { 'Use special functions receive/fallback - both are declared, sending data #group1': function (browser: NightwatchBrowser) {
browser.waitForElementVisible('#icon-panel', 10000) browser.waitForElementVisible('#icon-panel', 10000)
.testContracts('receiveAndFallback.sol', sources[0]['receiveAndFallback.sol'], ['CheckSpecials']) // compile .testContracts('receiveAndFallback.sol', sources[0]['receiveAndFallback.sol'], ['CheckSpecials']) // compile
.clickLaunchIcon('udapp') .clickLaunchIcon('udapp')
@ -37,7 +38,7 @@ module.exports = {
}) })
}, },
'Use special functions receive/fallback - both are declared, failing sending data < 1 byte': function (browser: NightwatchBrowser) { 'Use special functions receive/fallback - both are declared, failing sending data < 1 byte #group1': function (browser: NightwatchBrowser) {
// don't need to redeploy it, same contract // don't need to redeploy it, same contract
browser.perform((done) => { browser.perform((done) => {
browser.getAddressAtPosition(0, (address) => { browser.getAddressAtPosition(0, (address) => {
@ -49,7 +50,7 @@ module.exports = {
}) })
}) })
}, },
'Use special functions receive/fallback - both are declared, failing sending data with odd number of digits': function (browser: NightwatchBrowser) { 'Use special functions receive/fallback - both are declared, failing sending data with odd number of digits #group1': function (browser: NightwatchBrowser) {
// don't need to redeploy it, same contract // don't need to redeploy it, same contract
browser.perform((done) => { browser.perform((done) => {
browser.getAddressAtPosition(0, (address) => { browser.getAddressAtPosition(0, (address) => {
@ -61,7 +62,7 @@ module.exports = {
}) })
}) })
}, },
'Use special functions receive/fallback - both are declared - receive called, sending wei': function (browser: NightwatchBrowser) { 'Use special functions receive/fallback - both are declared - receive called, sending wei #group1': function (browser: NightwatchBrowser) {
// don't need to redeploy it, same contract // don't need to redeploy it, same contract
browser.perform((done) => { browser.perform((done) => {
browser.getAddressAtPosition(0, (address) => { browser.getAddressAtPosition(0, (address) => {
@ -74,7 +75,7 @@ module.exports = {
}) })
}) })
}, },
'Use special functions receive/fallback - both are declared - fallback should fail cause not payable, sending data and wei': function (browser: NightwatchBrowser) { 'Use special functions receive/fallback - both are declared - fallback should fail cause not payable, sending data and wei #group1': function (browser: NightwatchBrowser) {
// don't need to redeploy it, same contract // don't need to redeploy it, same contract
browser.perform((done) => { browser.perform((done) => {
browser.getAddressAtPosition(0, (address) => { browser.getAddressAtPosition(0, (address) => {
@ -86,15 +87,15 @@ module.exports = {
}) })
}) })
}, },
'Use special functions receive/fallback - only receive is declared, sending wei': function (browser: NightwatchBrowser) { 'Use special functions receive/fallback - only receive is declared, sending wei #group2': function (browser: NightwatchBrowser) {
browser.waitForElementVisible('#icon-panel', 10000) browser.waitForElementVisible('#icon-panel', 10000)
.testContracts('receiveOnly.sol', sources[1]['receiveOnly.sol'], ['CheckSpecials']) .testContracts('receiveOnly.sol', sources[1]['receiveOnly.sol'], ['CheckSpecials'])
.clickLaunchIcon('udapp') .clickLaunchIcon('udapp')
.selectContract('CheckSpecials') .selectContract('CheckSpecials')
.createContract('') .createContract('')
.clickInstance(1) .clickInstance(0)
.perform((done) => { .perform((done) => {
browser.getAddressAtPosition(1, (address) => { browser.getAddressAtPosition(0, (address) => {
browser.sendLowLevelTx(address, '1', '') browser.sendLowLevelTx(address, '1', '')
.pause(1000) .pause(1000)
.journalLastChildIncludes('to: CheckSpecials.(receive)') .journalLastChildIncludes('to: CheckSpecials.(receive)')
@ -104,10 +105,10 @@ module.exports = {
}) })
}) })
}, },
'Use special functions receive/fallback - only receive is declared, failing, fallback is not declared, sending data': function (browser: NightwatchBrowser) { 'Use special functions receive/fallback - only receive is declared, failing, fallback is not declared, sending data #group2': function (browser: NightwatchBrowser) {
// don't need to redeploy it, same contract // don't need to redeploy it, same contract
browser.perform((done) => { browser.perform((done) => {
browser.getAddressAtPosition(1, (address) => { browser.getAddressAtPosition(0, (address) => {
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"]`)
@ -116,15 +117,15 @@ module.exports = {
}) })
}) })
}, },
'Use special functions receive/fallback - only fallback declared and is payable, sending wei': function (browser: NightwatchBrowser) { 'Use special functions receive/fallback - only fallback declared and is payable, sending wei #group3': function (browser: NightwatchBrowser) {
browser.waitForElementVisible('#icon-panel', 10000) browser.waitForElementVisible('#icon-panel', 10000)
.testContracts('fallbackOnlyPayable.sol', sources[2]['fallbackOnlyPayable.sol'], ['CheckSpecials']) .testContracts('fallbackOnlyPayable.sol', sources[2]['fallbackOnlyPayable.sol'], ['CheckSpecials'])
.clickLaunchIcon('udapp') .clickLaunchIcon('udapp')
.selectContract('CheckSpecials') .selectContract('CheckSpecials')
.createContract('') .createContract('')
.clickInstance(2) .clickInstance(0)
.perform((done) => { .perform((done) => {
browser.getAddressAtPosition(2, (address) => { browser.getAddressAtPosition(0, (address) => {
browser.sendLowLevelTx(address, '1', '') browser.sendLowLevelTx(address, '1', '')
.pause(1000) .pause(1000)
.journalLastChildIncludes('to: CheckSpecials.(fallback)') .journalLastChildIncludes('to: CheckSpecials.(fallback)')
@ -134,10 +135,10 @@ module.exports = {
}) })
}) })
}, },
'Use special functions receive/fallback - only fallback is diclared and is payable, sending data and wei': function (browser: NightwatchBrowser) { 'Use special functions receive/fallback - only fallback is diclared and is payable, sending data and wei #group3': function (browser: NightwatchBrowser) {
// don't need to redeploy it, same contract // don't need to redeploy it, same contract
browser.perform((done) => { browser.perform((done) => {
browser.getAddressAtPosition(2, (address) => { browser.getAddressAtPosition(0, (address) => {
browser.sendLowLevelTx(address, '1', '0xaa') browser.sendLowLevelTx(address, '1', '0xaa')
.pause(1000) .pause(1000)
.journalLastChildIncludes('to: CheckSpecials.(fallback)') .journalLastChildIncludes('to: CheckSpecials.(fallback)')
@ -147,15 +148,15 @@ module.exports = {
}) })
}) })
}, },
'Use special functions receive/fallback - only fallback is declared, fallback should fail cause not payable, sending wei': function (browser: NightwatchBrowser) { 'Use special functions receive/fallback - only fallback is declared, fallback should fail cause not payable, sending wei #group4': function (browser: NightwatchBrowser) {
browser.waitForElementVisible('#icon-panel', 10000) browser.waitForElementVisible('#icon-panel', 10000)
.testContracts('fallbackOnlyNotPayable.sol', sources[3]['fallbackOnlyNotPayable.sol'], ['CheckSpecials']) .testContracts('fallbackOnlyNotPayable.sol', sources[3]['fallbackOnlyNotPayable.sol'], ['CheckSpecials'])
.clickLaunchIcon('udapp') .clickLaunchIcon('udapp')
.selectContract('CheckSpecials') .selectContract('CheckSpecials')
.createContract('') .createContract('')
.clickInstance(3) .clickInstance(0)
.perform((done) => { .perform((done) => {
browser.getAddressAtPosition(3, (address) => { browser.getAddressAtPosition(0, (address) => {
browser.sendLowLevelTx(address, '1', '') browser.sendLowLevelTx(address, '1', '')
.pause(1000) .pause(1000)
.waitForElementVisible(`#instance${address} label[id="deployAndRunLLTxError"]`) .waitForElementVisible(`#instance${address} label[id="deployAndRunLLTxError"]`)
@ -164,7 +165,7 @@ module.exports = {
}) })
}) })
}, },
'Use special functions receive/fallback - receive and fallback are declared, sending data and wei': function (browser: NightwatchBrowser) { 'Use special functions receive/fallback - receive and fallback are declared, sending data and wei #group4': function (browser: NightwatchBrowser) {
browser.waitForElementVisible('#icon-panel', 10000) browser.waitForElementVisible('#icon-panel', 10000)
.testContracts('receiveAndFallbackBothPayable.sol', sources[4]['receiveAndFallbackBothPayable.sol'], ['CheckSpecials']) .testContracts('receiveAndFallbackBothPayable.sol', sources[4]['receiveAndFallbackBothPayable.sol'], ['CheckSpecials'])
.clickLaunchIcon('udapp') .clickLaunchIcon('udapp')
@ -173,10 +174,10 @@ module.exports = {
.clearValue('#value') .clearValue('#value')
.setValue('#value', '0') .setValue('#value', '0')
.createContract('') .createContract('')
.clickInstance(4) .clickInstance(1)
.pause(1000) .pause(1000)
.perform((done) => { .perform((done) => {
browser.getAddressAtPosition(4, (address) => { browser.getAddressAtPosition(1, (address) => {
browser.sendLowLevelTx(address, '999999998765257135', '0xaa') browser.sendLowLevelTx(address, '999999998765257135', '0xaa')
.pause(1000) .pause(1000)
.journalLastChildIncludes('to: CheckSpecials.(fallback)') .journalLastChildIncludes('to: CheckSpecials.(fallback)')
@ -186,9 +187,9 @@ module.exports = {
}) })
}) })
}, },
'Use special functions receive/fallback - receive and fallback are declared and payable, sending wei': function (browser: NightwatchBrowser) { 'Use special functions receive/fallback - receive and fallback are declared and payable, sending wei #group4': function (browser: NightwatchBrowser) {
browser.perform((done) => { browser.perform((done) => {
browser.getAddressAtPosition(4, (address) => { browser.getAddressAtPosition(1, (address) => {
browser.sendLowLevelTx(address, '1', '') browser.sendLowLevelTx(address, '1', '')
.pause(1000) .pause(1000)
.journalLastChildIncludes('to: CheckSpecials.(receive)') .journalLastChildIncludes('to: CheckSpecials.(receive)')
@ -198,7 +199,7 @@ module.exports = {
}) })
}) })
}, },
'Use special functions receive/fallback - receive and fallback are not declared, sending nothing': function (browser: NightwatchBrowser) { 'Use special functions receive/fallback - receive and fallback are not declared, sending nothing #group5': function (browser: NightwatchBrowser) {
browser.waitForElementVisible('#icon-panel', 10000) browser.waitForElementVisible('#icon-panel', 10000)
.testContracts('notSpecial.sol', sources[5]['notSpecial.sol'], ['CheckSpecials']) .testContracts('notSpecial.sol', sources[5]['notSpecial.sol'], ['CheckSpecials'])
.clickLaunchIcon('udapp') .clickLaunchIcon('udapp')
@ -207,10 +208,10 @@ module.exports = {
.clearValue('#value') .clearValue('#value')
.setValue('#value', '0') .setValue('#value', '0')
.createContract('') .createContract('')
.clickInstance(5) .clickInstance(0)
.pause(1000) .pause(1000)
.perform((done) => { .perform((done) => {
browser.getAddressAtPosition(5, (address) => { browser.getAddressAtPosition(0, (address) => {
browser.sendLowLevelTx(address, '0', '') browser.sendLowLevelTx(address, '0', '')
.pause(1000) .pause(1000)
.waitForElementVisible(`#instance${address} label[id="deployAndRunLLTxError"]`) .waitForElementVisible(`#instance${address} label[id="deployAndRunLLTxError"]`)

@ -3,11 +3,12 @@ import { NightwatchBrowser } from 'nightwatch'
import init from '../helpers/init' import init from '../helpers/init'
module.exports = { module.exports = {
'@disabled': true,
before: function (browser: NightwatchBrowser, done: VoidFunction) { before: function (browser: NightwatchBrowser, done: VoidFunction) {
init(browser, done, 'http://127.0.0.1:8080?plugins=solidity,udapp', false) init(browser, done, 'http://127.0.0.1:8080?plugins=solidity,udapp', false)
}, },
'Should execution a simple console command': function (browser: NightwatchBrowser) { 'Should execution a simple console command #group1 #group999': function (browser: NightwatchBrowser) {
browser browser
.waitForElementVisible('*[data-id="terminalCli"]', 10000) .waitForElementVisible('*[data-id="terminalCli"]', 10000)
.executeScript('console.log(1 + 1)') .executeScript('console.log(1 + 1)')
@ -15,7 +16,7 @@ module.exports = {
.waitForElementContainsText('*[data-id="terminalJournal"]', '2', 60000) .waitForElementContainsText('*[data-id="terminalJournal"]', '2', 60000)
}, },
'Should clear console': function (browser: NightwatchBrowser) { 'Should clear console #group1': function (browser: NightwatchBrowser) {
browser browser
.waitForElementVisible('*[data-id="terminalCli"]') .waitForElementVisible('*[data-id="terminalCli"]')
.journalChildIncludes('Welcome to Remix') .journalChildIncludes('Welcome to Remix')
@ -23,40 +24,29 @@ module.exports = {
.waitForElementContainsText('*[data-id="terminalJournal"]', '', 60000) .waitForElementContainsText('*[data-id="terminalJournal"]', '', 60000)
}, },
'Should display auto-complete menu': function (browser: NightwatchBrowser) { 'Async/Await Script #group1': function (browser: NightwatchBrowser) {
browser
.waitForElementVisible('*[data-id="terminalCli"]')
.click('*[data-id="terminalCli"]')
.sendKeys('*[data-id="terminalCliInput"]', 'remix.')
.assert.visible('*[data-id="autoCompletePopUpAutoCompleteItem"]')
},
'Async/Await Script': function (browser: NightwatchBrowser) {
browser browser
.addFile('asyncAwait.js', { content: asyncAwait }) .addFile('asyncAwait.js', { content: asyncAwait })
.openFile('asyncAwait.js')
.executeScript('remix.execute("asyncAwait.js")') .executeScript('remix.execute("asyncAwait.js")')
.waitForElementContainsText('*[data-id="terminalJournal"]', 'Waiting Promise', 60000) .waitForElementContainsText('*[data-id="terminalJournal"]', 'Waiting Promise', 60000)
.waitForElementContainsText('*[data-id="terminalJournal"]', 'result - ', 60000) .waitForElementContainsText('*[data-id="terminalJournal"]', 'result - ', 60000)
.waitForElementContainsText('*[data-id="terminalJournal"]', 'Promise Resolved', 60000) .waitForElementContainsText('*[data-id="terminalJournal"]', 'Promise Resolved', 60000)
}, },
'Call Remix File Manager from a script': function (browser: NightwatchBrowser) { 'Call Remix File Manager from a script #group2': function (browser: NightwatchBrowser) {
browser browser
.addFile('asyncAwaitWithFileManagerAccess.js', { content: asyncAwaitWithFileManagerAccess }) .addFile('asyncAwaitWithFileManagerAccess.js', { content: asyncAwaitWithFileManagerAccess })
.openFile('asyncAwaitWithFileManagerAccess.js')
.pause(5000)
.executeScript('remix.execute(\'asyncAwaitWithFileManagerAccess.js\')') .executeScript('remix.execute(\'asyncAwaitWithFileManagerAccess.js\')')
.waitForElementContainsText('*[data-id="terminalJournal"]', 'contract Ballot {', 60000) .waitForElementContainsText('*[data-id="terminalJournal"]', 'contract Ballot {', 60000)
}, },
'Call web3.eth.getAccounts() using JavaScript VM': function (browser: NightwatchBrowser) { 'Call web3.eth.getAccounts() using JavaScript VM #group2': function (browser: NightwatchBrowser) {
browser browser
.executeScript('web3.eth.getAccounts()') .executeScript('web3.eth.getAccounts()')
.waitForElementContainsText('*[data-id="terminalJournal"]', '["0x5B38Da6a701c568545dCfcB03FcB875f56beddC4","0xAb8483F64d9C6d1EcF9b849Ae677dD3315835cb2","0x4B20993Bc481177ec7E8f571ceCaE8A9e22C02db","0x78731D3Ca6b7E34aC0F824c42a7cC18A495cabaB","0x617F2E2fD72FD9D5503197092aC168c91465E7f2","0x17F6AD8Ef982297579C203069C1DbfFE4348c372","0x5c6B0f7Bf3E7ce046039Bd8FABdfD3f9F5021678","0x03C6FcED478cBbC9a4FAB34eF9f40767739D1Ff7","0x1aE0EA34a72D944a8C7603FfB3eC30a6669E454C","0x0A098Eda01Ce92ff4A4CCb7A4fFFb5A43EBC70DC","0xCA35b7d915458EF540aDe6068dFe2F44E8fa733c","0x14723A09ACff6D2A60DcdF7aA4AFf308FDDC160C","0x4B0897b0513fdC7C541B6d9D7E929C4e5364D2dB","0x583031D1113aD414F02576BD6afaBfb302140225","0xdD870fA1b7C4700F2BD7f44238821C26f7392148"]') .waitForElementContainsText('*[data-id="terminalJournal"]', '["0x5B38Da6a701c568545dCfcB03FcB875f56beddC4","0xAb8483F64d9C6d1EcF9b849Ae677dD3315835cb2","0x4B20993Bc481177ec7E8f571ceCaE8A9e22C02db","0x78731D3Ca6b7E34aC0F824c42a7cC18A495cabaB","0x617F2E2fD72FD9D5503197092aC168c91465E7f2","0x17F6AD8Ef982297579C203069C1DbfFE4348c372","0x5c6B0f7Bf3E7ce046039Bd8FABdfD3f9F5021678","0x03C6FcED478cBbC9a4FAB34eF9f40767739D1Ff7","0x1aE0EA34a72D944a8C7603FfB3eC30a6669E454C","0x0A098Eda01Ce92ff4A4CCb7A4fFFb5A43EBC70DC","0xCA35b7d915458EF540aDe6068dFe2F44E8fa733c","0x14723A09ACff6D2A60DcdF7aA4AFf308FDDC160C","0x4B0897b0513fdC7C541B6d9D7E929C4e5364D2dB","0x583031D1113aD414F02576BD6afaBfb302140225","0xdD870fA1b7C4700F2BD7f44238821C26f7392148"]')
}, },
'Call web3.eth.getAccounts() using Web3 Provider': function (browser: NightwatchBrowser) { 'Call web3.eth.getAccounts() using Web3 Provider #group5': function (browser: NightwatchBrowser) {
browser browser
.click('*[data-id="terminalClearConsole"]') // clear the terminal .click('*[data-id="terminalClearConsole"]') // clear the terminal
.clickLaunchIcon('udapp') .clickLaunchIcon('udapp')
@ -68,7 +58,7 @@ module.exports = {
.waitForElementContainsText('*[data-id="terminalJournal"]', '","', 60000) .waitForElementContainsText('*[data-id="terminalJournal"]', '","', 60000)
}, },
'Call Remix File Resolver (external URL) from a script': function (browser: NightwatchBrowser) { 'Call Remix File Resolver (external URL) from a script #group3': function (browser: NightwatchBrowser) {
browser browser
.click('*[data-id="terminalClearConsole"]') // clear the terminal .click('*[data-id="terminalClearConsole"]') // clear the terminal
.addFile('resolveExternalUrlAndSave.js', { content: resolveExternalUrlAndSave }) .addFile('resolveExternalUrlAndSave.js', { content: resolveExternalUrlAndSave })
@ -79,7 +69,7 @@ module.exports = {
.openFile('.deps/github/OpenZeppelin/openzeppelin-contracts/contracts/token/ERC20/ERC20.sol') .openFile('.deps/github/OpenZeppelin/openzeppelin-contracts/contracts/token/ERC20/ERC20.sol')
}, },
'Call Remix File Resolver (internal URL) from a script': function (browser: NightwatchBrowser) { 'Call Remix File Resolver (internal URL) from a script #group3': function (browser: NightwatchBrowser) {
browser browser
.click('*[data-id="terminalClearConsole"]') // clear the terminal .click('*[data-id="terminalClearConsole"]') // clear the terminal
.addFile('resolveUrl.js', { content: resolveUrl }) .addFile('resolveUrl.js', { content: resolveUrl })
@ -89,7 +79,7 @@ module.exports = {
.waitForElementContainsText('*[data-id="terminalJournal"]', 'contract Ballot {', 60000) .waitForElementContainsText('*[data-id="terminalJournal"]', 'contract Ballot {', 60000)
}, },
'Call Remix File Resolver (internal URL) from a script and specify a path': function (browser: NightwatchBrowser) { 'Call Remix File Resolver (internal URL) from a script and specify a path #group3': function (browser: NightwatchBrowser) {
browser browser
.click('*[data-id="terminalClearConsole"]') // clear the terminal .click('*[data-id="terminalClearConsole"]') // clear the terminal
.addFile('resolveExternalUrlAndSaveToaPath.js', { content: resolveExternalUrlAndSaveToaPath }) .addFile('resolveExternalUrlAndSaveToaPath.js', { content: resolveExternalUrlAndSaveToaPath })
@ -100,7 +90,7 @@ module.exports = {
.openFile('.deps/github/newFile.sol') .openFile('.deps/github/newFile.sol')
}, },
'Deploy "Owner" using an ether.js script, listen to event and check event are logged in the terminal': function (browser: NightwatchBrowser) { 'Deploy "Owner" using an ether.js script, listen to event and check event are logged in the terminal #group4': function (browser: NightwatchBrowser) {
browser browser
.clickLaunchIcon('settings') .clickLaunchIcon('settings')
.clickLaunchIcon('udapp') .clickLaunchIcon('udapp')
@ -109,12 +99,12 @@ module.exports = {
.clickLaunchIcon('filePanel') .clickLaunchIcon('filePanel')
.click('*[data-id="treeViewDivtreeViewItem"]') // make sure we create the file at the root folder .click('*[data-id="treeViewDivtreeViewItem"]') // make sure we create the file at the root folder
.addFile('deployWithEthersJs.js', { content: deployWithEthersJs }) .addFile('deployWithEthersJs.js', { content: deployWithEthersJs })
.openFile('deployWithEthersJs.js') // .openFile('deployWithEthersJs.js')
.pause(1000) .pause(1000)
.click('[data-id="treeViewDivtreeViewItemcontracts"]') .click('[data-id="treeViewDivtreeViewItemcontracts"]')
.openFile('contracts/2_Owner.sol') .openFile('contracts/2_Owner.sol')
.clickLaunchIcon('solidity') .clickLaunchIcon('solidity')
.click('*[data-id="compilerContainerCompileBtn"]') // compile Owner .click('*[data-id="compilerContainerCompileBtn"]').pause(5000) // compile Owner
.executeScript('remix.execute(\'deployWithEthersJs.js\')') .executeScript('remix.execute(\'deployWithEthersJs.js\')')
.waitForElementContainsText('*[data-id="terminalJournal"]', 'Contract Address:', 60000) .waitForElementContainsText('*[data-id="terminalJournal"]', 'Contract Address:', 60000)
.waitForElementContainsText('*[data-id="terminalJournal"]', '0xd9145CCE52D386f254917e481eB44e9943F39138', 60000) .waitForElementContainsText('*[data-id="terminalJournal"]', '0xd9145CCE52D386f254917e481eB44e9943F39138', 60000)
@ -130,7 +120,7 @@ module.exports = {
.waitForElementContainsText('*[data-id="terminalJournal"]', '0xd9145CCE52D386f254917e481eB44e9943F39138', 60000) .waitForElementContainsText('*[data-id="terminalJournal"]', '0xd9145CCE52D386f254917e481eB44e9943F39138', 60000)
}, },
'Should print hardhat logs': function (browser: NightwatchBrowser) { 'Should print hardhat logs #group4': function (browser: NightwatchBrowser) {
browser browser
.click('*[data-id="terminalClearConsole"]') // clear the terminal .click('*[data-id="terminalClearConsole"]') // clear the terminal
.addFile('printHardhatlog.sol', { content: hardhatLog }) .addFile('printHardhatlog.sol', { content: hardhatLog })
@ -153,7 +143,14 @@ module.exports = {
.clickFunction('getOwner - call') .clickFunction('getOwner - call')
.pause(1000) .pause(1000)
.journalChildIncludes('inside getOwner', { shouldHaveOnlyOneOccurence: true }) .journalChildIncludes('inside getOwner', { shouldHaveOnlyOneOccurence: true })
.end() },
'Should display auto-complete menu #group4': function (browser: NightwatchBrowser) {
browser
.waitForElementVisible('*[data-id="terminalCli"]')
.click('*[data-id="terminalCli"]')
.sendKeys('*[data-id="terminalCliInput"]', 'remix.')
.assert.visible('*[data-id="autoCompletePopUpAutoCompleteItem"]').end()
} }
} }

@ -3,6 +3,7 @@ import { NightwatchBrowser } from 'nightwatch'
import init from '../helpers/init' import init from '../helpers/init'
module.exports = { module.exports = {
'@disabled': true,
before: function (browser: NightwatchBrowser, done: VoidFunction) { before: function (browser: NightwatchBrowser, done: VoidFunction) {
init(browser, done) init(browser, done)
}, },
@ -10,7 +11,7 @@ module.exports = {
return sources return sources
}, },
'Execute Simple Contract and Test Terminal': function (browser: NightwatchBrowser) { 'Execute Simple Contract and Test Terminal #group1': function (browser: NightwatchBrowser) {
browser.testContracts('Untitled.sol', sources[0]['Untitled.sol'], ['TestContract']) browser.testContracts('Untitled.sol', sources[0]['Untitled.sol'], ['TestContract'])
.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
@ -41,7 +42,7 @@ module.exports = {
.click('*[data-id="deployAndRunClearInstances"]') .click('*[data-id="deployAndRunClearInstances"]')
}, },
'Test Complex Return Values': function (browser: NightwatchBrowser) { 'Test Complex Return Values #group1': function (browser: NightwatchBrowser) {
browser.testContracts('returnValues.sol', sources[1]['returnValues.sol'], ['testReturnValues']) browser.testContracts('returnValues.sol', sources[1]['returnValues.sol'], ['testReturnValues'])
.clickLaunchIcon('udapp') .clickLaunchIcon('udapp')
.click('#runTabView button[class^="instanceButton"]') .click('#runTabView button[class^="instanceButton"]')
@ -86,7 +87,7 @@ module.exports = {
}).click('*[data-id="deployAndRunClearInstances"]') }).click('*[data-id="deployAndRunClearInstances"]')
}, },
'Test Complex Input Values': function (browser: NightwatchBrowser) { 'Test Complex Input Values #group2': function (browser: NightwatchBrowser) {
browser.testContracts('inputValues.sol', sources[2]['inputValues.sol'], ['test']) browser.testContracts('inputValues.sol', sources[2]['inputValues.sol'], ['test'])
.clickLaunchIcon('udapp') .clickLaunchIcon('udapp')
.click('#runTabView button[class^="instanceButton"]') .click('#runTabView button[class^="instanceButton"]')
@ -112,7 +113,7 @@ module.exports = {
}, },
logs: [ logs: [
{ {
from: '0x8c1eD7e19abAa9f23c476dA86Dc1577F1Ef401f5', from: '0xd9145CCE52D386f254917e481eB44e9943F39138',
topic: '0xd30981760edbf605bda8689e945f622877f230c9a77cbfbd448aa4b7d8ac6e7f', topic: '0xd30981760edbf605bda8689e945f622877f230c9a77cbfbd448aa4b7d8ac6e7f',
event: 'event1', event: 'event1',
args: { args: {
@ -131,7 +132,7 @@ module.exports = {
.click('*[data-id="deployAndRunClearInstances"]') .click('*[data-id="deployAndRunClearInstances"]')
}, },
'Should Compile and Deploy a contract which has an event declaring a function as parameter': function (browser: NightwatchBrowser) { 'Should Compile and Deploy a contract which has an event declaring a function as parameter #group2': function (browser: NightwatchBrowser) {
browser.testContracts('eventFunctionInput.sol', sources[3]['eventFunctionInput.sol'], ['C']) browser.testContracts('eventFunctionInput.sol', sources[3]['eventFunctionInput.sol'], ['C'])
.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
@ -140,7 +141,7 @@ module.exports = {
.click('*[data-id="deployAndRunClearInstances"]') .click('*[data-id="deployAndRunClearInstances"]')
}, },
'Should Compile and Deploy a contract which define a custom error, the error should be logged in the terminal': function (browser: NightwatchBrowser) { 'Should Compile and Deploy a contract which define a custom error, the error should be logged in the terminal #group3': function (browser: NightwatchBrowser) {
browser.testContracts('customError.sol', sources[4]['customError.sol'], ['C']) browser.testContracts('customError.sol', sources[4]['customError.sol'], ['C'])
.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
@ -161,8 +162,10 @@ module.exports = {
.click('*[data-id="deployAndRunClearInstances"]') .click('*[data-id="deployAndRunClearInstances"]')
}, },
'Should Compile and Deploy a contract which define a custom error, the error should be logged in the terminal , using London VM Fork': function (browser: NightwatchBrowser) { 'Should Compile and Deploy a contract which define a custom error, the error should be logged in the terminal , using London VM Fork #group3': function (browser: NightwatchBrowser) {
browser browser
.clickLaunchIcon('udapp')
.clearTransactions()
.click('*[data-id="settingsVMLondonMode"]') // switch to London fork .click('*[data-id="settingsVMLondonMode"]') // switch to London fork
.selectAccount('0xCA35b7d915458EF540aDe6068dFe2F44E8fa733c') // this account will be used for this test suite .selectAccount('0xCA35b7d915458EF540aDe6068dFe2F44E8fa733c') // this account will be used for this test suite
.click('#runTabView button[class^="instanceButton"]') .click('#runTabView button[class^="instanceButton"]')
@ -180,7 +183,7 @@ module.exports = {
.journalLastChildIncludes('Debug the transaction to get more information.') .journalLastChildIncludes('Debug the transaction to get more information.')
}, },
'Should Compile and Deploy a contract which define a custom error in a library, the error should be logged in the terminal': function (browser: NightwatchBrowser) { 'Should Compile and Deploy a contract which define a custom error in a library, the error should be logged in the terminal #group3': function (browser: NightwatchBrowser) {
browser.testContracts('customErrorLib.sol', sources[5]['customErrorLib.sol'], ['D']) browser.testContracts('customErrorLib.sol', sources[5]['customErrorLib.sol'], ['D'])
.clickLaunchIcon('udapp') .clickLaunchIcon('udapp')
.click('#runTabView button[class^="instanceButton"]') .click('#runTabView button[class^="instanceButton"]')

@ -59,6 +59,8 @@ declare module 'nightwatch' {
currentWorkspaceIs(name: string): NightwatchBrowser currentWorkspaceIs(name: string): NightwatchBrowser
addLocalPlugin(this: NightwatchBrowser, profile: Profile & LocationProfile & ExternalProfile): NightwatchBrowser addLocalPlugin(this: NightwatchBrowser, profile: Profile & LocationProfile & ExternalProfile): NightwatchBrowser
acceptAndRemember (this: NightwatchBrowser, remember: boolean, accept: boolean): NightwatchBrowser acceptAndRemember (this: NightwatchBrowser, remember: boolean, accept: boolean): NightwatchBrowser
clearConsole (this: NightwatchBrowser): NightwatchBrowser
clearTransactions (this: NightwatchBrowser): NightwatchBrowser
} }
export interface NightwatchBrowser { export interface NightwatchBrowser {

@ -7,7 +7,7 @@ echo "$BUILD_ID"
TEST_EXITCODE=0 TEST_EXITCODE=0
npm run ganache-cli & npm run ganache-cli &
npm run serve & npm run serve:production &
echo 'sharing folder: ' $PWD '/apps/remix-ide/contracts' & echo 'sharing folder: ' $PWD '/apps/remix-ide/contracts' &
npm run remixd & npm run remixd &
@ -15,9 +15,9 @@ sleep 5
npm run build:e2e npm run build:e2e
TESTFILES=$(circleci tests glob "dist/apps/remix-ide-e2e/src/tests/**/*.test.js" | circleci tests split --split-by=timings) TESTFILES=$(grep -IRiL "disabled" "dist/apps/remix-ide-e2e/src/tests" | grep "\.spec\|\.test" | sort | circleci tests split )
for TESTFILE in $TESTFILES; do for TESTFILE in $TESTFILES; do
npx nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js $TESTFILE --env=chrome || TEST_EXITCODE=1 npx nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js $TESTFILE --env=$1 || TEST_EXITCODE=1
done done
echo "$TEST_EXITCODE" echo "$TEST_EXITCODE"

@ -22,7 +22,7 @@ setupRemixd
sleep 5 sleep 5
npm run nightwatch_parallel || TEST_EXITCODE=1 npm run nightwatch_parallel || TEST_EXITCODE=1
TESTFILES=$(circleci tests glob "./apps/remix-ide/test-browser/tests/**/*.test.js" | circleci tests split --split-by=timings) TESTFILES=$(circleci tests glob "./apps/remix-ide/test-browser/tests/**/*.test.js" | circleci tests split )
for TESTFILE in $TESTFILES; do for TESTFILE in $TESTFILES; do
./node_modules/.bin/nightwatch --config ./apps/remix-ide/nightwatch.js --env chrome $TESTFILE || TEST_EXITCODE=1 ./node_modules/.bin/nightwatch --config ./apps/remix-ide/nightwatch.js --env chrome $TESTFILE || TEST_EXITCODE=1
done done

@ -1,27 +0,0 @@
#!/usr/bin/env bash
set -e
BUILD_ID=${CIRCLE_BUILD_NUM:-${TRAVIS_JOB_NUMBER}}
echo "$BUILD_ID"
TEST_EXITCODE=0
npm run ganache-cli &
npm run serve &
echo 'sharing folder: ' $PWD '/apps/remix-ide/contracts' &
npm run remixd &
sleep 5
npm run build:e2e
TESTFILES=$(circleci tests glob "dist/apps/remix-ide-e2e/src/tests/**/*.spec.js" | circleci tests split --split-by=timings)
for TESTFILE in $TESTFILES; do
npx nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js $TESTFILE --env=chrome || TEST_EXITCODE=1
done
echo "$TEST_EXITCODE"
if [ "$TEST_EXITCODE" -eq 1 ]
then
exit 1
fi

@ -1,27 +0,0 @@
#!/usr/bin/env bash
set -e
BUILD_ID=${CIRCLE_BUILD_NUM:-${TRAVIS_JOB_NUMBER}}
echo "$BUILD_ID"
TEST_EXITCODE=0
npm run ganache-cli &
npm run serve &
echo 'sharing folder: ' $PWD '/apps/remix-ide/contracts' &
npm run remixd &
sleep 5
npm run build:e2e
TESTFILES=$(circleci tests glob "dist/apps/remix-ide-e2e/src/tests/**/*.test.js" | circleci tests split --split-by=timings)
for TESTFILE in $TESTFILES; do
npx nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js $TESTFILE --env=firefox || TEST_EXITCODE=1
done
echo "$TEST_EXITCODE"
if [ "$TEST_EXITCODE" -eq 1 ]
then
exit 1
fi

@ -1,27 +0,0 @@
#!/usr/bin/env bash
set -e
BUILD_ID=${CIRCLE_BUILD_NUM:-${TRAVIS_JOB_NUMBER}}
echo "$BUILD_ID"
TEST_EXITCODE=0
npm run ganache-cli &
npm run serve &
echo 'sharing folder: ' $PWD '/apps/remix-ide/contracts' &
npm run remixd &
sleep 5
npm run build:e2e
TESTFILES=$(circleci tests glob "dist/apps/remix-ide-e2e/src/tests/**/*.spec.js" | circleci tests split --split-by=timings)
for TESTFILE in $TESTFILES; do
npx nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js $TESTFILE --env=firefox || TEST_EXITCODE=1
done
echo "$TEST_EXITCODE"
if [ "$TEST_EXITCODE" -eq 1 ]
then
exit 1
fi

@ -6,13 +6,17 @@ BUILD_ID=${CIRCLE_BUILD_NUM:-${TRAVIS_JOB_NUMBER}}
echo "$BUILD_ID" echo "$BUILD_ID"
TEST_EXITCODE=0 TEST_EXITCODE=0
npm run serve & npm run serve:production &
npx nx serve remix-ide-e2e-src-local-plugin & npx nx serve remix-ide-e2e-src-local-plugin &
sleep 5 sleep 5
npm run build:e2e npm run build:e2e
npm run nightwatch_local_pluginApi || TEST_EXITCODE=1
TESTFILES=$(grep -IRiL "disabled" "dist/apps/remix-ide-e2e/src/tests" | grep "plugin_api" | sort | circleci tests split )
for TESTFILE in $TESTFILES; do
npx nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js $TESTFILE --env=chrome || TEST_EXITCODE=1
done
echo "$TEST_EXITCODE" echo "$TEST_EXITCODE"
if [ "$TEST_EXITCODE" -eq 1 ] if [ "$TEST_EXITCODE" -eq 1 ]

@ -1,21 +0,0 @@
#!/usr/bin/env bash
set -e
BUILD_ID=${CIRCLE_BUILD_NUM:-${TRAVIS_JOB_NUMBER}}
echo "$BUILD_ID"
TEST_EXITCODE=0
npm run ganache-cli &
npm run serve &
sleep 5
npm run build:e2e
npm run nightwatch_local_runAndDeploy || TEST_EXITCODE=1
echo "$TEST_EXITCODE"
if [ "$TEST_EXITCODE" -eq 1 ]
then
exit 1
fi

@ -0,0 +1,22 @@
#!/usr/bin/env bash
set -e
BUILD_ID=${CIRCLE_BUILD_NUM:-${TRAVIS_JOB_NUMBER}}
echo "$BUILD_ID"
TEST_EXITCODE=0
KEYS=$(jq -r '.projects | keys' workspace.json | tr -d '[],"')
(for row in $KEYS; do
if [ "$row" != "debugger" ]
then
echo ${row}
fi
done) | circleci tests split | { while read i;do npm run lint $i; done }
echo "$TEST_EXITCODE"
if [ "$TEST_EXITCODE" -eq 1 ]
then
exit 1
fi

@ -1,4 +1,5 @@
import React, { useState, useEffect } from 'react'; /* eslint-disable no-use-before-define */
import React from 'react'
import { SolidityCompiler } from '@remix-ui/solidity-compiler' // eslint-disable-line import { SolidityCompiler } from '@remix-ui/solidity-compiler' // eslint-disable-line
@ -11,7 +12,7 @@ export const App = () => {
<div> <div>
<SolidityCompiler api={remix} /> <SolidityCompiler api={remix} />
</div> </div>
); )
}; }
export default App; export default App

@ -7,6 +7,7 @@ export const CompilerApiMixin = (Base) => class extends Base {
contractMap: { contractMap: {
file: string file: string
} | Record<string, any> } | Record<string, any>
compileErrors: any compileErrors: any
compileTabLogic: CompileTabLogic compileTabLogic: CompileTabLogic
contractsDetails: Record<string, any> contractsDetails: Record<string, any>
@ -143,7 +144,7 @@ export const CompilerApiMixin = (Base) => class extends Base {
// This function is used for passing the compiler configuration to 'remix-tests' // This function is used for passing the compiler configuration to 'remix-tests'
getCurrentCompilerConfig () { getCurrentCompilerConfig () {
const compilerState = this.getCompilerState() const compilerState = this.getCompilerState()
let compilerDetails: any = { const compilerDetails: any = {
currentVersion: compilerState.currentVersion, currentVersion: compilerState.currentVersion,
evmVersion: compilerState.evmVersion, evmVersion: compilerState.evmVersion,
optimize: compilerState.optimize, optimize: compilerState.optimize,

@ -1,5 +1,7 @@
import { PluginClient } from "@remixproject/plugin"; /* eslint-disable no-undef */
import { createClient } from "@remixproject/plugin-webview"; /* eslint-disable no-unused-vars */
import { PluginClient } from '@remixproject/plugin'
import { createClient } from '@remixproject/plugin-webview'
import { CompilerApiMixin } from './compiler-api' import { CompilerApiMixin } from './compiler-api'
import { ICompilerApi } from '@remix-project/remix-lib-ts' import { ICompilerApi } from '@remix-project/remix-lib-ts'
import { CompileTabLogic } from '@remix-ui/solidity-compiler' import { CompileTabLogic } from '@remix-ui/solidity-compiler'
@ -42,11 +44,11 @@ export class CompilerClientApi extends CompilerApiMixin(PluginClient) implements
getCompilerParameters () { getCompilerParameters () {
const params = { const params = {
runs: localStorage.getItem('runs') || defaultCompilerParameters['runs'], runs: localStorage.getItem('runs') || defaultCompilerParameters.runs,
optimize: localStorage.getItem('optimize') === 'true' ? true : false, optimize: localStorage.getItem('optimize') === 'true',
version: localStorage.getItem('version') || defaultCompilerParameters['version'], version: localStorage.getItem('version') || defaultCompilerParameters.version,
evmVersion: localStorage.getItem('evmVersion') || defaultCompilerParameters['evmVersion'], // default evmVersion: localStorage.getItem('evmVersion') || defaultCompilerParameters.evmVersion, // default
language: localStorage.getItem('language') || defaultCompilerParameters['language'] language: localStorage.getItem('language') || defaultCompilerParameters.language
} }
return params return params
} }

@ -1,3 +1,3 @@
export const environment = { export const environment = {
production: true production: true
}; }

@ -3,4 +3,4 @@
export const environment = { export const environment = {
production: false production: false
}; }

@ -1 +1 @@
export * from './app/compiler-api'; export * from './app/compiler-api'

@ -1,11 +1,12 @@
import React from 'react'; // eslint-disable-next-line no-use-before-define
import ReactDOM from 'react-dom'; import React from 'react'
import ReactDOM from 'react-dom'
import App from './app/app'; import App from './app/app'
ReactDOM.render( ReactDOM.render(
<React.StrictMode> <React.StrictMode>
<App /> <App />
</React.StrictMode>, </React.StrictMode>,
document.getElementById('root') document.getElementById('root')
); )

@ -3,5 +3,5 @@
* *
* See: https://github.com/zloirock/core-js#babel * See: https://github.com/zloirock/core-js#babel
*/ */
import 'core-js/stable'; import 'core-js/stable'
import 'regenerator-runtime/runtime'; import 'regenerator-runtime/runtime'

@ -9,4 +9,4 @@ module.exports = {
}, },
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'html'], moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'html'],
coverageDirectory: '../../../coverage/libs/remix-ui/clipboard' coverageDirectory: '../../../coverage/libs/remix-ui/clipboard'
}; }

@ -1 +1 @@
export * from './lib/copy-to-clipboard/copy-to-clipboard'; export * from './lib/copy-to-clipboard/copy-to-clipboard'

@ -9,4 +9,4 @@ module.exports = {
}, },
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'html'], moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'html'],
coverageDirectory: '../../../coverage/libs/remix-ui/utils' coverageDirectory: '../../../coverage/libs/remix-ui/utils'
}; }

885
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -49,48 +49,51 @@
"build:libs": "nx run-many --target=build --parallel=false --with-deps=true --projects=remix-analyzer,remix-astwalker,remix-debug,remix-lib,remix-simulator,remix-solidity,remix-tests,remix-url-resolver,remixd", "build:libs": "nx run-many --target=build --parallel=false --with-deps=true --projects=remix-analyzer,remix-astwalker,remix-debug,remix-lib,remix-simulator,remix-solidity,remix-tests,remix-url-resolver,remixd",
"test:libs": "nx run-many --target=test --projects=remix-analyzer,remix-astwalker,remix-debug,remix-lib,remix-simulator,remix-solidity,remix-tests,remix-url-resolver,remixd", "test:libs": "nx run-many --target=test --projects=remix-analyzer,remix-astwalker,remix-debug,remix-lib,remix-simulator,remix-solidity,remix-tests,remix-url-resolver,remixd",
"publish:libs": "npm run build:libs && lerna publish --skip-git && npm run bumpVersion:libs", "publish:libs": "npm run build:libs && lerna publish --skip-git && npm run bumpVersion:libs",
"build:e2e": "tsc -p apps/remix-ide-e2e/tsconfig.e2e.json", "build:e2e": "node apps/remix-ide-e2e/src/buildGroupTests.js && tsc -p apps/remix-ide-e2e/tsconfig.e2e.json",
"watch:e2e": "nodemon", "watch:e2e": "nodemon",
"bumpVersion:libs": "gulp & gulp syncLibVersions;", "bumpVersion:libs": "gulp & gulp syncLibVersions;",
"browsertest": "sleep 5 && npm run nightwatch_local", "browsertest": "sleep 5 && npm run nightwatch_local",
"csslint": "csslint --ignore=order-alphabetical --errors='errors,duplicate-properties,empty-rules' --exclude-list='apps/remix-ide/src/assets/css/font-awesome.min.css' apps/remix-ide/src/assets/css/", "csslint": "csslint --ignore=order-alphabetical --errors='errors,duplicate-properties,empty-rules' --exclude-list='apps/remix-ide/src/assets/css/font-awesome.min.css' apps/remix-ide/src/assets/css/",
"downloadsolc_assets": "wget --no-check-certificate https://binaries.soliditylang.org/wasm/soljson-v0.8.7+commit.e28d00a7.js -O ./apps/remix-ide/src/assets/js/soljson.js && wget --no-check-certificate https://binaries.soliditylang.org/wasm/soljson-v0.8.7+commit.e28d00a7.js -O ./apps/solidity-compiler/src/assets/js/soljson.js", "downloadsolc_assets": "wget --no-check-certificate https://binaries.soliditylang.org/wasm/soljson-v0.8.7+commit.e28d00a7.js -O ./apps/remix-ide/src/assets/js/soljson.js && wget --no-check-certificate https://binaries.soliditylang.org/wasm/soljson-v0.8.7+commit.e28d00a7.js -O ./apps/solidity-compiler/src/assets/js/soljson.js",
"downloadsolc_assets_dist": "wget --no-check-certificate https://binaries.soliditylang.org/wasm/soljson-v0.8.7+commit.e28d00a7.js -O ./dist/apps/remix-ide/assets/js/soljson.js && wget --no-check-certificate https://binaries.soliditylang.org/wasm/soljson-v0.8.7+commit.e28d00a7.js -O ./dist/apps/solidity-compiler/assets/js/soljson.js",
"make-mock-compiler": "node apps/remix-ide/ci/makeMockCompiler.js", "make-mock-compiler": "node apps/remix-ide/ci/makeMockCompiler.js",
"minify": "uglifyjs --in-source-map inline --source-map-inline -c warnings=false", "minify": "uglifyjs --in-source-map inline --source-map-inline -c warnings=false",
"build:production": "NODE_ENV=production nx build remix-ide --skip-nx-cache", "build:production": "NODE_ENV=production nx build remix-ide --skip-nx-cache",
"serve:production": "npx http-server ./dist/apps/remix-ide", "serve:production": "npx http-server ./dist/apps/remix-ide",
"select_test": "sh apps/remix-ide-e2e/src/select_tests.sh",
"group_test": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/${npm_config_test}_group${npm_config_group}.test.js --env=${npm_config_env}",
"nightwatch_parallel": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js --env=chrome,firefox", "nightwatch_parallel": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js --env=chrome,firefox",
"nightwatch_local_firefox": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js --env=firefox", "nightwatch_local_firefox": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js --env=firefox",
"nightwatch_local_chrome": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js --env=chrome", "nightwatch_local_chrome": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js --env=chrome",
"nightwatch_local_ballot": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/ballot.test.js --env=chrome", "nightwatch_local_ballot": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/ballot.test.js --env=chrome",
"nightwatch_local_ballot_0_4_11": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/ballot_0_4_11.spec.js --env=chrome", "nightwatch_local_ballot_0_4_11": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/ballot_0_4_11.test.js --env=chrome",
"nightwatch_local_usingWorker": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/usingWebWorker.test.js --env=chrome", "nightwatch_local_usingWorker": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/usingWebWorker.test.js --env=chrome",
"nightwatch_local_libraryDeployment": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/libraryDeployment.test.js --env=chrome", "nightwatch_local_libraryDeployment": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/libraryDeployment.test.js --env=chrome",
"nightwatch_local_solidityImport": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/solidityImport.spec.js --env=chrome", "nightwatch_local_solidityImport": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/solidityImport_*.test.js --env=chrome",
"nightwatch_local_recorder": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/recorder.spec.js --env=chrome", "nightwatch_local_recorder": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/recorder.test.js --env=chrome",
"nightwatch_local_transactionExecution": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/transactionExecution.spec.js --env=chrome", "nightwatch_local_transactionExecution": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/transactionExecution_*.test.js --env=chrome",
"nightwatch_local_staticAnalysis": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/staticAnalysis.spec.js --env=chrome", "nightwatch_local_staticAnalysis": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/staticAnalysis.test.js --env=chrome",
"nightwatch_local_signingMessage": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/signingMessage.test.js --env=chrome", "nightwatch_local_signingMessage": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/signingMessage.test.js --env=chrome",
"nightwatch_local_specialFunctions": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/specialFunctions.test.js --env=chrome", "nightwatch_local_specialFunctions": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/specialFunctions_*.test.js --env=chrome",
"nightwatch_local_solidityUnitTests": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/solidityUnittests.spec.js --env=chrome", "nightwatch_local_solidityUnitTests": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/solidityUnittests_*.test.js --env=chrome",
"nightwatch_local_remixd": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/remixd.test.js --env=chrome", "nightwatch_local_remixd": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/remixd.test.js --env=chrome",
"nightwatch_local_terminal": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/terminal.test.js --env=chrome", "nightwatch_local_terminal": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/terminal_*.test.js --env=chrome",
"nightwatch_local_gist": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/gist.spec.js --env=chrome", "nightwatch_local_gist": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/gist.test.js --env=chrome",
"nightwatch_local_workspace": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/workspace.test.js --env=chrome", "nightwatch_local_workspace": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/workspace.test.js --env=chrome",
"nightwatch_local_defaultLayout": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/defaultLayout.test.js --env=chrome", "nightwatch_local_defaultLayout": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/defaultLayout.test.js --env=chrome",
"nightwatch_local_pluginManager": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/pluginManager.test.js --env=chrome", "nightwatch_local_pluginManager": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/pluginManager.test.js --env=chrome",
"nightwatch_local_publishContract": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/publishContract.test.js --env=chrome", "nightwatch_local_publishContract": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/publishContract.test.js --env=chrome",
"nightwatch_local_generalSettings": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/generalSettings.test.js --env=chrome", "nightwatch_local_generalSettings": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/generalSettings.test.js --env=chrome",
"nightwatch_local_fileExplorer": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/fileExplorer.test.js --env=chrome", "nightwatch_local_fileExplorer": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/fileExplorer.test.js --env=chrome",
"nightwatch_local_debugger": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/debugger.spec.js --env=chrome", "nightwatch_local_debugger": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/debugger_*.test.js --env=chrome",
"nightwatch_local_editor": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/editor.spec.js --env=chrome", "nightwatch_local_editor": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/editor.test.js --env=chrome",
"nightwatch_local_compiler": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/compiler_api.test.js --env=chrome", "nightwatch_local_compiler": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/compiler_api.test.js --env=chrome",
"nightwatch_local_txListener": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/txListener.test.js --env=chrome", "nightwatch_local_txListener": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/txListener.test.js --env=chrome",
"nightwatch_local_fileManager": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/fileManager_api.spec.js --env=chrome", "nightwatch_local_fileManager": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/fileManager_api.test.js --env=chrome",
"nightwatch_local_runAndDeploy": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/runAndDeploy.js --env=chrome-runAndDeploy", "nightwatch_local_runAndDeploy": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/runAndDeploy.js --env=chrome-runAndDeploy",
"nightwatch_local_url": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/url.spec.js --env=chrome", "nightwatch_local_url": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/url.test.js --env=chrome",
"nightwatch_local_verticalIconscontextmenu": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/verticalIconsPanel.spec.js --env=chrome", "nightwatch_local_verticalIconscontextmenu": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/verticalIconsPanel.test.js --env=chrome",
"nightwatch_local_pluginApi": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/plugin_api.js --env=chrome", "nightwatch_local_pluginApi": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/plugin_api_*.js --env=chrome",
"onchange": "onchange apps/remix-ide/build/app.js -- npm-run-all lint", "onchange": "onchange apps/remix-ide/build/app.js -- npm-run-all lint",
"remixd": "nx build remixd && nx serve remixd --folder=./apps/remix-ide/contracts --remixide=http://127.0.0.1:8080", "remixd": "nx build remixd && nx serve remixd --folder=./apps/remix-ide/contracts --remixide=http://127.0.0.1:8080",
"selenium": "selenium-standalone start", "selenium": "selenium-standalone start",
@ -252,7 +255,6 @@
"copy-to-clipboard": "^3.3.1", "copy-to-clipboard": "^3.3.1",
"csjs-inject": "^1.0.1", "csjs-inject": "^1.0.1",
"csslint": "^1.0.2", "csslint": "^1.0.2",
"cypress": "^4.1.0",
"dotenv": "^8.2.0", "dotenv": "^8.2.0",
"eslint": "6.8.0", "eslint": "6.8.0",
"eslint-config-prettier": "^6.11.0", "eslint-config-prettier": "^6.11.0",
@ -293,7 +295,7 @@
"prettier": "1.19.1", "prettier": "1.19.1",
"request": "^2.83.0", "request": "^2.83.0",
"rimraf": "^2.6.1", "rimraf": "^2.6.1",
"selenium-standalone": "^7.1.0", "selenium-standalone": "^8.0.4",
"semver": "^6.3.0", "semver": "^6.3.0",
"solc": "0.7.4", "solc": "0.7.4",
"swarmgw": "^0.3.1", "swarmgw": "^0.3.1",

Loading…
Cancel
Save