Browse Source

Merge pull request #19 from ethereum/unitTesting-fix

unit testing issue fixed
pull/20/head
David Disu 2 years ago
committed by GitHub
parent
commit
a5cd99d5c1
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      apps/remix-ide/src/app/tabs/test-tab.js
  2. 30
      apps/remix-ide/test-browser/tests/solidityUnittests.test.js

3
apps/remix-ide/src/app/tabs/test-tab.js

@ -103,7 +103,8 @@ module.exports = class TestTab extends ViewPlugin {
if (eChecked) {
checkAll.checked = true
if ((this.readyTestsNumber === this.runningTestsNumber || this.hasBeenStopped) && document.getElementById('runTestsTabStopAction').innerText === 'Stop') {
const stopBtnInnerText = document.getElementById('runTestsTabStopAction').innerText
if ((this.readyTestsNumber === this.runningTestsNumber || this.hasBeenStopped) && stopBtnInnerText.trim() === 'Stop') {
runBtn.removeAttribute('disabled')
runBtn.setAttribute('title', 'Run tests')
}

30
apps/remix-ide/test-browser/tests/solidityUnittests.test.js

@ -43,8 +43,8 @@ module.exports = {
.addFile('tests/simple_storage_test.sol', sources[0]['browser/tests/simple_storage_test.sol'])
.click('*[data-id="verticalIconsKindsolidityUnitTesting"]')
.waitForElementPresent('*[data-id="testTabCheckAllTests"]')
// .click('*[data-id="testTabCheckAllTests"]') // unselecting all tests disables run button and it is not activated after single test select (remix-project bug/temp test fix)
.clickElementAtPosition('.singleTestLabel', 0)
.click('*[data-id="testTabCheckAllTests"]')
.clickElementAtPosition('.singleTestLabel', 1)
.scrollAndClick('*[data-id="testTabRunTestsTabRunAction"]')
.waitForElementPresent('*[data-id="testTabSolidityUnitTestsOutputheader"]', 80000)
.pause(5000)
@ -63,9 +63,8 @@ module.exports = {
.addFile('tests/ks2b_test.sol', sources[0]['browser/tests/ks2b_test.sol'])
.click('*[data-id="verticalIconsKindsolidityUnitTesting"]')
.waitForElementPresent('*[data-id="testTabCheckAllTests"]')
// .click('*[data-id="testTabCheckAllTests"]') // unselecting all tests disables run button and it is not activated after single test select (remix-project bug/temp test fix)
.clickElementAtPosition('.singleTestLabel', 0)
.clickElementAtPosition('.singleTestLabel', 1)
.click('*[data-id="testTabCheckAllTests"]')
.clickElementAtPosition('.singleTestLabel', 2)
.scrollAndClick('*[data-id="testTabRunTestsTabRunAction"]')
.waitForElementPresent('*[data-id="testTabSolidityUnitTestsOutputheader"]', 40000)
.pause(5000)
@ -105,10 +104,8 @@ module.exports = {
.clickLaunchIcon('fileExplorers')
.openFile('browser/tests/compilationError_test.sol')
.clickLaunchIcon('solidityUnitTesting')
// .click('*[data-id="testTabCheckAllTests"]') // unselecting all tests disables run button and it is not activated after single test select (remix-project bug/temp test fix)
.clickElementAtPosition('.singleTestLabel', 0)
.clickElementAtPosition('.singleTestLabel', 1)
.clickElementAtPosition('.singleTestLabel', 2)
.click('*[data-id="testTabCheckAllTests"]')
.clickElementAtPosition('.singleTestLabel', 3)
.scrollAndClick('*[data-id="testTabRunTestsTabRunAction"]')
.waitForElementPresent('*[data-id="testTabSolidityUnitTestsOutputheader"]', 40000)
.waitForElementPresent('*[data-id="testTabSolidityUnitTestsOutput"]')
@ -122,11 +119,8 @@ module.exports = {
.clickLaunchIcon('fileExplorers')
.openFile('browser/tests/deployError_test.sol')
.clickLaunchIcon('solidityUnitTesting')
// .click('*[data-id="testTabCheckAllTests"]') // unselecting all tests disables run button and it is not activated after single test select (remix-project bug/temp test fix)
.clickElementAtPosition('.singleTestLabel', 0)
.clickElementAtPosition('.singleTestLabel', 1)
.clickElementAtPosition('.singleTestLabel', 2)
.clickElementAtPosition('.singleTestLabel', 3)
.click('*[data-id="testTabCheckAllTests"]')
.clickElementAtPosition('.singleTestLabel', 4)
.scrollAndClick('*[data-id="testTabRunTestsTabRunAction"]')
.waitForElementPresent('*[data-id="testTabSolidityUnitTestsOutputheader"]', 40000)
.waitForElementPresent('*[data-id="testTabSolidityUnitTestsOutput"]')
@ -139,12 +133,8 @@ module.exports = {
.clickLaunchIcon('fileExplorers')
.openFile('browser/tests/methodFailure_test.sol')
.clickLaunchIcon('solidityUnitTesting')
// .click('*[data-id="testTabCheckAllTests"]')
.clickElementAtPosition('.singleTestLabel', 0)
.clickElementAtPosition('.singleTestLabel', 1)
.clickElementAtPosition('.singleTestLabel', 2)
.clickElementAtPosition('.singleTestLabel', 3)
.clickElementAtPosition('.singleTestLabel', 4)
.click('*[data-id="testTabCheckAllTests"]')
.clickElementAtPosition('.singleTestLabel', 5)
.scrollAndClick('*[data-id="testTabRunTestsTabRunAction"]')
.waitForElementPresent('*[data-id="testTabSolidityUnitTestsOutputheader"]', 40000)
.waitForElementPresent('*[data-id="testTabSolidityUnitTestsOutput"]')

Loading…
Cancel
Save