Merge branch 'master' into slrm

pull/1780/head
Liana Husikyan 3 years ago committed by GitHub
commit 666ebc6ed7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 272
      .circleci/config.yml
  2. 27
      .github/workflows/publish-action.yml
  3. 2
      .gitignore
  4. 35
      apps/remix-ide-e2e/nightwatch.ts
  5. 4
      apps/remix-ide-e2e/seleniumConfig.js
  6. 33
      apps/remix-ide-e2e/src/buildGroupTests.js
  7. 15
      apps/remix-ide-e2e/src/checkGroupTests.js
  8. 14
      apps/remix-ide-e2e/src/commands/clearConsole.ts
  9. 24
      apps/remix-ide-e2e/src/commands/clearTransactions.ts
  10. 12
      apps/remix-ide-e2e/src/helpers/buildgrouptest.ts
  11. 47
      apps/remix-ide-e2e/src/select_tests.sh
  12. 0
      apps/remix-ide-e2e/src/tests/ballot_0_4_11.test.ts
  13. 11
      apps/remix-ide-e2e/src/tests/compiler_api.test.ts
  14. 67
      apps/remix-ide-e2e/src/tests/debugger.test.ts
  15. 14
      apps/remix-ide-e2e/src/tests/editor.spec.ts
  16. 30
      apps/remix-ide-e2e/src/tests/fileManager_api.test.ts
  17. 22
      apps/remix-ide-e2e/src/tests/generalSettings.test.ts
  18. 0
      apps/remix-ide-e2e/src/tests/gist.test.ts
  19. 73
      apps/remix-ide-e2e/src/tests/plugin_api.ts
  20. 0
      apps/remix-ide-e2e/src/tests/recorder.test.ts
  21. 27
      apps/remix-ide-e2e/src/tests/remixd.test.ts
  22. 22
      apps/remix-ide-e2e/src/tests/runAndDeploy.test.ts
  23. 19
      apps/remix-ide-e2e/src/tests/solidityImport.test.ts
  24. 6
      apps/remix-ide-e2e/src/tests/solidityImport_group1.spec.ts
  25. 68
      apps/remix-ide-e2e/src/tests/solidityUnittests.test.ts
  26. 53
      apps/remix-ide-e2e/src/tests/specialFunctions.test.ts
  27. 0
      apps/remix-ide-e2e/src/tests/staticAnalysis.test.ts
  28. 47
      apps/remix-ide-e2e/src/tests/terminal.test.ts
  29. 19
      apps/remix-ide-e2e/src/tests/transactionExecution.test.ts
  30. 0
      apps/remix-ide-e2e/src/tests/verticalIconsPanel.test.ts
  31. 2
      apps/remix-ide-e2e/src/types/index.d.ts
  32. 6
      apps/remix-ide/ci/browser_test.sh
  33. 2
      apps/remix-ide/ci/browser_tests.sh
  34. 27
      apps/remix-ide/ci/browser_tests_chrome_2.sh
  35. 27
      apps/remix-ide/ci/browser_tests_firefox_1.sh
  36. 27
      apps/remix-ide/ci/browser_tests_firefox_2.sh
  37. 8
      apps/remix-ide/ci/browser_tests_plugin_api.sh
  38. 21
      apps/remix-ide/ci/browser_tests_run_deploy.sh
  39. 22
      apps/remix-ide/ci/lint.sh
  40. 5
      apps/remix-ide/ci/publishIpfs
  41. 5
      apps/remix-ide/src/app.js
  42. 1
      apps/remix-ide/src/app/editor/editor.js
  43. 10
      apps/remix-ide/src/assets/css/themes/remix-black_undtds.css
  44. 8
      apps/remix-ide/src/assets/css/themes/remix-candy_ikhg4m.css
  45. 10
      apps/remix-ide/src/assets/css/themes/remix-dark_tvx1s2.css
  46. 4
      apps/remix-ide/src/assets/css/themes/remix-light_powaqg.css
  47. 6
      apps/remix-ide/src/assets/css/themes/remix-midcentury_hrzph3.css
  48. 11
      apps/remix-ide/webpack.config.js
  49. 9
      apps/solidity-compiler/src/app/app.tsx
  50. 35
      apps/solidity-compiler/src/app/compiler-api.ts
  51. 20
      apps/solidity-compiler/src/app/compiler.ts
  52. 2
      apps/solidity-compiler/src/environments/environment.prod.ts
  53. 2
      apps/solidity-compiler/src/environments/environment.ts
  54. 2
      apps/solidity-compiler/src/index.ts
  55. 9
      apps/solidity-compiler/src/main.tsx
  56. 4
      apps/solidity-compiler/src/polyfills.ts
  57. 9
      libs/remix-analyzer/package.json
  58. 7
      libs/remix-astwalker/package.json
  59. 11
      libs/remix-debug/package.json
  60. 4
      libs/remix-lib/package.json
  61. 7
      libs/remix-simulator/package.json
  62. 7
      libs/remix-solidity/package.json
  63. 11
      libs/remix-tests/package.json
  64. 2
      libs/remix-ui/clipboard/jest.config.js
  65. 2
      libs/remix-ui/clipboard/src/index.ts
  66. 1
      libs/remix-ui/debugger-ui/src/lib/vm-debugger/assembly-items.tsx
  67. 53
      libs/remix-ui/editor/src/lib/remix-ui-editor.tsx
  68. 4
      libs/remix-ui/editor/src/lib/syntax.ts
  69. 2
      libs/remix-ui/utils/jest.config.js
  70. 2
      libs/remix-ui/workspace/src/lib/actions/workspace.ts
  71. 4
      libs/remix-ui/workspace/src/lib/reducers/workspace.ts
  72. 3
      libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx
  73. 4
      libs/remix-url-resolver/package.json
  74. 10
      libs/remixd/package.json
  75. 4
      libs/remixd/src/bin/remixd.ts
  76. 2
      libs/remixd/src/websocket.ts
  77. 890
      package-lock.json
  78. 43
      package.json
  79. 10
      workspace.json

@ -2,12 +2,14 @@
#
# 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:
lint:
build:
docker:
# 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
# CircleCI maintains a library of pre-built images
@ -21,76 +23,29 @@ jobs:
steps:
- 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:
- checkout
- run: npm install
- run: npm run build:libs
- run: cd dist/libs/remix-tests && npm install
- run: npm run test:libs
remix-ide-chrome-1:
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
parallelism: 12
steps:
- checkout
- restore_cache:
keys:
- v1-deps-{{ checksum "package-lock.json" }}
- 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
- save_cache:
key: v1-deps-{{ checksum "package-lock.json" }}
paths:
- node_modules
- run: npm run downloadsolc_assets
- run: npx nx build remix-ide
- run: npx nx build remix-ide-e2e-src-local-plugin
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:
# 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
# CircleCI maintains a library of pre-built images
@ -101,30 +56,20 @@ jobs:
- COMMIT_AUTHOR_EMAIL: "yann@ethereum.org"
- COMMIT_AUTHOR: "Circle CI"
working_directory: ~/remix-project
parallelism: 12
parallelism: 35
steps:
- checkout
- restore_cache:
keys:
- v1-deps-{{ checksum "package-lock.json" }}
- 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:
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_2.sh
- store_test_results:
path: ./reports/tests
- store_artifacts:
path: ./reports/screenshots
remix-ide-firefox-1:
name: Remix Libs Linting
command: ./apps/remix-ide/ci/lint.sh
remix-libs:
docker:
# 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
# CircleCI maintains a library of pre-built images
@ -136,28 +81,22 @@ jobs:
- 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 --config=../remix-project/apps/remix-ide-e2e/seleniumConfig.js
- run:
name: Start Selenium
command: ./node_modules/.bin/selenium-standalone start --config=../remix-project/apps/remix-ide-e2e/seleniumConfig.js
background: true
- run: ./apps/remix-ide/ci/browser_tests_firefox_1.sh
- store_test_results:
path: ./reports/tests
- store_artifacts:
path: ./reports/screenshots
- attach_workspace:
at: .
- run: unzip ./persist/dist.zip
- restore_cache:
keys:
- v1-deps-{{ checksum "package-lock.json" }}
- run: npm i
- run: cd dist/libs/remix-tests && npm install
- run: npm run test:libs
remix-ide-firefox-2:
remix-ide-chrome:
docker:
# 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
# CircleCI maintains a library of pre-built images
@ -169,29 +108,33 @@ jobs:
- COMMIT_AUTHOR: "Circle CI"
working_directory: ~/remix-project
parallelism: 12
parallelism: 70
steps:
- browser-tools/install-chrome
- browser-tools/install-chromedriver
- checkout
- attach_workspace:
at: .
- run: unzip ./persist/dist.zip
- restore_cache:
keys:
- v1-deps-{{ checksum "package-lock.json" }}
- 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 --config=../remix-project/apps/remix-ide-e2e/seleniumConfig.js
- run: npm run selenium-install
- run:
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
- run: ./apps/remix-ide/ci/browser_tests_firefox_2.sh
- run: ./apps/remix-ide/ci/browser_test.sh chrome
- store_test_results:
path: ./reports/tests
- store_artifacts:
path: ./reports/screenshots
remix-ide-run-deploy:
remix-ide-firefox:
docker:
# 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
# CircleCI maintains a library of pre-built images
@ -201,21 +144,26 @@ jobs:
environment:
- COMMIT_AUTHOR_EMAIL: "yann@ethereum.org"
- 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
parallelism: 70
steps:
- browser-tools/install-firefox
- browser-tools/install-geckodriver
- checkout
- attach_workspace:
at: .
- run: unzip ./persist/dist.zip
- restore_cache:
keys:
- v1-deps-{{ checksum "package-lock.json" }}
- 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: npm run selenium-install
- run:
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
- run: ./apps/remix-ide/ci/browser_tests_run_deploy.sh
- run: ./apps/remix-ide/ci/browser_test.sh firefox
- store_test_results:
path: ./reports/tests
- store_artifacts:
@ -224,7 +172,7 @@ jobs:
remix-ide-plugin-api:
docker:
# 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
# CircleCI maintains a library of pre-built images
@ -236,18 +184,22 @@ jobs:
- 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
parallelism: 7
steps:
- browser-tools/install-chrome
- browser-tools/install-chromedriver
- checkout
- attach_workspace:
at: .
- run: unzip ./persist/dist.zip
- restore_cache:
keys:
- v1-deps-{{ checksum "package-lock.json" }}
- run: npm install
- run: npx nx build remix-ide --with-deps
- 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: npm run selenium-install
- run:
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
- run: ./apps/remix-ide/ci/browser_tests_plugin_api.sh
- store_test_results:
@ -258,7 +210,7 @@ jobs:
deploy-remix-live:
docker:
# 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
# CircleCI maintains a library of pre-built images
@ -286,7 +238,7 @@ jobs:
publish:
docker:
# 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
# CircleCI maintains a library of pre-built images
@ -312,7 +264,7 @@ jobs:
deploy-remix-alpha:
docker:
# 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
# CircleCI maintains a library of pre-built images
@ -340,7 +292,7 @@ jobs:
deploy-remix-beta:
docker:
# 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
# CircleCI maintains a library of pre-built images
@ -370,60 +322,48 @@ workflows:
version: 2
build_all:
jobs:
- lint
- build
- lint:
requires:
- build
- remix-libs:
requires:
- lint
- build
- remix-ide-plugin-api:
requires:
- lint
- remix-ide-chrome-1:
requires:
- lint
- remix-ide-chrome-2:
requires:
- lint
- remix-ide-firefox-1:
requires:
- lint
- remix-ide-firefox-2:
requires:
- lint
- remix-ide-run-deploy:
- build
- remix-ide-chrome:
requires:
- lint
- publish:
- build
- remix-ide-firefox:
requires:
- lint
- build
- deploy-remix-live:
requires:
- remix-ide-chrome-1
- remix-ide-chrome-2
- remix-ide-firefox-1
- remix-ide-firefox-2
- remix-ide-run-deploy
- lint
- remix-libs
- remix-ide-chrome
- remix-ide-firefox
- remix-ide-plugin-api
filters:
branches:
only: remix_live
- deploy-remix-alpha:
requires:
- remix-ide-chrome-1
- remix-ide-chrome-2
- remix-ide-firefox-1
- remix-ide-firefox-2
- remix-ide-run-deploy
- lint
- remix-libs
- remix-ide-chrome
- remix-ide-firefox
- remix-ide-plugin-api
filters:
branches:
only: master
- deploy-remix-beta:
requires:
- remix-ide-chrome-1
- remix-ide-chrome-2
- remix-ide-firefox-1
- remix-ide-firefox-2
- remix-ide-run-deploy
- lint
- remix-libs
- remix-ide-chrome
- remix-ide-firefox
- remix-ide-plugin-api
filters:
branches:

@ -0,0 +1,27 @@
name: remix-publish-action
on:
pull_request:
types: [ labeled ]
jobs:
build:
if: ${{ github.event.label.name == 'publish' }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- run: npm install
- run: ls
- run: pwd
- run: npm run downloadsolc_assets
- run: npm run build:production
- run: echo "action_state=$('./apps/remix-ide/ci/publishIpfs')" >> $GITHUB_ENV
- uses: mshick/add-pr-comment@v1
with:
message: |
ipfs://${{ env.action_state }}
https://ipfs.remixproject.org/ipfs/${{ env.action_state }}
https://gateway.ipfs.io/ipfs/${{ env.action_state }}
repo-token: ${{ secrets.GITHUB_TOKEN }}
repo-token-user-login: 'github-actions[bot]' # The user.login for temporary GitHub tokens
allow-repeats: false # This is the default

2
.gitignore vendored

@ -12,6 +12,8 @@ docs/_build
TODO
soljson.js
*~
*_group*.*.ts
*_group*.ts
# 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 = {
src_folders: ['dist/apps/remix-ide-e2e/src/tests'],
output_folder: './reports/tests',
@ -28,7 +23,10 @@ module.exports = {
desiredCapabilities: {
browserName: 'firefox',
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']
},
@ -39,34 +37,36 @@ module.exports = {
javascriptEnabled: true,
acceptSslCerts: true,
'goog:chromeOptions': {
args: ['window-size=2560,1440', 'start-fullscreen']
args: ['window-size=2560,1440', 'start-fullscreen', '--no-sandbox', '--headless', '--verbose']
}
}
},
'chrome-runAndDeploy': {
chromeDesktop: {
desiredCapabilities: {
browserName: 'chrome',
javascriptEnabled: true,
acceptSslCerts: true,
'goog:chromeOptions': {
args: ['window-size=2560,1440', 'start-fullscreen'],
extensions: [metamaskExtension]
args: ['window-size=2560,1440', 'start-fullscreen', '--no-sandbox']
}
}
},
safari: {
'chrome-runAndDeploy': {
desiredCapabilities: {
browserName: 'safari',
browserName: 'chrome',
javascriptEnabled: true,
acceptSslCerts: true
acceptSslCerts: true,
'goog:chromeOptions': {
args: ['window-size=2560,1440', 'start-fullscreen', '--no-sandbox', '--headless', '--verbose']
}
}
},
ie: {
firefoxDesktop: {
desiredCapabilities: {
browserName: 'internet explorer',
browserName: 'firefox',
javascriptEnabled: true,
acceptSslCerts: true
}
@ -76,7 +76,10 @@ module.exports = {
desiredCapabilities: {
browserName: 'firefox',
javascriptEnabled: true,
acceptSslCerts: true
acceptSslCerts: true,
'moz:firefoxOptions': {
args: ['-headless']
}
}
}
}

@ -1,10 +1,10 @@
/* eslint-disable */
module.exports = {
version: '3.8.1',
version: '4.0.0',
baseURL: 'https://selenium-release.storage.googleapis.com',
drivers: {
chrome: {
version: '2.39',
version: '96.0.4664.35',
arch: process.arch,
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 = {
'@disabled': true,
before: function (browser: NightwatchBrowser, done: VoidFunction) {
init(browser, done)
},
@ -17,7 +18,7 @@ module.exports = {
return sources
},
'Should compile using "compileWithParamaters" API': function (browser: NightwatchBrowser) {
'Should compile using "compileWithParamaters" API #group1': function (browser: NightwatchBrowser) {
browser
.addFile('test_jsCompile.js', { content: jsCompile })
.executeScript('remix.exeCurrent()')
@ -25,7 +26,7 @@ module.exports = {
.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
.addFile('test_jsCompileWithOptimization.js', { content: jsCompileWithOptimization })
.executeScript('remix.exeCurrent()')
@ -33,7 +34,7 @@ module.exports = {
.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
.addFile('test_jsCompileWithOptimizationDefault.js', { content: jsCompileWithOptimizationDefault })
.executeScript('remix.exeCurrent()')
@ -41,7 +42,7 @@ module.exports = {
.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
.addFile('test_updateConfiguration.js', { content: updateConfiguration })
.executeScript('remix.exeCurrent()')
@ -50,7 +51,7 @@ module.exports = {
.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
.setSolidityCompilerVersion('soljson-v0.8.1+commit.df193b15.js')
.addFile('ContractStackLimit.sol', { content: contractStackLimit })

@ -3,7 +3,7 @@ import { NightwatchBrowser } from 'nightwatch'
import init from '../helpers/init'
module.exports = {
'@disabled': true,
before: function (browser: NightwatchBrowser, done: VoidFunction) {
init(browser, done)
},
@ -12,16 +12,17 @@ module.exports = {
return sources
},
'Should launch debugger': function (browser: NightwatchBrowser) {
'Should launch debugger #group1': function (browser: NightwatchBrowser) {
browser.addFile('blah.sol', sources[0]['blah.sol'])
.clickLaunchIcon('udapp')
.waitForElementPresent('*[title="Deploy - transact (not payable)"]', 65000)
.click('*[title="Deploy - transact (not payable)"]')
.debugTransaction(0)
.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"]')
.clickLaunchIcon('udapp')
.waitForElementPresent('*[data-id="universalDappUiTitleExpander"]')
@ -29,14 +30,14 @@ module.exports = {
.scrollAndClick('*[title="string name, uint256 goal"]')
.setValue('*[title="string name, uint256 goal"]', '"toast", 999')
.click('*[data-id="createProject - transact (not payable)"]')
.debugTransaction(1)
.debugTransaction(0)
.pause(2000)
.scrollAndClick('*[data-id="solidityLocals"]')
.waitForElementContainsText('*[data-id="solidityLocals"]', 'toast', 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"]')
.waitForElementVisible('*[data-id="slider"]')
// eslint-disable-next-line dot-notation
@ -48,7 +49,7 @@ module.exports = {
.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"]')
.waitForElementPresent('*[data-id="buttonNavigatorIntoBack"]')
.scrollAndClick('*[data-id="buttonNavigatorIntoBack"]')
@ -61,7 +62,7 @@ module.exports = {
.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')
.execute(() => {
(window as any).addRemixBreakpoint(11)
@ -80,15 +81,17 @@ module.exports = {
.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
.clearConsole()
.clearTransactions()
.clickLaunchIcon('solidity')
.testContracts('externalImport.sol', sources[1]['externalImport.sol'], ['ERC20'])
.clickLaunchIcon('udapp')
.waitForElementPresent('*[title="Deploy - transact (not payable)"]', 35000)
.selectContract('ERC20')
.createContract('"tokenName", "symbol"')
.debugTransaction(2)
.debugTransaction(0)
.pause(2000)
.waitForElementVisible('#stepdetail')
.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
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
*/
browser
.clearConsole().clearTransactions()
.clickLaunchIcon('solidity')
.setSolidityCompilerVersion('soljson-v0.6.12+commit.27d51765.js')
.clickLaunchIcon('filePanel')
@ -116,9 +120,10 @@ module.exports = {
.clickLaunchIcon('udapp')
.selectContract('test')
.createContract('')
.clickInstance(2)
.clearConsole()
.clickInstance(0)
.clickFunction('test1 - transact (not payable)', { types: 'bytes userData', values: '0x000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000015b38da6a701c568545dcfcb03fcb875f56beddc4' })
.debugTransaction(4)
.debugTransaction(0)
.pause(2000)
.waitForElementVisible('#stepdetail')
.goToVMTraceStep(261)
@ -138,11 +143,10 @@ module.exports = {
.goToVMTraceStep(717)
.pause(5000)
.checkVariableDebug('soliditylocals', localVariable_step717_ABIEncoder) // all locals should be initiaed
.clickLaunchIcon('udapp')
.clickInstance(2)
.clearTransactions()
},
'Should load more solidity locals array': function (browser: NightwatchBrowser) {
'Should load more solidity locals array #group3': function (browser: NightwatchBrowser) {
browser
.clickLaunchIcon('solidity')
.testContracts('locals.sol', sources[3]['locals.sol'], ['testLocals'])
@ -150,32 +154,37 @@ module.exports = {
.waitForElementPresent('*[title="Deploy - transact (not payable)"]', 40000)
.createContract('')
.pause(2000)
.clickInstance(3)
.clearConsole()
.clickInstance(0)
.clickFunction('t - transact (not payable)')
.pause(2000)
.debugTransaction(6)
.waitForElementVisible('*[data-id="slider"]')
.debugTransaction(0)
.waitForElementVisible('*[data-id="slider"]').pause(2000)
// .setValue('*[data-id="slider"]', '5000') // Like this, setValue doesn't work properly for input type = range
// 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
.waitForElementPresent('*[data-id="treeViewDivtreeViewItemarray"]')
.click('*[data-id="treeViewDivtreeViewItemarray"]')
.waitForElementPresent('*[data-id="treeViewDivtreeViewLoadMore"]')
.waitForElementVisible('*[data-id="solidityLocals"]')
.waitForElementContainsText('*[data-id="solidityLocals"]', '9: 9 uint256', 60000)
.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
.clickLaunchIcon('solidity')
.pause(2000)
.testContracts('withGeneratedSources.sol', sources[4]['withGeneratedSources.sol'], ['A'])
.clickLaunchIcon('udapp')
.createContract('')
.clickInstance(4)
.clearConsole()
.clickInstance(0)
.clickFunction('f - transact (not payable)', { types: 'uint256[] ', values: '[]' })
.debugTransaction(8)
.debugTransaction(0)
.pause(2000)
.click('*[data-id="debuggerTransactionStartButton"]') // stop debugging
.click('*[data-id="debugGeneratedSourcesLabel"]') // select debug with generated sources
@ -186,16 +195,16 @@ module.exports = {
})
.click('*[data-id="debuggerTransactionStartButton"]')
},
'Should call the debugger api: getTrace': function (browser: NightwatchBrowser) {
// depends on Should debug using generated sources
'Should call the debugger api: getTrace #group4': function (browser: NightwatchBrowser) {
browser
.addFile('test_jsGetTrace.js', { content: jsGetTrace })
.executeScript('remix.exeCurrent()')
.pause(1000)
.waitForElementContainsText('*[data-id="terminalJournal"]', '{"gas":"0x575f","return":"0x0000000000000000000000000000000000000000000000000000000000000000","structLogs":', 60000)
},
'Should call the debugger api: debug': function (browser: NightwatchBrowser) {
// depends on Should debug using generated sources
'Should call the debugger api: debug #group4': function (browser: NightwatchBrowser) {
browser
.addFile('test_jsDebug.js', { content: jsDebug })
.executeScript('remix.exeCurrent()')
@ -214,7 +223,7 @@ module.exports = {
.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
.clickLaunchIcon('solidity')
.setSolidityCompilerVersion('soljson-v0.8.7+commit.e28d00a7.js')
@ -428,7 +437,7 @@ const localVariable_step717_ABIEncoder = { // eslint-disable-line
const jsGetTrace = `(async () => {
try {
const result = await remix.call('debugger', 'getTrace', '0x9341be49e911afe99bf1abc67cbcf36739d2e6470a08a69511c205a0737d7332')
const result = await remix.call('debugger', 'getTrace', '0x16be5c31014a7e1552d136f7ed7bc7788f3bb9e45e31b059df253173f2df31e7')
console.log('result ', result)
} catch (e) {
console.log(e.message)
@ -437,7 +446,7 @@ const jsGetTrace = `(async () => {
const jsDebug = `(async () => {
try {
const result = await remix.call('debugger', 'debug', '0x9341be49e911afe99bf1abc67cbcf36739d2e6470a08a69511c205a0737d7332')
const result = await remix.call('debugger', 'debug', '0x16be5c31014a7e1552d136f7ed7bc7788f3bb9e45e31b059df253173f2df31e7')
console.log('result ', result)
} catch (e) {
console.log(e.message)

@ -9,7 +9,7 @@ module.exports = {
init(browser, done)
},
'Should zoom in editor': function (browser: NightwatchBrowser) {
'Should zoom in editor ': function (browser: NightwatchBrowser) {
browser.waitForElementVisible('div[data-id="mainPanelPluginsContainer"]')
.clickLaunchIcon('filePanel')
.waitForElementVisible('div[data-id="filePanelFileExplorerTree"]')
@ -22,7 +22,7 @@ module.exports = {
.checkElementStyle('.view-lines', 'font-size', '16px')
},
'Should zoom out editor': function (browser: NightwatchBrowser) {
'Should zoom out editor ': function (browser: NightwatchBrowser) {
browser.waitForElementVisible('#editorView')
.checkElementStyle('.view-lines', 'font-size', '16px')
.click('*[data-id="tabProxyZoomOut"]')
@ -30,7 +30,7 @@ module.exports = {
.checkElementStyle('.view-lines', 'font-size', '14px')
},
'Should display compile error in editor': function (browser: NightwatchBrowser) {
'Should display compile error in editor ': function (browser: NightwatchBrowser) {
browser.waitForElementVisible('#editorView')
.setEditorValue(storageContractWithError + 'error')
.pause(2000)
@ -42,7 +42,7 @@ module.exports = {
.checkAnnotations('fa-exclamation-square', 29) // error
},
'Should minimize and maximize codeblock in editor': '' + function (browser: NightwatchBrowser) {
'Should minimize and maximize codeblock in editor ': '' + function (browser: NightwatchBrowser) {
browser.waitForElementVisible('#editorView')
.waitForElementVisible('.ace_open')
.click('.ace_start:nth-of-type(1)')
@ -51,7 +51,7 @@ module.exports = {
.waitForElementVisible('.ace_open')
},
'Should add breakpoint to editor': function (browser: NightwatchBrowser) {
'Should add breakpoint to editor ': function (browser: NightwatchBrowser) {
browser.waitForElementVisible('#editorView')
.waitForElementNotPresent('.margin-view-overlays .fa-circle')
.execute(() => {
@ -83,7 +83,7 @@ module.exports = {
*/
},
'Should highlight source code': function (browser: NightwatchBrowser) {
'Should highlight source code ': function (browser: NightwatchBrowser) {
// include all files here because switching between plugins in side-panel removes highlight
browser
.addFile('sourcehighlight.js', sourcehighlightScript)
@ -115,7 +115,7 @@ module.exports = {
.checkElementStyle('.highlightLine51', 'background-color', 'rgb(52, 152, 219)')
},
'Should remove all highlights from source code': function (browser: NightwatchBrowser) {
'Should remove all highlights from source code ': function (browser: NightwatchBrowser) {
browser.waitForElementVisible('li[data-id="treeViewLitreeViewItemremoveAllSourcehighlightScript.js"]')
.click('li[data-id="treeViewLitreeViewItemremoveAllSourcehighlightScript.js"]')
.pause(2000)

@ -3,11 +3,12 @@ import { NightwatchBrowser } from 'nightwatch'
import init from '../helpers/init'
module.exports = {
'@disabled': true,
before: function (browser: NightwatchBrowser, done: VoidFunction) {
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
.addFile('file.js', { content: executeFile })
.executeScript('remix.exeCurrent()')
@ -15,7 +16,7 @@ module.exports = {
.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
.addFile('exists.js', { content: executeExists })
.executeScript('remix.exeCurrent()')
@ -23,14 +24,14 @@ module.exports = {
.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
.addFile('open.js', { content: executeOpen })
.executeScript('remix.exeCurrent()')
.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
.addFile('writeFile.js', { content: executeWriteFile })
.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
.addFile('writeFile.js', { content: executeWriteFile })
.executeScript('remix.exeCurrent()')
.addFile('readFile.js', { content: executeReadFile })
.executeScript('remix.exeCurrent()')
.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
.addFile('copyFile.js', { content: executeCopyFile })
.executeScript('remix.exeCurrent()')
.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
.addFile('renameFile.js', { content: executeRename })
.executeScript('remix.exeCurrent()')
@ -63,7 +66,7 @@ module.exports = {
.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
.addFile('mkdirFile.js', { content: executeMkdir })
.executeScript('remix.exeCurrent()')
@ -71,7 +74,7 @@ module.exports = {
.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
.addFile('readdirFile.js', { content: executeReaddir })
.executeScript('remix.exeCurrent()')
@ -79,8 +82,9 @@ module.exports = {
.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
.addFile('old_contract.sol', { content: 'test' })
.addFile('removeFile.js', { content: executeRemove })
.executeScript('remix.exeCurrent()')
.pause(2000)
@ -88,12 +92,12 @@ module.exports = {
},
// 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
.addFile('test_jsRemoveFolder.js', { content: executeRemoveOnFolder })
.executeScript('remix.exeCurrent()')
.pause(2000)
.waitForElementNotPresent('[data-id="treeViewLitreeViewItemTest_Folder"]', 60000)
.waitForElementNotPresent('[data-id="treeViewLitreeViewItemcontracts"]', 60000)
.end()
}
}
@ -196,7 +200,7 @@ const executeRemove = `
const executeRemoveOnFolder = `(async () => {
try {
await remix.call('fileManager', 'remove', 'Test_Folder')
await remix.call('fileManager', 'remove', 'contracts')
} catch (e) {
console.log(e.message)
}

@ -7,7 +7,7 @@ module.exports = {
init(browser, done, 'http://127.0.0.1:8080', false)
},
'Should display settings menu': function (browser: NightwatchBrowser) {
'Should display settings menu ': function (browser: NightwatchBrowser) {
browser.waitForElementVisible('*[data-id="remixIdeIconPanel"]', 10000)
.click('*[data-id="landingPageStartSolidity"]')
.waitForElementVisible('*[data-id="verticalIconsKindsettings"]', 5000)
@ -15,7 +15,7 @@ module.exports = {
.waitForElementContainsText('h6[data-id="sidePanelSwapitTitle"]', 'SETTINGS')
},
'Should activate `generate contract metadata`': function (browser) {
'Should activate `generate contract metadata` ': function (browser) {
browser.waitForElementVisible('*[data-id="remixIdeSidePanel"]', 5000)
.waitForElementVisible('*[data-id="settingsTabGenerateContractMetadataLabel"]', 5000)
.verify.elementPresent('[data-id="settingsTabGenerateContractMetadata"]:checked')
@ -35,7 +35,7 @@ module.exports = {
})
},
'Should add new github access token': function (browser: NightwatchBrowser) {
'Should add new github access token ': function (browser: NightwatchBrowser) {
browser.waitForElementVisible('*[data-id="verticalIconsKindsettings"]', 5000)
.click('*[data-id="verticalIconsKindsettings"]')
.setValue('*[data-id="settingsTabGistAccessToken"]', '**********')
@ -45,7 +45,7 @@ module.exports = {
.pause(3000)
},
'Should copy github access token to clipboard': function (browser: NightwatchBrowser) {
'Should copy github access token to clipboard ': function (browser: NightwatchBrowser) {
browser.waitForElementVisible('*[data-id="verticalIconsKindsettings"]', 5000)
.click('*[data-id="copyToClipboardCopyIcon"]')
.waitForElementVisible('*[data-shared="tooltipPopup"]', 5000)
@ -54,7 +54,7 @@ module.exports = {
// .assert.containsText('*[data-shared="tooltipPopup"]:nth-last-of-type(1)', 'Copied value to clipboard.')
},
'Should remove github access token': function (browser: NightwatchBrowser) {
'Should remove github access token ': function (browser: NightwatchBrowser) {
browser.waitForElementVisible('*[data-id="verticalIconsKindsettings"]', 5000)
.pause(1000)
.click('*[data-id="settingsTabRemoveGistToken"]')
@ -63,7 +63,7 @@ module.exports = {
.assert.containsText('*[data-id="settingsTabGistAccessToken"]', '')
},
'Should load dark theme': function (browser: NightwatchBrowser) {
'Should load dark theme ': function (browser: NightwatchBrowser) {
browser.waitForElementVisible('*[data-id="verticalIconsKindsettings"]', 5000)
.click('*[data-id="settingsTabThemeLabelDark"]')
.pause(2000)
@ -75,7 +75,7 @@ module.exports = {
.checkElementStyle(':root', '--danger', remixIdeThemes.dark.danger)
},
'Should load light theme': function (browser: NightwatchBrowser) {
'Should load light theme ': function (browser: NightwatchBrowser) {
browser.waitForElementVisible('*[data-id="verticalIconsKindsettings"]', 5000)
.click('*[data-id="settingsTabThemeLabelLight"]')
.pause(2000)
@ -87,7 +87,7 @@ module.exports = {
.checkElementStyle(':root', '--danger', remixIdeThemes.light.danger)
},
'Should load Cerulean theme': function (browser: NightwatchBrowser) {
'Should load Cerulean theme ': function (browser: NightwatchBrowser) {
browser.waitForElementVisible('*[data-id="verticalIconsKindsettings"]', 5000)
.click('*[data-id="settingsTabThemeLabelCerulean"]')
.pause(5000)
@ -99,7 +99,7 @@ module.exports = {
.checkElementStyle(':root', '--danger', remixIdeThemes.curelean.danger)
},
'Should load Flatly theme': function (browser: NightwatchBrowser) {
'Should load Flatly theme ': function (browser: NightwatchBrowser) {
browser.waitForElementVisible('*[data-id="verticalIconsKindsettings"]', 5000)
.click('*[data-id="settingsTabThemeLabelFlatly"]')
.pause(2000)
@ -111,7 +111,7 @@ module.exports = {
.checkElementStyle(':root', '--danger', remixIdeThemes.flatly.danger)
},
'Should load Spacelab theme': function (browser) {
'Should load Spacelab theme ': function (browser) {
browser.waitForElementVisible('*[data-id="verticalIconsKindsettings"]', 5000)
.click('*[data-id="settingsTabThemeLabelSpacelab"]')
.pause(2000)
@ -123,7 +123,7 @@ module.exports = {
.checkElementStyle(':root', '--danger', remixIdeThemes.spacelab.danger)
},
'Should load Cyborg theme': function (browser) {
'Should load Cyborg theme ': function (browser) {
browser.waitForElementVisible('*[data-id="verticalIconsKindsettings"]', 5000)
.click('*[data-id="settingsTabThemeLabelCyborg"]')
.pause(2000)

@ -10,7 +10,7 @@ declare global {
const localPluginData: Profile & LocationProfile & ExternalProfile = {
name: 'localPlugin',
displayName: 'Local Plugin',
canActivate: ['dGitProvider', 'flattener', 'solidityUnitTesting'],
canActivate: ['dGitProvider', 'flattener', 'solidityUnitTesting', 'udapp'],
url: 'http://localhost:2020',
location: 'sidePanel'
}
@ -127,8 +127,9 @@ const assertPluginIsActive = function (browser: NightwatchBrowser, id: string, s
}
module.exports = {
'@disabled': true,
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) {
@ -144,13 +145,13 @@ module.exports = {
},
// UDAPP
'Should get accounts': async function (browser: NightwatchBrowser) {
'Should get accounts #group1': async function (browser: NightwatchBrowser) {
await clickAndCheckLog(browser, 'udapp:getAccounts', '0x5B38Da6a701c568545dCfcB03FcB875f56beddC4', null, null)
},
// 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, {
id: 'localPlugin',
name: 'testCommand',
@ -179,118 +180,118 @@ module.exports = {
// 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)
},
'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, '/')
},
'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)
},
'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')
},
'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)
},
'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: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')
},
'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)
},
'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:getCurrentFile', 'contracts/1_Storage.sol', null, null)
await clickAndCheckLog(browser, 'fileManager:switchFile', null, { event: 'currentFileChanged', args: ['README.txt'] }, 'README.txt')
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: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: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: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: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:getCurrentWorkspace', { name: 'emptyworkspace', isLocalhost: false, absolutePath: '.workspaces/emptyworkspace' }, null, 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: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)
},
'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)
},
'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')
},
'Should have event when switching workspace': async function (browser: NightwatchBrowser) {
'Should have event when switching workspace #group2': async function (browser: NightwatchBrowser) {
// @ts-ignore
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)
})
},
'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: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:getWorkspaces', ['emptyworkspace', 'newspace', 'renamed'], null, null)
},
// 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, '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, {
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)
},
'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: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)
},
'Should have branches': async function (browser: NightwatchBrowser) {
'Should have branches #group3': async function (browser: NightwatchBrowser) {
await clickAndCheckLog(browser, 'dGitProvider:branches', [{ name: 'main' }], null, null)
},
// 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')
},
'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')
},
// 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')
browser.frameParent()
assertPluginIsActive(browser, 'solidityUnitTesting', true)
@ -299,11 +300,11 @@ module.exports = {
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')
},
'Should deactivate solidityUnitTesting': async function (browser: NightwatchBrowser) {
'Should deactivate solidityUnitTesting #group5': async function (browser: NightwatchBrowser) {
await clickAndCheckLog(browser, 'manager:deactivatePlugin', null, null, 'solidityUnitTesting')
browser.frameParent()
assertPluginIsActive(browser, 'solidityUnitTesting', false)
@ -314,14 +315,14 @@ module.exports = {
// 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')
browser.pause(5000, async () => {
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)
}
}

@ -45,6 +45,7 @@ const sources = [
]
module.exports = {
'@disabled': true,
before: function (browser, done) {
init(browser, done)
},
@ -52,25 +53,27 @@ module.exports = {
'@sources': function () {
return sources
},
Remixd: function (browser) {
'start Remixd': function (browser) {
startRemixd(browser)
},
'run Remixd tests #group4': function (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")
remix (as well as truffle) try to resolve it against the node_modules and installed_contracts folder.
*/
browser.waitForElementVisible('#icon-panel', 2000)
// .clickLaunchIcon('filePanel')
.clickLaunchIcon('filePanel')
.click('[data-path="ballot.sol"]')
.addFile('test_import_node_modules.sol', sources[3]['test_import_node_modules.sol'])
.clickLaunchIcon('solidity')
.setSolidityCompilerVersion('soljson-v0.5.0+commit.1d4f565a.js')
.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)
.clickLaunchIcon('filePanel')
.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
.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'])
.clickLaunchIcon('solidityStaticAnalysis')
.click('#staticanalysisButton button')
@ -101,7 +104,7 @@ module.exports = {
.journalLastChildIncludes('On branch ')
},
'Close Remixd': function (browser) {
'Close Remixd #group3': function (browser) {
browser
.clickLaunchIcon('pluginManager')
.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
if (browserName === 'safari' || browserName === 'internet explorer') {
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)
.click('#modal-footer-ok')
// .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"]')
.click('[data-path="folder1"]')
.waitForElementVisible('[data-path="contract1.sol"]')
@ -156,7 +163,7 @@ function runTests (browser: NightwatchBrowser) {
.waitForElementVisible('[data-path="folder1/renamed_contract_' + browserName + '.sol"]') // check if renamed file is preset
.waitForElementNotPresent('[data-path="folder1/contract_' + browserName + '.sol"]') // check if renamed (old) file is not present
.waitForElementNotPresent('[data-path="folder1/contract_' + browserName + '_toremove.sol"]') // check if removed (old) file is not present
// .click('[data-path="folder1/renamed_contract_' + browserName + '.sol"]')
// .click('[data-path="folder1/renamed_contract_' + browserName + '.sol"]')
}
function testImportFromRemixd (browser: NightwatchBrowser, callback: VoidFunction) {

@ -6,7 +6,7 @@ const passphrase = process.env.account_passphrase
const password = process.env.account_password
module.exports = {
'@disabled': true,
before: function (browser: NightwatchBrowser, done: VoidFunction) {
init(browser, done)
},
@ -15,14 +15,14 @@ module.exports = {
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"]')
.clickLaunchIcon('udapp')
.waitForElementPresent('*[data-id="sidePanelSwapitTitle"]')
.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"]')
.assert.containsText('*[data-id="sidePanelSwapitTitle"]', 'DEPLOY & RUN TRANSACTIONS')
.validateValueInput('#value', '0000', '0')
@ -30,30 +30,30 @@ module.exports = {
.validateValueInput('#value', 'dragon', '0')
},
'Should sign message using account key': function (browser: NightwatchBrowser) {
browser.waitForElementPresent('*[data-id="settingsRemixRunSignMsg"]')
'Should sign message using account key #group2': function (browser: NightwatchBrowser) {
browser.waitForElementVisible('*[data-id="settingsRemixRunSignMsg"]')
.click('select[id="selectExEnvOptions"] option[value="vm-berlin"]')
.pause(2000)
.click('*[data-id="settingsRemixRunSignMsg"]')
.pause(2000)
.waitForElementPresent('*[data-id="modalDialogCustomPromptText"]')
.waitForElementVisible('*[data-id="modalDialogCustomPromptText"]', 120000)
.setValue('*[data-id="modalDialogCustomPromptText"]', 'Remix is cool!')
.assert.elementNotPresent('*[data-id="settingsRemixRunSignMsgHash"]')
.assert.elementNotPresent('*[data-id="settingsRemixRunSignMsgSignature"]')
.modalFooterOKClick()
.waitForElementPresent('*[data-id="modalDialogContainer"]', 12000)
.waitForElementVisible('*[data-id="modalDialogContainer"]', 12000)
.assert.elementPresent('*[data-id="settingsRemixRunSignMsgHash"]')
.assert.elementPresent('*[data-id="settingsRemixRunSignMsgSignature"]')
.modalFooterOKClick()
},
'Should deploy contract on JavascriptVM': function (browser: NightwatchBrowser) {
browser.waitForElementPresent('*[data-id="remixIdeSidePanel"]')
'Should deploy contract on JavascriptVM #group3': function (browser: NightwatchBrowser) {
browser.waitForElementVisible('*[data-id="remixIdeSidePanel"]')
.clickLaunchIcon('filePanel')
.addFile('Greet.sol', sources[0]['Greet.sol'])
.clickLaunchIcon('udapp')
.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)"]')
.pause(5000)
.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"]')
.waitForElementPresent('*[data-id="universalDappUiTitleExpander"]')
.click('*[data-id="universalDappUiTitleExpander"]')

@ -3,6 +3,7 @@ import { NightwatchBrowser } from 'nightwatch'
import init from '../helpers/init'
module.exports = {
'@disabled': true,
before: function (browser: NightwatchBrowser, done: VoidFunction) {
init(browser, done)
},
@ -11,11 +12,11 @@ module.exports = {
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'])
},
'Test Success Import': function (browser: NightwatchBrowser) {
'Test Success Import #group1': function (browser: NightwatchBrowser) {
browser.addFile('Untitled1.sol', sources[1]['Untitled1.sol'])
.addFile('Untitled2.sol', sources[1]['Untitled2.sol'])
.openFile('Untitled1.sol')
@ -23,13 +24,13 @@ module.exports = {
.pause(1000)
},
'Test Failed Import': function (browser: NightwatchBrowser) {
'Test Failed Import #group1': function (browser: NightwatchBrowser) {
browser.addFile('Untitled3.sol', sources[2]['Untitled3.sol'])
.clickLaunchIcon('solidity')
.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
.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'])
@ -37,7 +38,7 @@ module.exports = {
.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
.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'])
@ -45,7 +46,7 @@ module.exports = {
.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
.setSolidityCompilerVersion('soljson-v0.8.0+commit.c7dfd78e.js') // open-zeppelin moved to pragma ^0.8.0 (master branch)
.clickLaunchIcon('filePanel')
@ -55,7 +56,7 @@ module.exports = {
.verifyContracts(['test10', 'ERC20'], { wait: 10000 })
},
'Test Github Import - raw URL': function (browser: NightwatchBrowser) {
'Test Github Import - raw URL #group4': function (browser: NightwatchBrowser) {
browser
.clickLaunchIcon('filePanel')
.click('li[data-id="treeViewLitreeViewItemREADME.txt"')
@ -64,7 +65,7 @@ module.exports = {
.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
.setSolidityCompilerVersion('soljson-v0.7.4+commit.3f05b770.js')
.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
.setSolidityCompilerVersion('soljson-v0.8.7+commit.e28d00a7.js')
.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'
module.exports = {
'@disabled': true,
before: function (browser: NightwatchBrowser, done) {
init(browser, done)
},
@ -12,18 +12,24 @@ module.exports = {
'@sources': function () {
return sources
},
'Should launch solidity unit test plugin and create test files in FE': function (browser: NightwatchBrowser) {
'open SUT plugin': 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'])
.clickLaunchIcon('pluginManager')
.scrollAndClick('*[data-id="pluginManagerComponentActivateButtonsolidityUnitTesting"]')
.click('*[data-id="verticalIconsKindsolidityUnitTesting"]')
.waitForElementPresent('*[data-id="sidePanelSwapitTitle"]')
.assert.containsText('*[data-id="sidePanelSwapitTitle"]', 'SOLIDITY UNIT TESTING')
.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_accounts.sol"]')
.openFile('.deps/remix-tests/remix_tests.sol')
@ -34,22 +40,19 @@ module.exports = {
.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"]')
.clickLaunchIcon('filePanel')
.openFile('simple_storage.sol')
.click('*[data-id="verticalIconsKindsolidityUnitTesting"]')
.waitForElementPresent('*[data-id="testTabGenerateTestFile"]')
.click('*[data-id="testTabGenerateTestFile"]')
.waitForElementPresent('*[title="default_workspace/tests/simple_storage_test.sol"]')
.clickLaunchIcon('filePanel')
.waitForElementPresent('[data-id="treeViewDivtreeViewItemtests"]')
.click('[data-id="treeViewDivtreeViewItemtests"]')
.openFile('tests/simple_storage_test.sol')
.waitForElementPresent('*[title="default_workspace/tests/simple_storage_test.sol"]')
.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"]')
.addFile('tests/simple_storage_test.sol', sources[0]['tests/simple_storage_test.sol'])
.click('*[data-id="verticalIconsKindsolidityUnitTesting"]')
@ -66,14 +69,14 @@ module.exports = {
.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"]')
.clickLaunchIcon('filePanel')
.addFile('tests/ks2b_test.sol', sources[0]['tests/ks2b_test.sol'])
.click('*[data-id="verticalIconsKindsolidityUnitTesting"]')
.waitForElementPresent('*[data-id="testTabCheckAllTests"]')
.click('*[data-id="testTabCheckAllTests"]')
.clickElementAtPosition('.singleTestLabel', 2)
.clickElementAtPosition('.singleTestLabel', 1)
.scrollAndClick('*[data-id="testTabRunTestsTabRunAction"]')
.waitForElementContainsText('*[data-id="testTabSolidityUnitTestsOutput"]', 'tests/ks2b_test.sol', 120000)
.waitForElementContainsText('*[data-id="testTabSolidityUnitTestsOutput"]', '✓ Check project exists', 120000)
@ -86,11 +89,10 @@ module.exports = {
.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"]')
.waitForElementPresent('*[data-id="testTabRunTestsTabRunAction"]')
.clickElementAtPosition('.singleTestLabel', 0)
.clickElementAtPosition('.singleTestLabel', 1)
.scrollAndClick('*[data-id="testTabRunTestsTabRunAction"]')
.pause(2000)
.click('*[data-id="testTabRunTestsTabStopAction"]')
@ -100,14 +102,15 @@ module.exports = {
.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"]')
.addFile('tests/compilationError_test.sol', sources[0]['compilationError_test.sol'])
.click('div[title="default_workspace/tests/compilationError_test.sol"] span[class="close-tabs"]')
.clickLaunchIcon('solidityUnitTesting')
.pause(2000)
.click('*[data-id="testTabCheckAllTests"]')
.clickElementAtPosition('.singleTestLabel', 3)
// .click('#singleTesttests/compilationError_test.sol')
.clickElementAtPosition('.singleTestLabel', 2)
.scrollAndClick('*[data-id="testTabRunTestsTabRunAction"]')
.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)
@ -119,31 +122,31 @@ module.exports = {
.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"]')
.addFile('tests/deployError_test.sol', sources[0]['tests/deployError_test.sol'])
.clickLaunchIcon('filePanel')
.openFile('tests/deployError_test.sol')
.clickLaunchIcon('solidityUnitTesting')
.click('*[data-id="testTabCheckAllTests"]')
.clickElementAtPosition('.singleTestLabel', 4)
.clickElementAtPosition('.singleTestLabel', 1)
.scrollAndClick('*[data-id="testTabRunTestsTabRunAction"]')
.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"]')
.addFile('tests/methodFailure_test.sol', sources[0]['tests/methodFailure_test.sol'])
.clickLaunchIcon('filePanel')
.openFile('tests/methodFailure_test.sol')
.clickLaunchIcon('solidityUnitTesting')
.click('*[data-id="testTabCheckAllTests"]')
.clickElementAtPosition('.singleTestLabel', 5)
.clickElementAtPosition('.singleTestLabel', 2)
.scrollAndClick('*[data-id="testTabRunTestsTabRunAction"]')
.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
.waitForElementPresent('*[data-id="verticalIconsKindfilePanel"]')
.addFile('myTests/simple_storage_test.sol', sources[0]['tests/simple_storage_test.sol'])
@ -159,7 +162,7 @@ module.exports = {
.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
.waitForElementPresent('*[data-id="verticalIconsKindfilePanel"]')
.clickLaunchIcon('settings')
@ -191,7 +194,7 @@ module.exports = {
.verify.attributeEquals('*[data-id="uiPathInput"]', 'value', 'tests')
},
'Solidity Unit tests Basic': function (browser: NightwatchBrowser) {
'Solidity Unit tests Basic #group4': function (browser: NightwatchBrowser) {
browser
.waitForElementPresent('*[data-id="verticalIconsKindfilePanel"]')
.clickLaunchIcon('filePanel')
@ -209,7 +212,7 @@ module.exports = {
.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
browser
@ -241,7 +244,7 @@ module.exports = {
.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
.waitForElementPresent('*[data-id="verticalIconsKindfilePanel"]')
.addFile('tests/ballotFailedLog_test.sol', sources[0]['tests/ballotFailedLog_test.sol'])
@ -252,13 +255,13 @@ module.exports = {
.pause(2000)
.waitForElementVisible('*[data-id="testTabSolidityUnitTestsOutputheader"]', 120000)
.waitForElementContainsText('#solidityUnittestsOutput', 'tests/ballotFailedLog_test.sol', 60000)
.assert.containsText('#journal > div:nth-child(5) > span', 'Check winning proposal:')
.assert.containsText('#journal > div:nth-child(5) > span', 'Inside checkWinningProposal')
.assert.containsText('#journal', 'Check winning proposal:')
.assert.containsText('#journal', 'Inside checkWinningProposal')
.openFile('tests/ballotFailedLog_test.sol')
.removeFile('tests/ballotFailedLog_test.sol', 'workspace_new')
},
'Debug tests using debugger': function (browser: NightwatchBrowser) {
'Debug tests using debugger #group5': function (browser: NightwatchBrowser) {
browser
.waitForElementPresent('*[data-id="verticalIconsKindfilePanel"]')
.addFile('tests/ballotFailedDebug_test.sol', sources[0]['tests/ballotFailedDebug_test.sol'])
@ -275,6 +278,7 @@ module.exports = {
.click('#Check_winning_proposal_failed')
.waitForElementContainsText('*[data-id="sidePanelSwapitTitle"]', 'DEBUGGER', 60000)
.waitForElementContainsText('*[data-id="functionPanel"]', 'checkWinningProposalFailed()', 60000)
.waitForElementVisible('*[data-id="dropdownPanelSolidityLocals"]').pause(1000)
.click('*[data-id="dropdownPanelSolidityLocals"]')
.waitForElementContainsText('*[data-id="solidityLocals"]', 'no locals', 60000)
// eslint-disable-next-line dot-notation
@ -320,10 +324,12 @@ module.exports = {
.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
.clickLaunchIcon('solidity')
.setSolidityCompilerVersion('builtin')
.clickLaunchIcon('filePanel')
.click('*[data-id="treeViewLitreeViewItemcontracts"]')
.openFile('contracts/3_Ballot.sol')
.clickLaunchIcon('pluginManager')
.scrollAndClick('[data-id="pluginManagerComponentDeactivateButtonsolidityUnitTesting"]')

@ -3,6 +3,7 @@ import { NightwatchBrowser } from 'nightwatch'
import init from '../helpers/init'
module.exports = {
'@disabled': true,
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
// quick explanation:
@ -17,7 +18,7 @@ module.exports = {
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)
.testContracts('receiveAndFallback.sol', sources[0]['receiveAndFallback.sol'], ['CheckSpecials']) // compile
.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
browser.perform((done) => {
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
browser.perform((done) => {
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
browser.perform((done) => {
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
browser.perform((done) => {
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)
.testContracts('receiveOnly.sol', sources[1]['receiveOnly.sol'], ['CheckSpecials'])
.clickLaunchIcon('udapp')
.selectContract('CheckSpecials')
.createContract('')
.clickInstance(1)
.clickInstance(0)
.perform((done) => {
browser.getAddressAtPosition(1, (address) => {
browser.getAddressAtPosition(0, (address) => {
browser.sendLowLevelTx(address, '1', '')
.pause(1000)
.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
browser.perform((done) => {
browser.getAddressAtPosition(1, (address) => {
browser.getAddressAtPosition(0, (address) => {
browser.sendLowLevelTx(address, '0', '0xaa')
.pause(1000)
.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)
.testContracts('fallbackOnlyPayable.sol', sources[2]['fallbackOnlyPayable.sol'], ['CheckSpecials'])
.clickLaunchIcon('udapp')
.selectContract('CheckSpecials')
.createContract('')
.clickInstance(2)
.clickInstance(0)
.perform((done) => {
browser.getAddressAtPosition(2, (address) => {
browser.getAddressAtPosition(0, (address) => {
browser.sendLowLevelTx(address, '1', '')
.pause(1000)
.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
browser.perform((done) => {
browser.getAddressAtPosition(2, (address) => {
browser.getAddressAtPosition(0, (address) => {
browser.sendLowLevelTx(address, '1', '0xaa')
.pause(1000)
.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)
.testContracts('fallbackOnlyNotPayable.sol', sources[3]['fallbackOnlyNotPayable.sol'], ['CheckSpecials'])
.clickLaunchIcon('udapp')
.selectContract('CheckSpecials')
.createContract('')
.clickInstance(3)
.clickInstance(0)
.perform((done) => {
browser.getAddressAtPosition(3, (address) => {
browser.getAddressAtPosition(0, (address) => {
browser.sendLowLevelTx(address, '1', '')
.pause(1000)
.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)
.testContracts('receiveAndFallbackBothPayable.sol', sources[4]['receiveAndFallbackBothPayable.sol'], ['CheckSpecials'])
.clickLaunchIcon('udapp')
@ -173,10 +174,10 @@ module.exports = {
.clearValue('#value')
.setValue('#value', '0')
.createContract('')
.clickInstance(4)
.clickInstance(1)
.pause(1000)
.perform((done) => {
browser.getAddressAtPosition(4, (address) => {
browser.getAddressAtPosition(1, (address) => {
browser.sendLowLevelTx(address, '999999998765257135', '0xaa')
.pause(1000)
.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.getAddressAtPosition(4, (address) => {
browser.getAddressAtPosition(1, (address) => {
browser.sendLowLevelTx(address, '1', '')
.pause(1000)
.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)
.testContracts('notSpecial.sol', sources[5]['notSpecial.sol'], ['CheckSpecials'])
.clickLaunchIcon('udapp')
@ -207,10 +208,10 @@ module.exports = {
.clearValue('#value')
.setValue('#value', '0')
.createContract('')
.clickInstance(5)
.clickInstance(0)
.pause(1000)
.perform((done) => {
browser.getAddressAtPosition(5, (address) => {
browser.getAddressAtPosition(0, (address) => {
browser.sendLowLevelTx(address, '0', '')
.pause(1000)
.waitForElementVisible(`#instance${address} label[id="deployAndRunLLTxError"]`)

@ -3,11 +3,12 @@ import { NightwatchBrowser } from 'nightwatch'
import init from '../helpers/init'
module.exports = {
'@disabled': true,
before: function (browser: NightwatchBrowser, done: VoidFunction) {
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
.waitForElementVisible('*[data-id="terminalCli"]', 10000)
.executeScript('console.log(1 + 1)')
@ -15,7 +16,7 @@ module.exports = {
.waitForElementContainsText('*[data-id="terminalJournal"]', '2', 60000)
},
'Should clear console': function (browser: NightwatchBrowser) {
'Should clear console #group1': function (browser: NightwatchBrowser) {
browser
.waitForElementVisible('*[data-id="terminalCli"]')
.journalChildIncludes('Welcome to Remix')
@ -23,40 +24,29 @@ module.exports = {
.waitForElementContainsText('*[data-id="terminalJournal"]', '', 60000)
},
'Should display auto-complete menu': 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) {
'Async/Await Script #group1': function (browser: NightwatchBrowser) {
browser
.addFile('asyncAwait.js', { content: asyncAwait })
.openFile('asyncAwait.js')
.executeScript('remix.execute("asyncAwait.js")')
.waitForElementContainsText('*[data-id="terminalJournal"]', 'Waiting Promise', 60000)
.waitForElementContainsText('*[data-id="terminalJournal"]', 'result - ', 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
.addFile('asyncAwaitWithFileManagerAccess.js', { content: asyncAwaitWithFileManagerAccess })
.openFile('asyncAwaitWithFileManagerAccess.js')
.pause(5000)
.executeScript('remix.execute(\'asyncAwaitWithFileManagerAccess.js\')')
.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
.executeScript('web3.eth.getAccounts()')
.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
.click('*[data-id="terminalClearConsole"]') // clear the terminal
.clickLaunchIcon('udapp')
@ -68,7 +58,7 @@ module.exports = {
.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
.click('*[data-id="terminalClearConsole"]') // clear the terminal
.addFile('resolveExternalUrlAndSave.js', { content: resolveExternalUrlAndSave })
@ -79,7 +69,7 @@ module.exports = {
.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
.click('*[data-id="terminalClearConsole"]') // clear the terminal
.addFile('resolveUrl.js', { content: resolveUrl })
@ -89,7 +79,7 @@ module.exports = {
.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
.click('*[data-id="terminalClearConsole"]') // clear the terminal
.addFile('resolveExternalUrlAndSaveToaPath.js', { content: resolveExternalUrlAndSaveToaPath })
@ -100,7 +90,7 @@ module.exports = {
.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
.clickLaunchIcon('settings')
.clickLaunchIcon('udapp')
@ -109,12 +99,12 @@ module.exports = {
.clickLaunchIcon('filePanel')
.click('*[data-id="treeViewDivtreeViewItem"]') // make sure we create the file at the root folder
.addFile('deployWithEthersJs.js', { content: deployWithEthersJs })
.openFile('deployWithEthersJs.js')
// .openFile('deployWithEthersJs.js')
.pause(1000)
.click('[data-id="treeViewDivtreeViewItemcontracts"]')
.openFile('contracts/2_Owner.sol')
.clickLaunchIcon('solidity')
.click('*[data-id="compilerContainerCompileBtn"]') // compile Owner
.click('*[data-id="compilerContainerCompileBtn"]').pause(5000) // compile Owner
.executeScript('remix.execute(\'deployWithEthersJs.js\')')
.waitForElementContainsText('*[data-id="terminalJournal"]', 'Contract Address:', 60000)
.waitForElementContainsText('*[data-id="terminalJournal"]', '0xd9145CCE52D386f254917e481eB44e9943F39138', 60000)
@ -130,7 +120,7 @@ module.exports = {
.waitForElementContainsText('*[data-id="terminalJournal"]', '0xd9145CCE52D386f254917e481eB44e9943F39138', 60000)
},
'Should print hardhat logs': function (browser: NightwatchBrowser) {
'Should print hardhat logs #group4': function (browser: NightwatchBrowser) {
browser
.click('*[data-id="terminalClearConsole"]') // clear the terminal
.addFile('printHardhatlog.sol', { content: hardhatLog })
@ -153,7 +143,14 @@ module.exports = {
.clickFunction('getOwner - call')
.pause(1000)
.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'
module.exports = {
'@disabled': true,
before: function (browser: NightwatchBrowser, done: VoidFunction) {
init(browser, done)
},
@ -10,7 +11,7 @@ module.exports = {
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'])
.clickLaunchIcon('udapp')
.selectAccount('0xCA35b7d915458EF540aDe6068dFe2F44E8fa733c') // this account will be used for this test suite
@ -41,7 +42,7 @@ module.exports = {
.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'])
.clickLaunchIcon('udapp')
.click('#runTabView button[class^="instanceButton"]')
@ -86,7 +87,7 @@ module.exports = {
}).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'])
.clickLaunchIcon('udapp')
.click('#runTabView button[class^="instanceButton"]')
@ -112,7 +113,7 @@ module.exports = {
},
logs: [
{
from: '0x8c1eD7e19abAa9f23c476dA86Dc1577F1Ef401f5',
from: '0xd9145CCE52D386f254917e481eB44e9943F39138',
topic: '0xd30981760edbf605bda8689e945f622877f230c9a77cbfbd448aa4b7d8ac6e7f',
event: 'event1',
args: {
@ -131,7 +132,7 @@ module.exports = {
.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'])
.clickLaunchIcon('udapp')
.selectAccount('0xCA35b7d915458EF540aDe6068dFe2F44E8fa733c') // this account will be used for this test suite
@ -140,7 +141,7 @@ module.exports = {
.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'])
.clickLaunchIcon('udapp')
.selectAccount('0xCA35b7d915458EF540aDe6068dFe2F44E8fa733c') // this account will be used for this test suite
@ -161,8 +162,10 @@ module.exports = {
.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
.clickLaunchIcon('udapp')
.clearTransactions()
.click('*[data-id="settingsVMLondonMode"]') // switch to London fork
.selectAccount('0xCA35b7d915458EF540aDe6068dFe2F44E8fa733c') // this account will be used for this test suite
.click('#runTabView button[class^="instanceButton"]')
@ -180,7 +183,7 @@ module.exports = {
.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'])
.clickLaunchIcon('udapp')
.click('#runTabView button[class^="instanceButton"]')

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

@ -7,7 +7,7 @@ echo "$BUILD_ID"
TEST_EXITCODE=0
npm run ganache-cli &
npm run serve &
npm run serve:production &
echo 'sharing folder: ' $PWD '/apps/remix-ide/contracts' &
npm run remixd &
@ -15,9 +15,9 @@ 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)
TESTFILES=$(grep -IRiL "disabled" "dist/apps/remix-ide-e2e/src/tests" | grep "\.spec\|\.test" | 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
npx nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js $TESTFILE --env=$1 || TEST_EXITCODE=1
done
echo "$TEST_EXITCODE"

@ -22,7 +22,7 @@ setupRemixd
sleep 5
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
./node_modules/.bin/nightwatch --config ./apps/remix-ide/nightwatch.js --env chrome $TESTFILE || TEST_EXITCODE=1
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"
TEST_EXITCODE=0
npm run serve &
npm run serve:production &
npx nx serve remix-ide-e2e-src-local-plugin &
sleep 5
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"
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

@ -2,7 +2,6 @@
const IpfsHttpClient = require('ipfs-http-client')
const { globSource } = IpfsHttpClient
console.log('current folder', process.cwd())
const folder = process.cwd() + '/dist/apps/remix-ide';
(async () => {
@ -11,9 +10,7 @@ const folder = process.cwd() + '/dist/apps/remix-ide';
try {
let result = await ipfs.add(globSource(folder, { recursive: true}), { pin: false })
const hash = result.cid.toString()
console.log('ipfs://' + hash)
console.log('https://ipfs.remixproject.org/ipfs/' + hash)
console.log('https://gateway.ipfs.io/ipfs/' + hash)
console.log(hash)
} catch (e) {
console.log(e)
}

@ -505,11 +505,10 @@ class App {
}
}
}).catch(console.error)
} else {
// activate solidity plugin
appManager.activatePlugin(['solidity', 'udapp'])
}
})
// activate solidity plugin
appManager.activatePlugin(['solidity', 'udapp'])
// Load and start the service who manager layout and frame
const framingService = new FramingService(sidePanel, menuicons, mainview, this._components.resizeFeature)

@ -155,6 +155,7 @@ class Editor extends Plugin {
}
_switchSession (path) {
if (path === this.currentFile) return
this.triggerEvent('sessionSwitched', [])
this.currentFile = path
this.renderComponent()

@ -2,12 +2,12 @@
:root {
--blue: #28282D;
--indigo: #6610f2;
--purple: #6f42c1;
--pink: #e83e8c;
--purple: #9e77f6;
--pink: #f38abb;
--red: #823a3a;
--orange: #8a5026;
--orange: #e46b15;
--yellow: #ffc107;
--green: #366a57;
--green: #065337;
--teal: #20c997;
--cyan: #053c64;
--white: #d5d5d5;
@ -17,7 +17,7 @@
--secondary: #3d3e44;
--success: #366a57;
--info: #086CB5;
--warning: #8a5026;
--warning: #c26829;
--danger: #823a3a;
--light: #1f2020;
--dark: #1a1a1a;

@ -5,8 +5,8 @@
--pink: #e83e8c;
--red: #dc3545;
--orange: #fd7e14;
--yellow: #ffc107;
--green: #28a745;
--yellow: #cdae02;
--green: #0c8a29;
--teal: #20c997;
--cyan: #17a2b8;
--white: #fff;
@ -14,9 +14,9 @@
--gray-dark: #343a40;
--primary: #fc58a3;
--secondary: #e2f5f2;
--success: #84e5c2;
--success: #24b882;
--info: #69c7e9;
--warning: #fbdf9f;
--warning: #fabe33;
--danger: #f80b0b;
--light: #fff;
--dark: #645fb5;

@ -2,12 +2,12 @@
:root {
--blue: #007aa6;
--indigo: #6610f2;
--purple: #6f42c1;
--pink: #e83e8c;
--purple: #9e77f6;
--pink: #f38abb;
--red: #b84040;
--orange: #c97539;
--orange: #e46b15;
--yellow: #ffc107;
--green: #32ba89;
--green: #219451;
--teal: #20c997;
--cyan: #355f7d;
--white: #fff;
@ -5651,7 +5651,7 @@ button.bg-success:hover {
background-color: #27926b !important;
}
.bg-info {
background-color: #355f7d !important;
background-color: #274458 !important;
}
a.bg-info:focus,
a.bg-info:hover,

@ -1,11 +1,11 @@
:root {
--blue: #007bff;
--indigo: #6610f2;
--purple: #d145a7;
--purple: #7c47b9;
--pink: #e83e8c;
--red: #dc3545;
--orange: #fd7e14;
--yellow: #ffc107;
--yellow: #cdae02;
--green: #28a745;
--teal: #20c997;
--cyan: #17a2b8;

@ -4,8 +4,8 @@
--purple: #6f42c1;
--pink: #e83e8c;
--red: #dc3545;
--orange: #fd7e14;
--yellow: #ffc107;
--orange: #fd7e17;
--yellow: #cdae02;
--green: #28a745;
--teal: #20c997;
--cyan: #17a2b8;
@ -16,7 +16,7 @@
--secondary: #e2f5f2;
--success: #01670f;
--info: #69c7e9;
--warning: #edc464;
--warning: #f5ba30;
--danger: #E64F29;
--light: #eeede9;
--dark: #01414E;

@ -1,5 +1,6 @@
const nxWebpack = require('@nrwl/react/plugins/webpack')
const TerserPlugin = require('terser-webpack-plugin')
const CopyWebpackPlugin = require('copy-webpack-plugin')
module.exports = config => {
const nxWebpackConfig = nxWebpack(config)
@ -12,7 +13,15 @@ module.exports = config => {
net: 'empty',
module: 'empty',
child_process: 'empty'
}
},
plugins: [
...nxWebpackConfig.plugins,
new CopyWebpackPlugin({
patterns: [
{ from: '../../../node_modules/monaco-editor/dev/vs/', to: 'assets/js/monaco-editor/dev/vs' }
].filter(Boolean)
})
]
}
if (process.env.NODE_ENV === 'production') {

@ -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
@ -11,7 +12,7 @@ export const App = () => {
<div>
<SolidityCompiler api={remix} />
</div>
);
};
)
}
export default App;
export default App

@ -7,6 +7,7 @@ export const CompilerApiMixin = (Base) => class extends Base {
contractMap: {
file: string
} | Record<string, any>
compileErrors: any
compileTabLogic: CompileTabLogic
contractsDetails: Record<string, any>
@ -29,7 +30,7 @@ export const CompilerApiMixin = (Base) => class extends Base {
errorContainer: null,
contractEl: null
}
this.contractsDetails = {}
this.data = {
eventHandlers: {},
@ -54,7 +55,7 @@ export const CompilerApiMixin = (Base) => class extends Base {
if (this.data.eventHandlers.onLoadingCompiler) {
this.compiler.event.unregister('loadingCompiler', this.data.eventHandlers.onLoadingCompiler)
}
if (this.data.eventHandlers.onCompilerLoaded) {
this.compiler.event.unregister('compilerLoaded', this.data.eventHandlers.onCompilerLoaded)
}
@ -62,7 +63,7 @@ export const CompilerApiMixin = (Base) => class extends Base {
if (this.data.eventHandlers.onCompilationFinished) {
this.compiler.event.unregister('compilationFinished', this.data.eventHandlers.onCompilationFinished)
}
this.off('filePanel', 'setWorkspace')
this.off('remixd', 'rootFolderChanged')
@ -72,19 +73,19 @@ export const CompilerApiMixin = (Base) => class extends Base {
if (this.data.eventHandlers.onStartingCompilation) {
this.compileTabLogic.event.off('startingCompilation', this.data.eventHandlers.onStartingCompilation)
}
if (this.data.eventHandlers.onRemoveAnnotations) {
this.compileTabLogic.event.off('removeAnnotations', this.data.eventHandlers.onRemoveAnnotations)
}
}
this.off('fileManager', 'currentFileChanged')
this.off('fileManager', 'noFileSelected')
this.off('fileManager', 'noFileSelected')
this.off('themeModule', 'themeChanged')
if (this.data.eventHandlers.onKeyDown) {
window.document.removeEventListener('keydown', this.data.eventHandlers.onKeyDown)
window.document.removeEventListener('keydown', this.data.eventHandlers.onKeyDown)
}
}
@ -99,7 +100,7 @@ export const CompilerApiMixin = (Base) => class extends Base {
logToTerminal (content) {
return this.call('terminal', 'log', content)
}
getCompilationResult () {
return this.compileTabLogic.compiler.state.lastCompilationResult
}
@ -143,7 +144,7 @@ export const CompilerApiMixin = (Base) => class extends Base {
// This function is used for passing the compiler configuration to 'remix-tests'
getCurrentCompilerConfig () {
const compilerState = this.getCompilerState()
let compilerDetails: any = {
const compilerDetails: any = {
currentVersion: compilerState.currentVersion,
evmVersion: compilerState.evmVersion,
optimize: compilerState.optimize,
@ -162,8 +163,8 @@ export const CompilerApiMixin = (Base) => class extends Base {
* @param {object} settings {evmVersion, optimize, runs, version, language}
*/
setCompilerConfig (settings) {
this.configurationSettings = settings
}
this.configurationSettings = settings
}
fileExists (fileName) {
return this.call('fileManager', 'exists', fileName)
@ -231,7 +232,7 @@ export const CompilerApiMixin = (Base) => class extends Base {
this.on('editor', 'sessionSwitched', () => {
if (this.onSessionSwitched) this.onSessionSwitched()
})
})
this.compileTabLogic.event.on('startingCompilation', this.data.eventHandlers.onStartingCompilation)
this.compileTabLogic.event.on('removeAnnotations', this.data.eventHandlers.onRemoveAnnotations)
@ -241,13 +242,13 @@ export const CompilerApiMixin = (Base) => class extends Base {
if (this.onCurrentFileChanged) this.onCurrentFileChanged(name)
}
this.on('fileManager', 'currentFileChanged', this.data.eventHandlers.onCurrentFileChanged)
this.data.eventHandlers.onNoFileSelected = () => {
this.currentFile = ''
if (this.onNoFileSelected) this.onNoFileSelected()
}
this.on('fileManager', 'noFileSelected', this.data.eventHandlers.onNoFileSelected)
this.data.eventHandlers.onCompilationFinished = (success, data, source) => {
this.compileErrors = data
if (success) {

@ -1,5 +1,7 @@
import { PluginClient } from "@remixproject/plugin";
import { createClient } from "@remixproject/plugin-webview";
/* eslint-disable no-undef */
/* eslint-disable no-unused-vars */
import { PluginClient } from '@remixproject/plugin'
import { createClient } from '@remixproject/plugin-webview'
import { CompilerApiMixin } from './compiler-api'
import { ICompilerApi } from '@remix-project/remix-lib-ts'
import { CompileTabLogic } from '@remix-ui/solidity-compiler'
@ -14,7 +16,7 @@ const profile = {
location: 'sidePanel',
documentation: 'https://remix-ide.readthedocs.io/en/latest/solidity_editor.html',
version: '0.0.1',
methods: ['getCompilationResult', 'compile', 'compileWithParameters', 'setCompilerConfig', 'compileFile' ,'getCompilerState']
methods: ['getCompilationResult', 'compile', 'compileWithParameters', 'setCompilerConfig', 'compileFile', 'getCompilerState']
}
const defaultAppParameters = {
@ -30,7 +32,7 @@ const defaultCompilerParameters = {
evmVersion: null, // compiler default
language: 'Solidity'
}
export class CompilerClientApi extends CompilerApiMixin(PluginClient) implements ICompilerApi {
export class CompilerClientApi extends CompilerApiMixin(PluginClient) implements ICompilerApi {
constructor () {
super()
createClient(this as any)
@ -42,11 +44,11 @@ export class CompilerClientApi extends CompilerApiMixin(PluginClient) implements
getCompilerParameters () {
const params = {
runs: localStorage.getItem('runs') || defaultCompilerParameters['runs'],
optimize: localStorage.getItem('optimize') === 'true' ? true : false,
version: localStorage.getItem('version') || defaultCompilerParameters['version'],
evmVersion: localStorage.getItem('evmVersion') || defaultCompilerParameters['evmVersion'], // default
language: localStorage.getItem('language') || defaultCompilerParameters['language']
runs: localStorage.getItem('runs') || defaultCompilerParameters.runs,
optimize: localStorage.getItem('optimize') === 'true',
version: localStorage.getItem('version') || defaultCompilerParameters.version,
evmVersion: localStorage.getItem('evmVersion') || defaultCompilerParameters.evmVersion, // default
language: localStorage.getItem('language') || defaultCompilerParameters.language
}
return params
}

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

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

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

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

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

@ -1,6 +1,6 @@
{
"name": "@remix-project/remix-analyzer",
"version": "0.5.17",
"version": "0.5.18",
"description": "Tool to perform static analysis on Solidity smart contracts",
"main": "src/index.js",
"types": "src/index.d.ts",
@ -22,11 +22,12 @@
"@ethereumjs/block": "^3.5.1",
"@ethereumjs/tx": "^3.3.2",
"@ethereumjs/vm": "^5.5.3",
"@remix-project/remix-astwalker": "^0.0.38",
"@remix-project/remix-lib": "^0.5.8",
"@remix-project/remix-astwalker": "^0.0.39",
"@remix-project/remix-lib": "^0.5.9",
"async": "^2.6.2",
"ethereumjs-util": "^7.0.10",
"ethers": "^5.4.2",
"ethjs-util": "^0.1.6",
"string-similarity": "^4.0.4",
"web3": "^1.5.1"
},
@ -51,5 +52,5 @@
"typescript": "^3.7.5"
},
"typings": "src/index.d.ts",
"gitHead": "13f961dadacea374de4d79a70b1aa4acf243b18b"
"gitHead": "8c5ee47b5a7d05ebd435ff9d443b57ea439eaf78"
}

@ -1,6 +1,6 @@
{
"name": "@remix-project/remix-astwalker",
"version": "0.0.38",
"version": "0.0.39",
"description": "Tool to walk through Solidity AST",
"main": "src/index.js",
"scripts": {
@ -37,11 +37,12 @@
"@ethereumjs/block": "^3.5.1",
"@ethereumjs/tx": "^3.3.2",
"@ethereumjs/vm": "^5.5.3",
"@remix-project/remix-lib": "^0.5.8",
"@remix-project/remix-lib": "^0.5.9",
"@types/tape": "^4.2.33",
"async": "^2.6.2",
"ethereumjs-util": "^7.0.10",
"ethers": "^5.4.2",
"ethjs-util": "^0.1.6",
"nyc": "^13.3.0",
"string-similarity": "^4.0.4",
"tape": "^4.10.1",
@ -53,5 +54,5 @@
"tap-spec": "^5.0.0"
},
"typings": "src/index.d.ts",
"gitHead": "13f961dadacea374de4d79a70b1aa4acf243b18b"
"gitHead": "8c5ee47b5a7d05ebd435ff9d443b57ea439eaf78"
}

@ -1,6 +1,6 @@
{
"name": "@remix-project/remix-debug",
"version": "0.5.8",
"version": "0.5.9",
"description": "Tool to debug Ethereum transactions",
"contributors": [
{
@ -22,9 +22,9 @@
"@ethereumjs/common": "^2.5.0",
"@ethereumjs/tx": "^3.3.2",
"@ethereumjs/vm": "^5.5.3",
"@remix-project/remix-astwalker": "^0.0.38",
"@remix-project/remix-lib": "^0.5.8",
"@remix-project/remix-simulator": "^0.2.8",
"@remix-project/remix-astwalker": "^0.0.39",
"@remix-project/remix-lib": "^0.5.9",
"@remix-project/remix-simulator": "^0.2.9",
"ansi-gray": "^0.1.1",
"async": "^2.6.2",
"color-support": "^1.1.3",
@ -32,6 +32,7 @@
"deep-equal": "^1.0.1",
"ethereumjs-util": "^7.0.10",
"ethers": "^5.4.2",
"ethjs-util": "^0.1.6",
"express-ws": "^4.0.0",
"merge": "^2.1.1",
"string-similarity": "^4.0.4",
@ -67,5 +68,5 @@
},
"homepage": "https://github.com/ethereum/remix-project/tree/master/libs/remix-debug#readme",
"typings": "src/index.d.ts",
"gitHead": "13f961dadacea374de4d79a70b1aa4acf243b18b"
"gitHead": "8c5ee47b5a7d05ebd435ff9d443b57ea439eaf78"
}

@ -1,6 +1,6 @@
{
"name": "@remix-project/remix-lib",
"version": "0.5.8",
"version": "0.5.9",
"description": "Library to various Remix tools",
"contributors": [
{
@ -54,5 +54,5 @@
},
"homepage": "https://github.com/ethereum/remix-project/tree/master/libs/remix-lib#readme",
"typings": "src/index.d.ts",
"gitHead": "13f961dadacea374de4d79a70b1aa4acf243b18b"
"gitHead": "8c5ee47b5a7d05ebd435ff9d443b57ea439eaf78"
}

@ -1,6 +1,6 @@
{
"name": "@remix-project/remix-simulator",
"version": "0.2.8",
"version": "0.2.9",
"description": "Ethereum IDE and tools for the web",
"contributors": [
{
@ -18,7 +18,7 @@
"@ethereumjs/common": "^2.5.0",
"@ethereumjs/tx": "^3.3.2",
"@ethereumjs/vm": "^5.5.3",
"@remix-project/remix-lib": "^0.5.8",
"@remix-project/remix-lib": "^0.5.9",
"ansi-gray": "^0.1.1",
"async": "^3.1.0",
"body-parser": "^1.18.2",
@ -27,6 +27,7 @@
"cors": "^2.8.5",
"ethereumjs-util": "^7.0.10",
"ethers": "^5.4.2",
"ethjs-util": "^0.1.6",
"express": "^4.16.3",
"express-ws": "^4.0.0",
"merge": "^1.2.0",
@ -66,5 +67,5 @@
},
"homepage": "https://github.com/ethereum/remix-project/tree/master/libs/remix-simulator#readme",
"typings": "src/index.d.ts",
"gitHead": "13f961dadacea374de4d79a70b1aa4acf243b18b"
"gitHead": "8c5ee47b5a7d05ebd435ff9d443b57ea439eaf78"
}

@ -1,6 +1,6 @@
{
"name": "@remix-project/remix-solidity",
"version": "0.4.8",
"version": "0.4.9",
"description": "Tool to load and run Solidity compiler",
"main": "src/index.js",
"types": "src/index.d.ts",
@ -18,11 +18,12 @@
"@ethereumjs/block": "^3.5.1",
"@ethereumjs/tx": "^3.3.2",
"@ethereumjs/vm": "^5.5.3",
"@remix-project/remix-lib": "^0.5.8",
"@remix-project/remix-lib": "^0.5.9",
"async": "^2.6.2",
"eslint-scope": "^5.0.0",
"ethereumjs-util": "^7.0.10",
"ethers": "^5.4.2",
"ethjs-util": "^0.1.6",
"minixhr": "^3.2.2",
"semver": "^6.3.0",
"solc": "^0.7.4",
@ -61,5 +62,5 @@
},
"homepage": "https://github.com/ethereum/remix-project/tree/master/libs/remix-solidity#readme",
"typings": "src/index.d.ts",
"gitHead": "13f961dadacea374de4d79a70b1aa4acf243b18b"
"gitHead": "8c5ee47b5a7d05ebd435ff9d443b57ea439eaf78"
}

@ -1,6 +1,6 @@
{
"name": "@remix-project/remix-tests",
"version": "0.2.8",
"version": "0.2.9",
"description": "Tool to test Solidity smart contracts",
"main": "src/index.js",
"types": "./src/index.d.ts",
@ -39,9 +39,9 @@
"@ethereumjs/common": "^2.5.0",
"@ethereumjs/tx": "^3.3.2",
"@ethereumjs/vm": "^5.5.3",
"@remix-project/remix-lib": "^0.5.8",
"@remix-project/remix-simulator": "^0.2.8",
"@remix-project/remix-solidity": "^0.4.8",
"@remix-project/remix-lib": "^0.5.9",
"@remix-project/remix-simulator": "^0.2.9",
"@remix-project/remix-solidity": "^0.4.9",
"ansi-gray": "^0.1.1",
"async": "^2.6.0",
"axios": ">=0.21.1",
@ -51,6 +51,7 @@
"commander": "^2.13.0",
"ethereumjs-util": "^7.0.10",
"ethers": "^5.4.2",
"ethjs-util": "^0.1.6",
"express-ws": "^4.0.0",
"merge": "^1.2.0",
"signale": "^1.4.0",
@ -77,5 +78,5 @@
"typescript": "^3.3.1"
},
"typings": "src/index.d.ts",
"gitHead": "13f961dadacea374de4d79a70b1aa4acf243b18b"
"gitHead": "8c5ee47b5a7d05ebd435ff9d443b57ea439eaf78"
}

@ -9,4 +9,4 @@ module.exports = {
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'html'],
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'

@ -98,7 +98,6 @@ export const AssemblyItems = ({ registerEvent }) => {
const currentItem = codeView.children[index]
if (currentItem) {
currentItem.style.setProperty('border-color', 'var(--warning)')
currentItem.style.setProperty('border-style', 'dotted')
currentItem.setAttribute('selected', 'selected')
}

@ -1,7 +1,7 @@
import React, { useState, useRef, useEffect, useReducer } from 'react' // eslint-disable-line
import Editor from '@monaco-editor/react'
import Editor, { loader } from '@monaco-editor/react'
import { reducerActions, reducerListener, initialState } from './actions/editor'
import { language } from './syntax'
import { language, conf } from './syntax'
import './remix-ui-editor.css'
@ -44,6 +44,8 @@ type sourceMarkerMap = {
[key: string]: [sourceMarker];
}
loader.config({ paths: { vs: 'assets/js/monaco-editor/dev/vs' } })
/* eslint-disable-next-line */
export interface EditorUIProps {
activated: boolean
@ -102,8 +104,11 @@ export const EditorUI = (props: EditorUIProps) => {
const yellowColor = formatColor('--yellow')
const pinkColor = formatColor('--pink')
const locationColor = '#9e7e08'
const purpleColor = formatColor('--purple')
// const purpleColor = formatColor('--purple')
const dangerColor = formatColor('--danger')
const greenColor = formatColor('--green')
const orangeColor = formatColor('--orange')
const grayColor = formatColor('--gray')
monaco.editor.defineTheme(themeName, {
base: themeType,
@ -137,25 +142,23 @@ export const EditorUI = (props: EditorUIProps) => {
// specials
{ token: 'keyword.super', foreground: infoColor },
{ token: 'keyword.this', foreground: infoColor },
{ token: 'keyword.virtual', foreground: infoColor },
// for state variables
{ token: 'keyword.constants', foreground: warningColor },
{ token: 'keyword.override', foreground: warningColor },
{ token: 'keyword.immutable', foreground: warningColor },
{ token: 'keyword.constants', foreground: grayColor },
{ token: 'keyword.override', foreground: grayColor },
{ token: 'keyword.immutable', foreground: grayColor },
// data location
{ token: 'keyword.memory', foreground: locationColor },
{ token: 'keyword.storage', foreground: locationColor },
{ token: 'keyword.calldata', foreground: locationColor },
// // forf functions and modifiers
{ token: 'keyword.virtual', foreground: purpleColor },
// // for Events
// for Events
{ token: 'keyword.indexed', foreground: yellowColor },
{ token: 'keyword.anonymous', foreground: yellowColor },
// // for functions
// for functions
{ token: 'keyword.external', foreground: successColor },
{ token: 'keyword.internal', foreground: successColor },
{ token: 'keyword.private', foreground: successColor },
@ -172,7 +175,26 @@ export const EditorUI = (props: EditorUIProps) => {
// special functions
{ token: 'keyword.fallback', foreground: pinkColor },
{ token: 'keyword.receive', foreground: pinkColor },
{ token: 'keyword.constructor', foreground: pinkColor }
{ token: 'keyword.constructor', foreground: pinkColor },
// identifiers
{ token: 'keyword.identifier', foreground: warningColor },
{ token: 'keyword.for', foreground: warningColor },
{ token: 'keyword.break', foreground: warningColor },
{ token: 'keyword.continue', foreground: warningColor },
{ token: 'keyword.while', foreground: warningColor },
{ token: 'keyword.do', foreground: warningColor },
{ token: 'keyword.if', foreground: yellowColor },
{ token: 'keyword.else', foreground: yellowColor },
{ token: 'keyword.throw', foreground: orangeColor },
{ token: 'keyword.catch', foreground: orangeColor },
{ token: 'keyword.try', foreground: orangeColor },
// returns
{ token: 'keyword.returns', foreground: greenColor },
{ token: 'keyword.return', foreground: greenColor }
],
colors: {
@ -288,7 +310,7 @@ export const EditorUI = (props: EditorUIProps) => {
props.editorAPI.getFontSize = () => {
if (!editorRef.current) return
return editorRef.current.getOption(42).fontSize
return editorRef.current.getOption(43).fontSize
}
(window as any).addRemixBreakpoint = (position) => { // make it available from e2e testing...
@ -329,10 +351,10 @@ export const EditorUI = (props: EditorUIProps) => {
}
})
editor.addCommand(monacoRef.current.KeyMod.CtrlCmd | monacoRef.current.KeyCode.US_EQUAL, () => {
editor.updateOptions({ fontSize: editor.getOption(42).fontSize + 1 })
editor.updateOptions({ fontSize: editor.getOption(43).fontSize + 1 })
})
editor.addCommand(monacoRef.current.KeyMod.CtrlCmd | monacoRef.current.KeyCode.US_MINUS, () => {
editor.updateOptions({ fontSize: editor.getOption(42).fontSize - 1 })
editor.updateOptions({ fontSize: editor.getOption(43).fontSize - 1 })
})
}
@ -342,6 +364,7 @@ export const EditorUI = (props: EditorUIProps) => {
monacoRef.current.languages.register({ id: 'remix-solidity' })
// Register a tokens provider for the language
monacoRef.current.languages.setMonarchTokensProvider('remix-solidity', language)
monacoRef.current.languages.setLanguageConfiguration('remix-solidity', conf)
}
return (

@ -12,6 +12,7 @@ export const conf = {
],
autoClosingPairs: [
{ open: '"', close: '"', notIn: ['string', 'comment'] },
{ open: "'", close: "'", notIn: ['string', 'comment'] },
{ open: '{', close: '}', notIn: ['string', 'comment'] },
{ open: '[', close: ']', notIn: ['string', 'comment'] },
{ open: '(', close: ')', notIn: ['string', 'comment'] }
@ -1224,7 +1225,6 @@ export const language = {
'internal',
'indexed',
'anonymous',
'isOwner',
'view',
'pure',
'inherited',
@ -1269,8 +1269,6 @@ export const language = {
'if',
'else',
'for',
'else',
'for',
'while',
'do',
'break',

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

@ -223,7 +223,7 @@ export const switchToWorkspace = async (name: string) => {
} else {
const isActive = await plugin.call('manager', 'isActive', 'remixd')
if (isActive) plugin.call('manager', 'deactivatePlugin', 'remixd')
if (isActive) await plugin.call('manager', 'deactivatePlugin', 'remixd')
await plugin.fileProviders.workspace.setWorkspace(name)
plugin.setWorkspace({ name, isLocalhost: false })
dispatch(setMode('browser'))

@ -334,12 +334,12 @@ export const browserReducer = (state = browserInitialState, action: Action) => {
case 'ROOT_FOLDER_CHANGED': {
const payload = action.payload as string
return {
...state,
localhost: {
...state.localhost,
sharedFolder: payload
sharedFolder: payload,
files: {}
}
}
}

@ -23,7 +23,7 @@ export function Workspace () {
else setCurrentWorkspace(NO_WORKSPACE)
global.dispatchFetchWorkspaceDirectory(global.fs.browser.currentWorkspace)
} else if (global.fs.mode === 'localhost') {
// global.dispatchFetchWorkspaceDirectory('/')
global.dispatchFetchWorkspaceDirectory('/')
setCurrentWorkspace(LOCALHOST)
}
}, [global.fs.browser.currentWorkspace, global.fs.localhost.sharedFolder, global.fs.mode])
@ -127,6 +127,7 @@ export function Workspace () {
</label>
<span className="remixui_menu">
<span
hidden={currentWorkspace === LOCALHOST || currentWorkspace === NO_WORKSPACE}
id='workspaceCreate'
data-id='workspaceCreate'
onClick={(e) => {

@ -1,6 +1,6 @@
{
"name": "@remix-project/remix-url-resolver",
"version": "0.0.29",
"version": "0.0.30",
"description": "Solidity import url resolver engine",
"main": "src/index.js",
"types": "src/index.d.ts",
@ -41,5 +41,5 @@
"typescript": "^3.1.6"
},
"typings": "src/index.d.ts",
"gitHead": "13f961dadacea374de4d79a70b1aa4acf243b18b"
"gitHead": "8c5ee47b5a7d05ebd435ff9d443b57ea439eaf78"
}

@ -1,18 +1,18 @@
{
"name": "@remix-project/remixd",
"version": "0.5.2",
"version": "0.5.5",
"description": "remix server: allow accessing file system from remix.ethereum.org and start a dev environment (see help section)",
"main": "index.js",
"types": "./index.d.ts",
"bin": {
"remixd": "./bin/remixd.js"
"remixd": "./src/bin/remixd.js"
},
"scripts": {
"test": "echo \"Error: no test specified\"",
"start": "./bin/remixd.js",
"start": "./src/bin/remixd.js",
"npip": "npip",
"lint": "eslint ./src ./bin --ext .ts",
"build": "tsc -p ./ && chmod +x ./bin/remixd.js",
"lint": "eslint ./src --ext .ts",
"build": "tsc -p ./ && chmod +x ./src/bin/remixd.js",
"dev": "nodemon"
},
"publishConfig": {

@ -151,7 +151,7 @@ function errorHandler (error: any, service: string) {
const { data } = (await Axios.get(gistUrl)) as { data: any }
try {
await writeJSON(path.resolve(path.join(__dirname, '..', 'origins.json')), { data })
await writeJSON(path.resolve(path.join(__dirname, '../..', 'origins.json')), { data })
} catch (e) {
console.error(e)
}
@ -161,7 +161,7 @@ function errorHandler (error: any, service: string) {
} catch (e) {
try {
// eslint-disable-next-line
const origins = require('../origins.json')
const origins = require('../../origins.json')
const { data } = origins
return data.includes(origin) ? data.includes(origin) : data.includes(domain)

@ -66,7 +66,7 @@ function originIsAllowed (origin: string, self: WebSocket): boolean {
} else {
try {
// eslint-disable-next-line
const origins = require('./origins.json')
const origins = require('../origins.json')
const domain = getDomain(origin)
const { data } = origins

890
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -1,6 +1,6 @@
{
"name": "remix-project",
"version": "0.20.0-dev",
"version": "0.21.0-dev",
"license": "MIT",
"description": "Ethereum Remix Monorepo",
"keywords": [
@ -49,50 +49,53 @@
"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",
"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",
"bumpVersion:libs": "gulp & gulp syncLibVersions;",
"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/",
"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",
"minify": "uglifyjs --in-source-map inline --source-map-inline -c warnings=false",
"build:production": "NODE_ENV=production nx build remix-ide --skip-nx-cache",
"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_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_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_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_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_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_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_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.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_*.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.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_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_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_*.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_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_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.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_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_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_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_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_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.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_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_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_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_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_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.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",
"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 && chmod +x dist/libs/remixd/src/bin/remixd.js && dist/libs/remixd/src/bin/remixd.js -s ./apps/remix-ide/contracts --remix-ide http://127.0.0.1:8080",
"selenium": "selenium-standalone start",
"selenium-install": "selenium-standalone install",
"sourcemap": "exorcist --root ../ apps/remix-ide/build/app.js.map > apps/remix-ide/build/app.js",
@ -176,6 +179,7 @@
"jszip": "^3.6.0",
"latest-version": "^5.1.0",
"merge": "^2.1.1",
"monaco-editor": "^0.30.1",
"npm-install-version": "^6.0.2",
"react": "^17.0.2",
"react-beautiful-dnd": "^13.1.0",
@ -252,7 +256,6 @@
"copy-to-clipboard": "^3.3.1",
"csjs-inject": "^1.0.1",
"csslint": "^1.0.2",
"cypress": "^4.1.0",
"dotenv": "^8.2.0",
"eslint": "6.8.0",
"eslint-config-prettier": "^6.11.0",
@ -293,7 +296,7 @@
"prettier": "1.19.1",
"request": "^2.83.0",
"rimraf": "^2.6.1",
"selenium-standalone": "^7.1.0",
"selenium-standalone": "^8.0.4",
"semver": "^6.3.0",
"solc": "0.7.4",
"swarmgw": "^0.3.1",

@ -456,16 +456,6 @@
"main": "libs/remixd/src/index.ts",
"assets": ["libs/remixd/*.md", "libs/remixd/src/origins.json"]
}
},
"serve": {
"builder": "@nrwl/workspace:run-commands",
"options": {
"commands": [
{
"command": "SERVE_SCRIPT='chmod +x dist/libs/remixd/src/bin/remixd.js; dist/libs/remixd/src/bin/remixd.js '; if [ {args.folder} != undefined ]; then SERVE_SCRIPT=${SERVE_SCRIPT}' -s {args.folder}'; fi; if [ {args.remixide} != undefined ]; then SERVE_SCRIPT=${SERVE_SCRIPT}' --remix-ide {args.remixide}'; fi; eval $SERVE_SCRIPT;"
}
]
}
}
}
},

Loading…
Cancel
Save