diff --git a/apps/remix-ide-e2e/src/tests/solidityUnittests.test.ts b/apps/remix-ide-e2e/src/tests/solidityUnittests.test.ts index e9e6cf95e7..80757def5d 100644 --- a/apps/remix-ide-e2e/src/tests/solidityUnittests.test.ts +++ b/apps/remix-ide-e2e/src/tests/solidityUnittests.test.ts @@ -172,8 +172,7 @@ function runTests (browser: NightwatchBrowser) { .pause(500) .scrollAndClick('#runTestsTabRunAction') .waitForElementPresent('*[data-id="testTabSolidityUnitTestsOutputheader"]', 40000) - .pause(5000) - .waitForElementPresent('#solidityUnittestsOutput div[class^="testPass"]') + .waitForElementPresent('#solidityUnittestsOutput div[class^="testPass"]', 7000) .assert.containsText('#solidityUnittestsOutput', 'browser/tests/4_Ballot_test.sol') .assert.containsText('#solidityUnittestsOutput', '✓ Check winning proposal') .assert.containsText('#solidityUnittestsOutput', '✓ Check winnin proposal with return value') diff --git a/apps/remix-ide/src/app/tabs/test-tab.js b/apps/remix-ide/src/app/tabs/test-tab.js index 3baab67bf5..43017bcb1a 100644 --- a/apps/remix-ide/src/app/tabs/test-tab.js +++ b/apps/remix-ide/src/app/tabs/test-tab.js @@ -144,17 +144,40 @@ module.exports = class TestTab extends ViewPlugin { this.testsOutput.appendChild(this.outputHeader) } else if (result.type === 'testPass') { this.testsOutput.appendChild(yo` -
+
✓ ${result.value}
`) } else if (result.type === 'testFailure') { - this.testsOutput.appendChild(yo` -
+ if (!result.assertMethod) { + this.testsOutput.appendChild(yo` +
✘ ${result.value} - "${result.errMsg}" + Error Message: + "${result.errMsg}"
`) + } else { + const preposition = result.assertMethod === 'equal' || result.assertMethod === 'notEqual' ? 'to' : '' + const method = result.assertMethod === 'ok' ? '' : result.assertMethod + const expected = result.assertMethod === 'ok' ? `'true'` : result.expected + this.testsOutput.appendChild(yo` +
+ ✘ ${result.value} + Error Message: + "${result.errMsg}" + Assertion: +
+ Expected value should be +
${method}
+
${preposition} ${expected}
+
+ Received value: + ${result.returned} + Skipping the remaining tests of the function. +
+ `) + } } }