|
|
|
@ -45,12 +45,11 @@ module.exports = { |
|
|
|
|
.clickElementAtPosition('.singleTestLabel', 1) |
|
|
|
|
.scrollAndClick('*[data-id="testTabRunTestsTabRunAction"]') |
|
|
|
|
.pause(15000) |
|
|
|
|
.assert.containsText('*[data-id="testTabSolidityUnitTestsOutput"]', 'browser/simple_storage_test.sol (MyTest)') |
|
|
|
|
.assert.containsText('*[data-id="testTabSolidityUnitTestsOutput"]', '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') |
|
|
|
|
.assert.containsText('*[data-id="testTabSolidityUnitTestsSummary"]', '1 failing') |
|
|
|
|
.assert.containsText('*[data-id="testTabSolidityUnitTestsSummary"]', '2 passing') |
|
|
|
|
.assert.containsText('*[data-id="testTabSolidityUnitTestsOutput"]', '2 passing, 1 failing') |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
'Should run advance unit test using natspec and experimental ABIEncoderV2 `ks2b_test.sol` ': function (browser) { |
|
|
|
@ -63,15 +62,15 @@ module.exports = { |
|
|
|
|
.clickElementAtPosition('.singleTestLabel', 2) |
|
|
|
|
.scrollAndClick('*[data-id="testTabRunTestsTabRunAction"]') |
|
|
|
|
.pause(20000) |
|
|
|
|
.assert.containsText('*[data-id="testTabSolidityUnitTestsOutput"]', 'browser/ks2b_test.sol (kickstarterTest)') |
|
|
|
|
.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') |
|
|
|
|
.assert.containsText('*[data-id="testTabSolidityUnitTestsOutput"]', '✓ Check project is fundable') |
|
|
|
|
.assert.containsText('*[data-id="testTabSolidityUnitTestsSummary"]', 'owner is incorrect') |
|
|
|
|
.assert.containsText('*[data-id="testTabSolidityUnitTestsSummary"]', 'wrong sender') |
|
|
|
|
.assert.containsText('*[data-id="testTabSolidityUnitTestsSummary"]', 'wrong value') |
|
|
|
|
.assert.containsText('*[data-id="testTabSolidityUnitTestsOutput"]', 'owner is incorrect') |
|
|
|
|
.assert.containsText('*[data-id="testTabSolidityUnitTestsOutput"]', 'wrong sender') |
|
|
|
|
.assert.containsText('*[data-id="testTabSolidityUnitTestsOutput"]', 'wrong value') |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
'Should stop unit tests during test execution` ': function (browser) { |
|
|
|
@ -100,8 +99,8 @@ module.exports = { |
|
|
|
|
.clickElementAtPosition('.singleTestLabel', 3) |
|
|
|
|
.scrollAndClick('*[data-id="testTabRunTestsTabRunAction"]') |
|
|
|
|
.pause(10000) |
|
|
|
|
.waitForElementPresent('*[data-id="testTabSolidityUnitTestsSummary"]') |
|
|
|
|
.assert.containsText('*[data-id="testTabSolidityUnitTestsSummary"]', 'SyntaxError: No visibility specified') |
|
|
|
|
.waitForElementPresent('*[data-id="testTabSolidityUnitTestsOutput"]') |
|
|
|
|
.assert.containsText('*[data-id="testTabSolidityUnitTestsOutput"]', 'SyntaxError: No visibility specified') |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
'Should fail on deploy': function (browser) { |
|
|
|
@ -114,8 +113,8 @@ module.exports = { |
|
|
|
|
.clickElementAtPosition('.singleTestLabel', 4) |
|
|
|
|
.scrollAndClick('*[data-id="testTabRunTestsTabRunAction"]') |
|
|
|
|
.pause(10000) |
|
|
|
|
.waitForElementPresent('*[data-id="testTabSolidityUnitTestsSummary"]') |
|
|
|
|
.assert.containsText('*[data-id="testTabSolidityUnitTestsSummary"]', 'contract deployment failed after trying twice') |
|
|
|
|
.waitForElementPresent('*[data-id="testTabSolidityUnitTestsOutput"]') |
|
|
|
|
.assert.containsText('*[data-id="testTabSolidityUnitTestsOutput"]', 'contract deployment failed after trying twice') |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
'Should fail when parameters are to method in test contract': function (browser) { |
|
|
|
@ -128,8 +127,8 @@ module.exports = { |
|
|
|
|
.clickElementAtPosition('.singleTestLabel', 5) |
|
|
|
|
.scrollAndClick('*[data-id="testTabRunTestsTabRunAction"]') |
|
|
|
|
.pause(15000) |
|
|
|
|
.waitForElementPresent('*[data-id="testTabSolidityUnitTestsSummary"]') |
|
|
|
|
.assert.containsText('*[data-id="testTabSolidityUnitTestsSummary"]', `Method 'add' can not have parameters inside a test contract`) |
|
|
|
|
.waitForElementPresent('*[data-id="testTabSolidityUnitTestsOutput"]') |
|
|
|
|
.assert.containsText('*[data-id="testTabSolidityUnitTestsOutput"]', `Method 'add' can not have parameters inside a test contract`) |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
'Solidity Unittests': function (browser) { |
|
|
|
@ -148,7 +147,7 @@ function runTests (browser) { |
|
|
|
|
.scrollAndClick('#runTestsTabRunAction') |
|
|
|
|
.waitForElementPresent('#solidityUnittestsOutput div[class^="testPass"]') |
|
|
|
|
.pause(15000) |
|
|
|
|
.assert.containsText('#solidityUnittestsOutput', 'browser/4_Ballot_test.sol (BallotTest)') |
|
|
|
|
.assert.containsText('#solidityUnittestsOutput', 'browser/4_Ballot_test.sol') |
|
|
|
|
.assert.containsText('#solidityUnittestsOutput', '✓ Check winning proposal') |
|
|
|
|
.assert.containsText('#solidityUnittestsOutput', '✓ Check winnin proposal with return value') |
|
|
|
|
.end() |
|
|
|
|