Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
baas-ide
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
guxukai
baas-ide
Commits
9c5f35ae
Commit
9c5f35ae
authored
Apr 29, 2020
by
LianaHus
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
edited test to not wait waist time
parent
668499dc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
13 deletions
+17
-13
test-tab.js
src/app/tabs/test-tab.js
+4
-4
solidityUnittests.js
test-browser/tests/solidityUnittests.js
+13
-9
No files found.
src/app/tabs/test-tab.js
View file @
9c5f35ae
...
@@ -136,14 +136,14 @@ module.exports = class TestTab extends ViewPlugin {
...
@@ -136,14 +136,14 @@ module.exports = class TestTab extends ViewPlugin {
this
.
rawFileName
=
result
.
filename
this
.
rawFileName
=
result
.
filename
this
.
runningTestFileName
=
this
.
cleanFileName
(
this
.
rawFileName
,
this
.
testSuite
)
this
.
runningTestFileName
=
this
.
cleanFileName
(
this
.
rawFileName
,
this
.
testSuite
)
this
.
outputHeader
=
yo
`
this
.
outputHeader
=
yo
`
<div id="
${
this
.
runningTestFileName
}
" class="pt-1">
<div id="
${
this
.
runningTestFileName
}
"
data-id="testTabSolidityUnitTestsOutputheader"
class="pt-1">
<span class="font-weight-bold">
${
this
.
testSuite
}
(
${
this
.
rawFileName
}
)</span>
<span class="font-weight-bold">
${
this
.
testSuite
}
(
${
this
.
rawFileName
}
)</span>
</div>
</div>
`
`
this
.
testsOutput
.
appendChild
(
this
.
outputHeader
)
this
.
testsOutput
.
appendChild
(
this
.
outputHeader
)
}
else
if
(
result
.
type
===
'testPass'
)
{
}
else
if
(
result
.
type
===
'testPass'
)
{
this
.
testsOutput
.
appendChild
(
yo
`
this
.
testsOutput
.
appendChild
(
yo
`
<div id="
${
this
.
runningTestFileName
}
" class="
${
css
.
testPass
}
${
css
.
testLog
}
text-success border-0">
<div id="
${
this
.
runningTestFileName
}
"
data-id="testTabSolidityUnitTestsOutputheader"
class="
${
css
.
testPass
}
${
css
.
testLog
}
text-success border-0">
✓
${
result
.
value
}
✓
${
result
.
value
}
</div>
</div>
`
)
`
)
...
@@ -181,7 +181,7 @@ module.exports = class TestTab extends ViewPlugin {
...
@@ -181,7 +181,7 @@ module.exports = class TestTab extends ViewPlugin {
`
`
this
.
outputHeader
&&
yo
.
update
(
this
.
outputHeader
,
yo
`
this
.
outputHeader
&&
yo
.
update
(
this
.
outputHeader
,
yo
`
<div id="
${
this
.
runningTestFileName
}
" class="pt-1">
<div id="
${
this
.
runningTestFileName
}
"
data-id="testTabSolidityUnitTestsOutputheader"
class="pt-1">
${
label
}
<span class="font-weight-bold">
${
this
.
testSuite
}
(
${
this
.
rawFileName
}
)</span>
${
label
}
<span class="font-weight-bold">
${
this
.
testSuite
}
(
${
this
.
rawFileName
}
)</span>
</div>
</div>
`
)
`
)
...
@@ -196,7 +196,7 @@ module.exports = class TestTab extends ViewPlugin {
...
@@ -196,7 +196,7 @@ module.exports = class TestTab extends ViewPlugin {
`
`
this
.
outputHeader
&&
yo
.
update
(
this
.
outputHeader
,
yo
`
this
.
outputHeader
&&
yo
.
update
(
this
.
outputHeader
,
yo
`
<div id="
${
this
.
runningTestFileName
}
" class="pt-1">
<div id="
${
this
.
runningTestFileName
}
"
data-id="testTabSolidityUnitTestsOutputheader"
class="pt-1">
${
label
}
<span class="font-weight-bold">
${
this
.
testSuite
}
(
${
this
.
rawFileName
}
)</span>
${
label
}
<span class="font-weight-bold">
${
this
.
testSuite
}
(
${
this
.
rawFileName
}
)</span>
</div>
</div>
`
)
`
)
...
...
test-browser/tests/solidityUnittests.js
View file @
9c5f35ae
...
@@ -44,8 +44,9 @@ module.exports = {
...
@@ -44,8 +44,9 @@ module.exports = {
.
click
(
'*[data-id="testTabCheckAllTests"]'
)
.
click
(
'*[data-id="testTabCheckAllTests"]'
)
.
clickElementAtPosition
(
'.singleTestLabel'
,
1
)
.
clickElementAtPosition
(
'.singleTestLabel'
,
1
)
.
scrollAndClick
(
'*[data-id="testTabRunTestsTabRunAction"]'
)
.
scrollAndClick
(
'*[data-id="testTabRunTestsTabRunAction"]'
)
.
pause
(
15000
)
.
waitForElementPresent
(
'*[data-id="testTabSolidityUnitTestsOutputheader"]'
,
80000
)
.
assert
.
containsText
(
'*[data-id="testTabSolidityUnitTestsOutput"]'
,
'browser/simple_storage_test.sol'
)
.
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"]'
,
'✓ Initial value should be100'
)
.
assert
.
containsText
(
'*[data-id="testTabSolidityUnitTestsOutput"]'
,
'✓ Value is set200'
)
.
assert
.
containsText
(
'*[data-id="testTabSolidityUnitTestsOutput"]'
,
'✓ Value is set200'
)
.
assert
.
containsText
(
'*[data-id="testTabSolidityUnitTestsOutput"]'
,
'✘ Should fail for wrong value200'
)
.
assert
.
containsText
(
'*[data-id="testTabSolidityUnitTestsOutput"]'
,
'✘ Should fail for wrong value200'
)
...
@@ -63,12 +64,14 @@ module.exports = {
...
@@ -63,12 +64,14 @@ module.exports = {
.
click
(
'*[data-id="testTabCheckAllTests"]'
)
.
click
(
'*[data-id="testTabCheckAllTests"]'
)
.
clickElementAtPosition
(
'.singleTestLabel'
,
2
)
.
clickElementAtPosition
(
'.singleTestLabel'
,
2
)
.
scrollAndClick
(
'*[data-id="testTabRunTestsTabRunAction"]'
)
.
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"]'
,
'browser/ks2b_test.sol'
)
.
assert
.
containsText
(
'*[data-id="testTabSolidityUnitTestsOutput"]'
,
'✓ Check project exists'
)
.
assert
.
containsText
(
'*[data-id="testTabSolidityUnitTestsOutput"]'
,
'✓ Check project exists'
)
.
assert
.
containsText
(
'*[data-id="testTabSolidityUnitTestsOutput"]'
,
'✘ Check wrong project owner'
)
.
assert
.
containsText
(
'*[data-id="testTabSolidityUnitTestsOutput"]'
,
'✘ Check wrong project owner'
)
.
assert
.
containsText
(
'*[data-id="testTabSolidityUnitTestsOutput"]'
,
'✘ Check wrong sender'
)
.
assert
.
containsText
(
'*[data-id="testTabSolidityUnitTestsOutput"]'
,
'✘ Check wrong sender'
)
.
assert
.
containsText
(
'*[data-id="testTabSolidityUnitTestsOutput"]'
,
'✘ Check wrong value'
)
.
assert
.
containsText
(
'*[data-id="testTabSolidityUnitTestsOutput"]'
,
'✘ Check wrong value'
)
.
pause
(
5000
)
.
assert
.
containsText
(
'*[data-id="testTabSolidityUnitTestsOutput"]'
,
'✓ Check project is fundable'
)
.
assert
.
containsText
(
'*[data-id="testTabSolidityUnitTestsOutput"]'
,
'✓ Check project is fundable'
)
.
assert
.
containsText
(
'*[data-id="testTabSolidityUnitTestsOutput"]'
,
'owner is incorrect'
)
.
assert
.
containsText
(
'*[data-id="testTabSolidityUnitTestsOutput"]'
,
'owner is incorrect'
)
.
assert
.
containsText
(
'*[data-id="testTabSolidityUnitTestsOutput"]'
,
'wrong sender'
)
.
assert
.
containsText
(
'*[data-id="testTabSolidityUnitTestsOutput"]'
,
'wrong sender'
)
...
@@ -85,11 +88,11 @@ module.exports = {
...
@@ -85,11 +88,11 @@ module.exports = {
.
click
(
'*[data-id="testTabRunTestsTabStopAction"]'
)
.
click
(
'*[data-id="testTabRunTestsTabStopAction"]'
)
.
pause
(
2000
)
.
pause
(
2000
)
.
assert
.
containsText
(
'*[data-id="testTabRunTestsTabStopAction"]'
,
'Stopping'
)
.
assert
.
containsText
(
'*[data-id="testTabRunTestsTabStopAction"]'
,
'Stopping'
)
.
pause
(
1
0000
)
.
waitForElementPresent
(
'*[data-id="testTabSolidityUnitTestsOutputheader"]'
,
4
0000
)
.
assert
.
containsText
(
'*[data-id="testTabSolidityUnitTestsOutput"]'
,
'browser/ks2b_test.sol'
)
.
assert
.
containsText
(
'*[data-id="testTabSolidityUnitTestsOutput"]'
,
'browser/ks2b_test.sol'
)
.
notContainsText
(
'*[data-id="testTabSolidityUnitTestsOutput"]'
,
'browser/4_Ballot_test.sol'
)
.
notContainsText
(
'*[data-id="testTabSolidityUnitTestsOutput"]'
,
'browser/4_Ballot_test.sol'
)
.
notContainsText
(
'*[data-id="testTabSolidityUnitTestsOutput"]'
,
'browser/simple_storage_test.sol'
)
.
notContainsText
(
'*[data-id="testTabSolidityUnitTestsOutput"]'
,
'browser/simple_storage_test.sol'
)
.
pause
(
5
000
)
.
pause
(
6
000
)
.
assert
.
containsText
(
'*[data-id="testTabTestsExecutionStopped"]'
,
'The test execution has been stopped'
)
.
assert
.
containsText
(
'*[data-id="testTabTestsExecutionStopped"]'
,
'The test execution has been stopped'
)
},
},
...
@@ -102,7 +105,7 @@ module.exports = {
...
@@ -102,7 +105,7 @@ module.exports = {
.
click
(
'*[data-id="testTabCheckAllTests"]'
)
.
click
(
'*[data-id="testTabCheckAllTests"]'
)
.
clickElementAtPosition
(
'.singleTestLabel'
,
3
)
.
clickElementAtPosition
(
'.singleTestLabel'
,
3
)
.
scrollAndClick
(
'*[data-id="testTabRunTestsTabRunAction"]'
)
.
scrollAndClick
(
'*[data-id="testTabRunTestsTabRunAction"]'
)
.
pause
(
1
0000
)
.
waitForElementPresent
(
'*[data-id="testTabSolidityUnitTestsOutputheader"]'
,
4
0000
)
.
waitForElementPresent
(
'*[data-id="testTabSolidityUnitTestsOutput"]'
)
.
waitForElementPresent
(
'*[data-id="testTabSolidityUnitTestsOutput"]'
)
.
assert
.
containsText
(
'*[data-id="testTabSolidityUnitTestsOutput"]'
,
'SyntaxError: No visibility specified'
)
.
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'
)
.
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 = {
...
@@ -117,7 +120,7 @@ module.exports = {
.
click
(
'*[data-id="testTabCheckAllTests"]'
)
.
click
(
'*[data-id="testTabCheckAllTests"]'
)
.
clickElementAtPosition
(
'.singleTestLabel'
,
4
)
.
clickElementAtPosition
(
'.singleTestLabel'
,
4
)
.
scrollAndClick
(
'*[data-id="testTabRunTestsTabRunAction"]'
)
.
scrollAndClick
(
'*[data-id="testTabRunTestsTabRunAction"]'
)
.
pause
(
1
0000
)
.
waitForElementPresent
(
'*[data-id="testTabSolidityUnitTestsOutputheader"]'
,
4
0000
)
.
waitForElementPresent
(
'*[data-id="testTabSolidityUnitTestsOutput"]'
)
.
waitForElementPresent
(
'*[data-id="testTabSolidityUnitTestsOutput"]'
)
.
assert
.
containsText
(
'*[data-id="testTabSolidityUnitTestsOutput"]'
,
'contract deployment failed after trying twice'
)
.
assert
.
containsText
(
'*[data-id="testTabSolidityUnitTestsOutput"]'
,
'contract deployment failed after trying twice'
)
},
},
...
@@ -131,7 +134,7 @@ module.exports = {
...
@@ -131,7 +134,7 @@ module.exports = {
.
click
(
'*[data-id="testTabCheckAllTests"]'
)
.
click
(
'*[data-id="testTabCheckAllTests"]'
)
.
clickElementAtPosition
(
'.singleTestLabel'
,
5
)
.
clickElementAtPosition
(
'.singleTestLabel'
,
5
)
.
scrollAndClick
(
'*[data-id="testTabRunTestsTabRunAction"]'
)
.
scrollAndClick
(
'*[data-id="testTabRunTestsTabRunAction"]'
)
.
pause
(
15
000
)
.
waitForElementPresent
(
'*[data-id="testTabSolidityUnitTestsOutputheader"]'
,
40
000
)
.
waitForElementPresent
(
'*[data-id="testTabSolidityUnitTestsOutput"]'
)
.
waitForElementPresent
(
'*[data-id="testTabSolidityUnitTestsOutput"]'
)
.
assert
.
containsText
(
'*[data-id="testTabSolidityUnitTestsOutput"]'
,
`Method 'add' can not have parameters inside a test contract`
)
.
assert
.
containsText
(
'*[data-id="testTabSolidityUnitTestsOutput"]'
,
`Method 'add' can not have parameters inside a test contract`
)
},
},
...
@@ -151,8 +154,9 @@ function runTests (browser) {
...
@@ -151,8 +154,9 @@ function runTests (browser) {
.
clickLaunchIcon
(
'solidityUnitTesting'
)
.
clickLaunchIcon
(
'solidityUnitTesting'
)
.
pause
(
500
)
.
pause
(
500
)
.
scrollAndClick
(
'#runTestsTabRunAction'
)
.
scrollAndClick
(
'#runTestsTabRunAction'
)
.
waitForElementPresent
(
'*[data-id="testTabSolidityUnitTestsOutputheader"]'
,
40000
)
.
pause
(
5000
)
.
waitForElementPresent
(
'#solidityUnittestsOutput div[class^="testPass"]'
)
.
waitForElementPresent
(
'#solidityUnittestsOutput div[class^="testPass"]'
)
.
pause
(
25000
)
.
assert
.
containsText
(
'#solidityUnittestsOutput'
,
'browser/4_Ballot_test.sol'
)
.
assert
.
containsText
(
'#solidityUnittestsOutput'
,
'browser/4_Ballot_test.sol'
)
.
assert
.
containsText
(
'#solidityUnittestsOutput'
,
'✓ Check winning proposal'
)
.
assert
.
containsText
(
'#solidityUnittestsOutput'
,
'✓ Check winning proposal'
)
.
assert
.
containsText
(
'#solidityUnittestsOutput'
,
'✓ Check winnin proposal with return value'
)
.
assert
.
containsText
(
'#solidityUnittestsOutput'
,
'✓ Check winnin proposal with return value'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment