Skip to content

Commit

Permalink
Merge pull request #2112 from ethereum/refactorBrowserTests
Browse files Browse the repository at this point in the history
Remove old files & update README
  • Loading branch information
yann300 committed Jun 25, 2019
2 parents 50d23c0 + 003c2f2 commit fcff156
Show file tree
Hide file tree
Showing 29 changed files with 27 additions and 2,059 deletions.
26 changes: 15 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,18 +87,22 @@ Running unit tests via `npm test` requires at least node v7.0.0

## Browser Testing

To run the Selenium tests via Nightwatch serve the app through a local web server:
To run the Selenium tests via Nightwatch:

- Build Remix IDE and serve it: `npm run build && npm run serve` # starts web server at localhost:8080
- Make sure Selenium is installed `npm run selenium-install` # don't need to repeat
- Run a selenium server `npm run selenium-install`
- Run all the tests `npm run nightwatch_local_firefox` or `npm run nightwatch_local_chrome`
- Or run a specific test case:
- npm run nightwatch_local_ballot
- npm run nightwatch_local_libraryDeployment
- npm run nightwatch_local_solidityImport
- npm run nightwatch_local_recorder
- npm run nightwatch_local_transactionExecution
- npm run nightwatch_local_staticAnalysis
- npm run nightwatch_local_signingMessage
- npm run nightwatch_local_remixd # remixd needs to be run

`npm run serve` # starts web server at localhost:8080

Then you will need to either:

1. Have a Selenium server running locally on port 4444.
- Run: `npm run test-browser`

2. Or, install and run SauceConnect.
- Run: `sc -u <USERNAME> -k <ACCESS_KEY>` (see `.travis.yml` for values)
- Run: `npm run browser-test-sc`

## Usage as a Chrome Extension

Expand Down
8 changes: 1 addition & 7 deletions ci/browser_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,7 @@ setupRemixd

sleep 5

npm run nightwatch_remote_chrome || TEST_EXITCODE=1
# npm run nightwatch_remote_firefox || TEST_EXITCODE=1
# npm run nightwatch_remote_safari || TEST_EXITCODE=1
# npm run nightwatch_remote_ie || TEST_EXITCODE=1
# npm run nightwatch_remote_parallel || TEST_EXITCODE=1

# node ci/sauceDisconnect.js "$SAUCECONNECT_USERNAME" "$SAUCECONNECT_ACCESSKEY" "$SAUCECONNECT_JOBIDENTIFIER"
npm run nightwatch_local_chrome || TEST_EXITCODE=1

echo "$TEST_EXITCODE"
if [ "$TEST_EXITCODE" -eq 1 ]
Expand Down
39 changes: 0 additions & 39 deletions ci/browser_tests_debugger.sh

This file was deleted.

4 changes: 2 additions & 2 deletions nightwatch.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ module.exports = {
}
},

'local': {
'firefox': {
'desiredCapabilities': {
'browserName': 'chrome',
'browserName': 'firefox',
'javascriptEnabled': true,
'acceptSslCerts': true
}
Expand Down
18 changes: 8 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -152,24 +152,22 @@
"lint": "standard | notify-error",
"make-mock-compiler": "node ci/makeMockCompiler.js",
"minify": "uglifyjs --in-source-map inline --source-map-inline -c warnings=false",
"nightwatch_local": "nightwatch --config nightwatch.js --env local",
"nightwatch_local_firefox": "nightwatch --config nightwatch.js --env firefox",
"nightwatch_local_chrome": "nightwatch --config nightwatch.js --env chrome",
"nightwatch_local_ballot": "nightwatch ./test-browser/tests/ballot.js --config nightwatch.js --env local ",
"nightwatch_local_libraryDeployment": "nightwatch ./test-browser/tests/libraryDeployment.js --config nightwatch.js --env local ",
"nightwatch_local_solidityImport": "nightwatch ./test-browser/tests/solidityImport.js --config nightwatch.js --env local ",
"nightwatch_local_recorder": "nightwatch ./test-browser/tests/recorder.js --config nightwatch.js --env local ",
"nightwatch_local_transactionExecution": "nightwatch ./test-browser/tests/transactionExecution.js --config nightwatch.js --env local ",
"nightwatch_local_staticAnalysis": "nightwatch ./test-browser/tests/staticanalysis.js --config nightwatch.js --env local ",
"nightwatch_local_signingMessage": "nightwatch ./test-browser/tests/signingMessage.js --config nightwatch.js --env local ",
"nightwatch_local_sharedFolderExplorer": "nightwatch ./test-browser/tests/sharedFolderExplorer.js --config nightwatch.js --env local ",
"nightwatch_local_debugger": "nightwatch --config nightwatch_debugger.js --env local",
"nightwatch_remote_chrome": "nightwatch --config nightwatch.js --env chrome",
"nightwatch_remote_firefox": "nightwatch --config nightwatch.js --env default",
"nightwatch_remote_ie": "nightwatch --config nightwatch.js --env ie",
"nightwatch_remote_parallel": "nightwatch --config nightwatch.js --env safari,chrome,default",
"nightwatch_remote_safari": "nightwatch --config nightwatch.js --env safari",
"nightwatch_remote_debugger_parallel": "nightwatch --config nightwatch_debugger.js --env safari,chrome,default",
"nightwatch_local_remixd": "nightwatch ./test-browser/tests/remix.js --config nightwatch.js --env local ",
"onchange": "onchange build/app.js -- npm-run-all lint",
"prepublish": "mkdirp build; npm-run-all -ls downloadsolc_root build",
"remixd": "remixd -s ./contracts --remix-ide http://127.0.0.1:8080",
"selenium": "selenium-standalone start",
"selenium-install": "selenium-standalone install",
"serve": "npx http-server .",
"serve_debugger": "npx http-server src/app/debugger/remix-debugger",
"sourcemap": "exorcist --root ../ build/app.js.map > build/app.js",
"start": "npm-run-all -lpr serve watch onchange remixd",
"test": "csslint && standard && node test/index.js",
Expand Down

This file was deleted.

Binary file not shown.
Binary file not shown.

0 comments on commit fcff156

Please sign in to comment.