|
|
|
@ -44,8 +44,9 @@ module.exports = { |
|
|
|
|
.click('*[data-id="testTabCheckAllTests"]') |
|
|
|
|
.clickElementAtPosition('.singleTestLabel', 1) |
|
|
|
|
.scrollAndClick('*[data-id="testTabRunTestsTabRunAction"]') |
|
|
|
|
.pause(15000) |
|
|
|
|
.assert.containsText('*[data-id="testTabSolidityUnitTestsOutput"]', 'browser/simple_storage_test.sol') |
|
|
|
|
.waitForElementPresent('*[data-id="testTabSolidityUnitTestsOutputheader"]', 80000) |
|
|
|
|
.pause(5000) |
|
|
|
|
.assert.containsText('*[data-id="testTabSolidityUnitTestsOutput"]', 'MyTest (browser/simple_storage_test.sol)') |
|
|
|
|
.assert.containsText('*[data-id="testTabSolidityUnitTestsOutput"]', '✓ Initial value should be100') |
|
|
|
|
.assert.containsText('*[data-id="testTabSolidityUnitTestsOutput"]', '✓ Value is set200') |
|
|
|
|
.assert.containsText('*[data-id="testTabSolidityUnitTestsOutput"]', '✘ Should fail for wrong value200') |
|
|
|
@ -63,12 +64,14 @@ module.exports = { |
|
|
|
|
.click('*[data-id="testTabCheckAllTests"]') |
|
|
|
|
.clickElementAtPosition('.singleTestLabel', 2) |
|
|
|
|
.scrollAndClick('*[data-id="testTabRunTestsTabRunAction"]') |
|
|
|
|
.pause(20000) |
|
|
|
|
.waitForElementPresent('*[data-id="testTabSolidityUnitTestsOutputheader"]', 40000) |
|
|
|
|
.pause(5000) |
|
|
|
|
.assert.containsText('*[data-id="testTabSolidityUnitTestsOutput"]', 'browser/ks2b_test.sol') |
|
|
|
|
.assert.containsText('*[data-id="testTabSolidityUnitTestsOutput"]', '✓ Check project exists') |
|
|
|
|
.assert.containsText('*[data-id="testTabSolidityUnitTestsOutput"]', '✘ Check wrong project owner') |
|
|
|
|
.assert.containsText('*[data-id="testTabSolidityUnitTestsOutput"]', '✘ Check wrong sender') |
|
|
|
|
.assert.containsText('*[data-id="testTabSolidityUnitTestsOutput"]', '✘ Check wrong value') |
|
|
|
|
.pause(5000) |
|
|
|
|
.assert.containsText('*[data-id="testTabSolidityUnitTestsOutput"]', '✓ Check project is fundable') |
|
|
|
|
.assert.containsText('*[data-id="testTabSolidityUnitTestsOutput"]', 'owner is incorrect') |
|
|
|
|
.assert.containsText('*[data-id="testTabSolidityUnitTestsOutput"]', 'wrong sender') |
|
|
|
@ -85,11 +88,11 @@ module.exports = { |
|
|
|
|
.click('*[data-id="testTabRunTestsTabStopAction"]') |
|
|
|
|
.pause(2000) |
|
|
|
|
.assert.containsText('*[data-id="testTabRunTestsTabStopAction"]', 'Stopping') |
|
|
|
|
.pause(10000) |
|
|
|
|
.waitForElementPresent('*[data-id="testTabSolidityUnitTestsOutputheader"]', 40000) |
|
|
|
|
.assert.containsText('*[data-id="testTabSolidityUnitTestsOutput"]', 'browser/ks2b_test.sol') |
|
|
|
|
.notContainsText('*[data-id="testTabSolidityUnitTestsOutput"]', 'browser/4_Ballot_test.sol') |
|
|
|
|
.notContainsText('*[data-id="testTabSolidityUnitTestsOutput"]', 'browser/simple_storage_test.sol') |
|
|
|
|
.pause(5000) |
|
|
|
|
.pause(6000) |
|
|
|
|
.assert.containsText('*[data-id="testTabTestsExecutionStopped"]', 'The test execution has been stopped') |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
@ -102,7 +105,7 @@ module.exports = { |
|
|
|
|
.click('*[data-id="testTabCheckAllTests"]') |
|
|
|
|
.clickElementAtPosition('.singleTestLabel', 3) |
|
|
|
|
.scrollAndClick('*[data-id="testTabRunTestsTabRunAction"]') |
|
|
|
|
.pause(10000) |
|
|
|
|
.waitForElementPresent('*[data-id="testTabSolidityUnitTestsOutputheader"]', 40000) |
|
|
|
|
.waitForElementPresent('*[data-id="testTabSolidityUnitTestsOutput"]') |
|
|
|
|
.assert.containsText('*[data-id="testTabSolidityUnitTestsOutput"]', 'SyntaxError: No visibility specified') |
|
|
|
|
.assert.containsText('*[data-id="testTabTestsExecutionStoppedError"]', 'The test execution has been stopped because of error(s) in your test file') |
|
|
|
@ -117,7 +120,7 @@ module.exports = { |
|
|
|
|
.click('*[data-id="testTabCheckAllTests"]') |
|
|
|
|
.clickElementAtPosition('.singleTestLabel', 4) |
|
|
|
|
.scrollAndClick('*[data-id="testTabRunTestsTabRunAction"]') |
|
|
|
|
.pause(10000) |
|
|
|
|
.waitForElementPresent('*[data-id="testTabSolidityUnitTestsOutputheader"]', 40000) |
|
|
|
|
.waitForElementPresent('*[data-id="testTabSolidityUnitTestsOutput"]') |
|
|
|
|
.assert.containsText('*[data-id="testTabSolidityUnitTestsOutput"]', 'contract deployment failed after trying twice') |
|
|
|
|
}, |
|
|
|
@ -131,7 +134,7 @@ module.exports = { |
|
|
|
|
.click('*[data-id="testTabCheckAllTests"]') |
|
|
|
|
.clickElementAtPosition('.singleTestLabel', 5) |
|
|
|
|
.scrollAndClick('*[data-id="testTabRunTestsTabRunAction"]') |
|
|
|
|
.pause(15000) |
|
|
|
|
.waitForElementPresent('*[data-id="testTabSolidityUnitTestsOutputheader"]', 40000) |
|
|
|
|
.waitForElementPresent('*[data-id="testTabSolidityUnitTestsOutput"]') |
|
|
|
|
.assert.containsText('*[data-id="testTabSolidityUnitTestsOutput"]', `Method 'add' can not have parameters inside a test contract`) |
|
|
|
|
}, |
|
|
|
@ -151,8 +154,9 @@ function runTests (browser) { |
|
|
|
|
.clickLaunchIcon('solidityUnitTesting') |
|
|
|
|
.pause(500) |
|
|
|
|
.scrollAndClick('#runTestsTabRunAction') |
|
|
|
|
.waitForElementPresent('*[data-id="testTabSolidityUnitTestsOutputheader"]', 40000) |
|
|
|
|
.pause(5000) |
|
|
|
|
.waitForElementPresent('#solidityUnittestsOutput div[class^="testPass"]') |
|
|
|
|
.pause(25000) |
|
|
|
|
.assert.containsText('#solidityUnittestsOutput', 'browser/4_Ballot_test.sol') |
|
|
|
|
.assert.containsText('#solidityUnittestsOutput', '✓ Check winning proposal') |
|
|
|
|
.assert.containsText('#solidityUnittestsOutput', '✓ Check winnin proposal with return value') |
|
|
|
|