Stop unit tests execution

pull/5370/head
ioedeveloper 5 years ago
parent a12763f1ed
commit 377bcba786
  1. 4
      src/app/tabs/test-tab.js
  2. 13
      test-browser/tests/solidityUnittests.js

@ -340,7 +340,7 @@ module.exports = class TestTab extends ViewPlugin {
updateStopAction () {
return yo`
<button id="runTestsTabStopAction" class="w-50 pl-2 ml-2 btn btn-secondary" disabled="disabled" title="Stop running tests" onclick=${() => this.stopTests()}">
<button id="runTestsTabStopAction" data-id="testTabRunTestsTabStopAction" class="w-50 pl-2 ml-2 btn btn-secondary" disabled="disabled" title="Stop running tests" onclick=${() => this.stopTests()}">
<span class="fas fa-stop ml-2"></span>
<label class="${css.labelOnBtn} btn btn-primary bg-transparent p-1 ml-2 m-0" id="runTestsTabStopActionLabel">Stop</label>
</button>
@ -390,7 +390,7 @@ module.exports = class TestTab extends ViewPlugin {
this.onActivationInternal()
this.testsOutput = yo`<div class="${css.container} mx-3 border-top border-primary" hidden='true' id="solidityUnittestsOutput" data-id="testTabSolidityUnitTestsOutput"></a>`
this.testsSummary = yo`<div class="${css.container} mx-3 pt-2 border-top border-primary" hidden='true' id="solidityUnittestsSummary" data-id="testTabSolidityUnitTestsSummary"></div>`
this.testsExecutionStopped = yo`<label class="text-warning h6">The test execution has been stopped</label>`
this.testsExecutionStopped = yo`<label class="text-warning h6" data-id="testTabTestsExecutionStopped">The test execution has been stopped</label>`
this.testsExecutionStopped.hidden = true
this.resultStatistics = this.createResultLabel()
this.resultStatistics.hidden = true

@ -74,6 +74,19 @@ module.exports = {
.assert.containsText('*[data-id="testTabSolidityUnitTestsSummary"]', 'wrong value')
},
'Should stop unit tests during test execution` ': function (browser) {
browser.waitForElementPresent('*[data-id="verticalIconsKindfileExplorers"]')
.waitForElementPresent('*[data-id="testTabRunTestsTabRunAction"]')
.clickElementAtPosition('.singleTestLabel', 0)
.clickElementAtPosition('.singleTestLabel', 1)
.scrollAndClick('*[data-id="testTabRunTestsTabRunAction"]')
.pause(15000)
.click('*[data-id="testTabRunTestsTabStopAction"]')
.assert.containsText('*[data-id="testTabRunTestsTabStopAction"]', 'Stopping')
.assert.containsText('*[data-id="testTabSolidityUnitTestsOutput"]', 'browser/ks2b_test.sol (kickstarterTest)')
.assert.containsText('*[data-id="testTabSolidityUnitTestsOutput"]', 'browser/4_Ballot_test.sol (BallotTest)'))
},
'Should fail on compilation': function (browser) {
browser.waitForElementPresent('*[data-id="verticalIconsKindfileExplorers"]')
.addFile('compilationError_test.sol', sources[0]['browser/compilationError_test.sol'])

Loading…
Cancel
Save