From 0ea9e1dda6097d25a3487ff88c9d4b8cc95238f5 Mon Sep 17 00:00:00 2001 From: LianaHus Date: Mon, 31 Aug 2020 15:44:52 +0200 Subject: [PATCH 1/6] changed the text of label --- apps/remix-ide/src/app/tabs/test-tab.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/apps/remix-ide/src/app/tabs/test-tab.js b/apps/remix-ide/src/app/tabs/test-tab.js index 3baab67bf5..a57e9af24b 100644 --- a/apps/remix-ide/src/app/tabs/test-tab.js +++ b/apps/remix-ide/src/app/tabs/test-tab.js @@ -152,7 +152,16 @@ module.exports = class TestTab extends ViewPlugin { this.testsOutput.appendChild(yo`
✘ ${result.value} - "${result.errMsg}" + Error Message: + "${result.errMsg}" + Asserttion: +
+ The value should be
+
'${result.assertMethod}'
+
(to): ${result.expected}
+
+ The result is: + ${result.returned} `) } From 089b9a76df9d1faded6e52e683ed6bba09f24e59 Mon Sep 17 00:00:00 2001 From: LianaHus Date: Thu, 3 Sep 2020 09:55:45 +0200 Subject: [PATCH 2/6] displaying expected vs received values for unit testing test case --- apps/remix-ide/src/app/tabs/test-tab.js | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/apps/remix-ide/src/app/tabs/test-tab.js b/apps/remix-ide/src/app/tabs/test-tab.js index a57e9af24b..4c84777fab 100644 --- a/apps/remix-ide/src/app/tabs/test-tab.js +++ b/apps/remix-ide/src/app/tabs/test-tab.js @@ -144,24 +144,28 @@ 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') { + 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}" Asserttion:
- The value should be
-
'${result.assertMethod}'
-
(to): ${result.expected}
+ Expected value should be +
${method}
+
${preposition} ${expected}
- The result is: - ${result.returned} + Received value: + ${result.returned} + Skipping the rest...
`) } From 575b7047290dd39c019a2b2d755ace99ff5d7c87 Mon Sep 17 00:00:00 2001 From: LianaHus Date: Thu, 3 Sep 2020 13:49:21 +0200 Subject: [PATCH 3/6] style fix on UI and test failore UI --- apps/remix-ide/src/app/tabs/test-tab.js | 38 ++++++++++++++++--------- 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/apps/remix-ide/src/app/tabs/test-tab.js b/apps/remix-ide/src/app/tabs/test-tab.js index 4c84777fab..314888bcb2 100644 --- a/apps/remix-ide/src/app/tabs/test-tab.js +++ b/apps/remix-ide/src/app/tabs/test-tab.js @@ -149,25 +149,35 @@ module.exports = class TestTab extends ViewPlugin {
`) } else if (result.type === 'testFailure') { - 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` + if (!result.assertMethod) { + this.testsOutput.appendChild(yo`
✘ ${result.value} Error Message: - "${result.errMsg}" - Asserttion: -
- Expected value should be -
${method}
-
${preposition} ${expected}
-
- Received value: - ${result.returned} - Skipping the rest... + "${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}" + Asserttion: +
+ Expected value should be +
${method}
+
${preposition} ${expected}
+
+ Received value: + ${result.returned} + Skipping the rest... +
+ `) + } } } From 45a802d9b62979728124c879ee1fee7efef37e7a Mon Sep 17 00:00:00 2001 From: LianaHus Date: Fri, 4 Sep 2020 12:07:08 +0200 Subject: [PATCH 4/6] test fix --- apps/remix-ide-e2e/src/tests/solidityUnittests.test.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/apps/remix-ide-e2e/src/tests/solidityUnittests.test.ts b/apps/remix-ide-e2e/src/tests/solidityUnittests.test.ts index e9e6cf95e7..eeb94dce93 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') From 40bb33ba8784ff00837feced9b63736d5b8466d3 Mon Sep 17 00:00:00 2001 From: LianaHus Date: Fri, 4 Sep 2020 16:13:25 +0200 Subject: [PATCH 5/6] test --- apps/remix-ide-e2e/src/tests/solidityUnittests.test.ts | 2 +- apps/remix-ide/src/app/tabs/test-tab.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/remix-ide-e2e/src/tests/solidityUnittests.test.ts b/apps/remix-ide-e2e/src/tests/solidityUnittests.test.ts index eeb94dce93..80757def5d 100644 --- a/apps/remix-ide-e2e/src/tests/solidityUnittests.test.ts +++ b/apps/remix-ide-e2e/src/tests/solidityUnittests.test.ts @@ -172,7 +172,7 @@ function runTests (browser: NightwatchBrowser) { .pause(500) .scrollAndClick('#runTestsTabRunAction') .waitForElementPresent('*[data-id="testTabSolidityUnitTestsOutputheader"]', 40000) - .waitForElementPresent('#solidityUnittestsOutput div[class^="testPass"]',7000) + .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 314888bcb2..ee7520e2d4 100644 --- a/apps/remix-ide/src/app/tabs/test-tab.js +++ b/apps/remix-ide/src/app/tabs/test-tab.js @@ -144,7 +144,7 @@ module.exports = class TestTab extends ViewPlugin { this.testsOutput.appendChild(this.outputHeader) } else if (result.type === 'testPass') { this.testsOutput.appendChild(yo` -
+
✓ ${result.value}
`) From f90233c39fd4fd236873faa60ef93549ac291ffa Mon Sep 17 00:00:00 2001 From: LianaHus Date: Mon, 7 Sep 2020 12:35:39 +0200 Subject: [PATCH 6/6] typo --- apps/remix-ide/src/app/tabs/test-tab.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/remix-ide/src/app/tabs/test-tab.js b/apps/remix-ide/src/app/tabs/test-tab.js index ee7520e2d4..43017bcb1a 100644 --- a/apps/remix-ide/src/app/tabs/test-tab.js +++ b/apps/remix-ide/src/app/tabs/test-tab.js @@ -166,7 +166,7 @@ module.exports = class TestTab extends ViewPlugin { ✘ ${result.value} Error Message: "${result.errMsg}" - Asserttion: + Assertion:
Expected value should be
${method}
@@ -174,7 +174,7 @@ module.exports = class TestTab extends ViewPlugin {
Received value: ${result.returned} - Skipping the rest... + Skipping the remaining tests of the function.
`) }