Commit a13feb3e authored by Rob Stupay's avatar Rob Stupay

update tests to include 1 for checking if the console works

parent 32ae5681
...@@ -105,6 +105,8 @@ To run the Selenium tests via Nightwatch: ...@@ -105,6 +105,8 @@ To run the Selenium tests via Nightwatch:
- npm run nightwatch_local_staticAnalysis - npm run nightwatch_local_staticAnalysis
- npm run nightwatch_local_signingMessage - npm run nightwatch_local_signingMessage
- npm run nightwatch_local_console
- npm run nightwatch_local_remixd # remixd needs to be run - npm run nightwatch_local_remixd # remixd needs to be run
......
...@@ -163,6 +163,7 @@ ...@@ -163,6 +163,7 @@
"nightwatch_local_staticAnalysis": "nightwatch ./test-browser/tests/staticanalysis.js --config nightwatch.js --env chrome ", "nightwatch_local_staticAnalysis": "nightwatch ./test-browser/tests/staticanalysis.js --config nightwatch.js --env chrome ",
"nightwatch_local_signingMessage": "nightwatch ./test-browser/tests/signingMessage.js --config nightwatch.js --env chrome ", "nightwatch_local_signingMessage": "nightwatch ./test-browser/tests/signingMessage.js --config nightwatch.js --env chrome ",
"nightwatch_local_remixd": "nightwatch ./test-browser/tests/remix.js --config nightwatch.js --env chrome ", "nightwatch_local_remixd": "nightwatch ./test-browser/tests/remix.js --config nightwatch.js --env chrome ",
"nightwatch_local_console": "nightwatch ./test-browser/tests/console.js --config nightwatch.js --env chrome ",
"onchange": "onchange build/app.js -- npm-run-all lint", "onchange": "onchange build/app.js -- npm-run-all lint",
"prepublish": "mkdirp build; npm-run-all -ls downloadsolc_root build", "prepublish": "mkdirp build; npm-run-all -ls downloadsolc_root build",
"remixd": "remixd -s ./contracts --remix-ide http://127.0.0.1:8080", "remixd": "remixd -s ./contracts --remix-ide http://127.0.0.1:8080",
......
...@@ -109,16 +109,17 @@ class Terminal extends BaseApi { ...@@ -109,16 +109,17 @@ class Terminal extends BaseApi {
render () { render () {
var self = this var self = this
if (self._view.el) return self._view.el if (self._view.el) return self._view.el
self._view.journal = yo`<div class=${css.journal}></div>` self._view.journal = yo`<div id="journal" class=${css.journal}></div>`
self._view.input = yo` self._view.input = yo`
<span class=${css.input} onload=${() => { this.focus() }} onpaste=${paste} onkeydown=${change}></span> <span class=${css.input} onload=${() => { this.focus() }} onpaste=${paste} onkeydown=${change}></span>
` `
self._view.input.setAttribute('spellcheck', 'false') self._view.input.setAttribute('spellcheck', 'false')
self._view.input.setAttribute('contenteditable', 'true') self._view.input.setAttribute('contenteditable', 'true')
self._view.input.setAttribute('id', 'terminalCliInput')
self._view.input.innerText = '\n' self._view.input.innerText = '\n'
self._view.cli = yo` self._view.cli = yo`
<div class="${css.cli}"> <div id="terminalCli" class="${css.cli}">
<span class=${css.prompt}>${'>'}</span> <span class=${css.prompt}>${'>'}</span>
${self._view.input} ${self._view.input}
</div> </div>
......
const EventEmitter = require('events')
class ExecuteScript extends EventEmitter {
command (script) {
this.api
.click('#terminalCli')
.keys(script)
.perform(() => {
this.emit('complete')
})
return this
}
}
module.exports = ExecuteScript
const EventEmitter = require('events')
class JournalLastChild extends EventEmitter {
command (val) {
this.api.assert.containsText('#journal div:last-child span.text-info', val).perform(() => {
this.emit('complete')
})
return this
}
}
module.exports = JournalLastChild
'use strict'
var init = require('../helpers/init')
var sauce = require('./sauce')
module.exports = {
before: function (browser, done) {
init(browser, done)
},
'SimpleExecutionConsole': function (browser) {
browser
.waitForElementVisible('#terminalCli', 10000)
.executeScript(['\uE01B','\uE025','\uE01B','\uE006','\uE006','\uE006'])
.waitForElementVisible('#journal div:last-child span.text-info', 10000)
.journalLastChild('2')
.end()
},
tearDown: sauce
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment