@@ -44,8 +44,9 @@ module.exports = {
44
44
. click ( '*[data-id="testTabCheckAllTests"]' )
45
45
. clickElementAtPosition ( '.singleTestLabel' , 1 )
46
46
. scrollAndClick ( '*[data-id="testTabRunTestsTabRunAction"]' )
47
- . pause ( 15000 )
48
- . assert . containsText ( '*[data-id="testTabSolidityUnitTestsOutput"]' , 'browser/simple_storage_test.sol' )
47
+ . waitForElementPresent ( '*[data-id="testTabSolidityUnitTestsOutputheader"]' , 80000 )
48
+ . pause ( 5000 )
49
+ . assert . containsText ( '*[data-id="testTabSolidityUnitTestsOutput"]' , 'MyTest (browser/simple_storage_test.sol)' )
49
50
. assert . containsText ( '*[data-id="testTabSolidityUnitTestsOutput"]' , '✓ Initial value should be100' )
50
51
. assert . containsText ( '*[data-id="testTabSolidityUnitTestsOutput"]' , '✓ Value is set200' )
51
52
. assert . containsText ( '*[data-id="testTabSolidityUnitTestsOutput"]' , '✘ Should fail for wrong value200' )
@@ -63,12 +64,14 @@ module.exports = {
63
64
. click ( '*[data-id="testTabCheckAllTests"]' )
64
65
. clickElementAtPosition ( '.singleTestLabel' , 2 )
65
66
. scrollAndClick ( '*[data-id="testTabRunTestsTabRunAction"]' )
66
- . pause ( 20000 )
67
+ . waitForElementPresent ( '*[data-id="testTabSolidityUnitTestsOutputheader"]' , 40000 )
68
+ . pause ( 5000 )
67
69
. assert . containsText ( '*[data-id="testTabSolidityUnitTestsOutput"]' , 'browser/ks2b_test.sol' )
68
70
. assert . containsText ( '*[data-id="testTabSolidityUnitTestsOutput"]' , '✓ Check project exists' )
69
71
. assert . containsText ( '*[data-id="testTabSolidityUnitTestsOutput"]' , '✘ Check wrong project owner' )
70
72
. assert . containsText ( '*[data-id="testTabSolidityUnitTestsOutput"]' , '✘ Check wrong sender' )
71
73
. assert . containsText ( '*[data-id="testTabSolidityUnitTestsOutput"]' , '✘ Check wrong value' )
74
+ . pause ( 5000 )
72
75
. assert . containsText ( '*[data-id="testTabSolidityUnitTestsOutput"]' , '✓ Check project is fundable' )
73
76
. assert . containsText ( '*[data-id="testTabSolidityUnitTestsOutput"]' , 'owner is incorrect' )
74
77
. assert . containsText ( '*[data-id="testTabSolidityUnitTestsOutput"]' , 'wrong sender' )
@@ -85,11 +88,11 @@ module.exports = {
85
88
. click ( '*[data-id="testTabRunTestsTabStopAction"]' )
86
89
. pause ( 2000 )
87
90
. assert . containsText ( '*[data-id="testTabRunTestsTabStopAction"]' , 'Stopping' )
88
- . pause ( 10000 )
91
+ . waitForElementPresent ( '*[data-id="testTabSolidityUnitTestsOutputheader"]' , 40000 )
89
92
. assert . containsText ( '*[data-id="testTabSolidityUnitTestsOutput"]' , 'browser/ks2b_test.sol' )
90
93
. notContainsText ( '*[data-id="testTabSolidityUnitTestsOutput"]' , 'browser/4_Ballot_test.sol' )
91
94
. notContainsText ( '*[data-id="testTabSolidityUnitTestsOutput"]' , 'browser/simple_storage_test.sol' )
92
- . pause ( 5000 )
95
+ . pause ( 6000 )
93
96
. assert . containsText ( '*[data-id="testTabTestsExecutionStopped"]' , 'The test execution has been stopped' )
94
97
} ,
95
98
@@ -102,9 +105,10 @@ module.exports = {
102
105
. click ( '*[data-id="testTabCheckAllTests"]' )
103
106
. clickElementAtPosition ( '.singleTestLabel' , 3 )
104
107
. scrollAndClick ( '*[data-id="testTabRunTestsTabRunAction"]' )
105
- . pause ( 10000 )
108
+ . waitForElementPresent ( '*[data-id="testTabSolidityUnitTestsOutputheader"]' , 40000 )
106
109
. waitForElementPresent ( '*[data-id="testTabSolidityUnitTestsOutput"]' )
107
110
. assert . containsText ( '*[data-id="testTabSolidityUnitTestsOutput"]' , 'SyntaxError: No visibility specified' )
111
+ . assert . containsText ( '*[data-id="testTabTestsExecutionStoppedError"]' , 'The test execution has been stopped because of error(s) in your test file' )
108
112
} ,
109
113
110
114
'Should fail on deploy' : function ( browser ) {
@@ -116,7 +120,7 @@ module.exports = {
116
120
. click ( '*[data-id="testTabCheckAllTests"]' )
117
121
. clickElementAtPosition ( '.singleTestLabel' , 4 )
118
122
. scrollAndClick ( '*[data-id="testTabRunTestsTabRunAction"]' )
119
- . pause ( 10000 )
123
+ . waitForElementPresent ( '*[data-id="testTabSolidityUnitTestsOutputheader"]' , 40000 )
120
124
. waitForElementPresent ( '*[data-id="testTabSolidityUnitTestsOutput"]' )
121
125
. assert . containsText ( '*[data-id="testTabSolidityUnitTestsOutput"]' , 'contract deployment failed after trying twice' )
122
126
} ,
@@ -130,7 +134,7 @@ module.exports = {
130
134
. click ( '*[data-id="testTabCheckAllTests"]' )
131
135
. clickElementAtPosition ( '.singleTestLabel' , 5 )
132
136
. scrollAndClick ( '*[data-id="testTabRunTestsTabRunAction"]' )
133
- . pause ( 15000 )
137
+ . waitForElementPresent ( '*[data-id="testTabSolidityUnitTestsOutputheader"]' , 40000 )
134
138
. waitForElementPresent ( '*[data-id="testTabSolidityUnitTestsOutput"]' )
135
139
. assert . containsText ( '*[data-id="testTabSolidityUnitTestsOutput"]' , `Method 'add' can not have parameters inside a test contract` )
136
140
} ,
@@ -150,8 +154,9 @@ function runTests (browser) {
150
154
. clickLaunchIcon ( 'solidityUnitTesting' )
151
155
. pause ( 500 )
152
156
. scrollAndClick ( '#runTestsTabRunAction' )
157
+ . waitForElementPresent ( '*[data-id="testTabSolidityUnitTestsOutputheader"]' , 40000 )
158
+ . pause ( 5000 )
153
159
. waitForElementPresent ( '#solidityUnittestsOutput div[class^="testPass"]' )
154
- . pause ( 15000 )
155
160
. assert . containsText ( '#solidityUnittestsOutput' , 'browser/4_Ballot_test.sol' )
156
161
. assert . containsText ( '#solidityUnittestsOutput' , '✓ Check winning proposal' )
157
162
. assert . containsText ( '#solidityUnittestsOutput' , '✓ Check winnin proposal with return value' )
0 commit comments