Assert that other tests did not run

pull/1/head
ioedeveloper 5 years ago
parent d922807a69
commit 07955c6fba
  1. 18
      test-browser/commands/notContainsText.js
  2. 7
      test-browser/tests/solidityUnittests.js

@ -0,0 +1,18 @@
const EventEmitter = require('events')
class NotContainsText extends EventEmitter {
command (cssSelector, text) {
const browser = this.api
browser.getText(cssSelector, (result) => {
if (result.value.includes(text)) return this.api.assert.fail(`${cssSelector} contains ${text}.`)
else this.api.assert.ok(`${cssSelector} does not contains ${text}.`)
})
.perform(() => {
this.emit('complete')
})
return this
}
}
module.exports = NotContainsText

@ -80,11 +80,14 @@ module.exports = {
.clickElementAtPosition('.singleTestLabel', 0)
.clickElementAtPosition('.singleTestLabel', 1)
.scrollAndClick('*[data-id="testTabRunTestsTabRunAction"]')
.pause(15000)
.pause(10000)
.click('*[data-id="testTabRunTestsTabStopAction"]')
.assert.containsText('*[data-id="testTabRunTestsTabStopAction"]', 'Stopping')
.pause(5000)
.assert.containsText('*[data-id="testTabSolidityUnitTestsOutput"]', 'browser/ks2b_test.sol (kickstarterTest)')
.assert.containsText('*[data-id="testTabSolidityUnitTestsOutput"]', 'browser/4_Ballot_test.sol (BallotTest)'))
.notContainsText('*[data-id="testTabSolidityUnitTestsOutput"]', 'browser/4_Ballot_test.sol (BallotTest)')
.notContainsText('*[data-id="testTabSolidityUnitTestsOutput"]', 'browser/simple_storage_test.sol (MyTest)')
.assert.containsText('*[data-id="testTabTestsExecutionStopped"]', 'The test execution has been stopped')
},
'Should fail on compilation': function (browser) {

Loading…
Cancel
Save