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
a3fcd865
Commit
a3fcd865
authored
Jun 20, 2019
by
yann300
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor browser tests
parent
e96bd6b5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
29 deletions
+20
-29
compiling.js
test-browser/tests/compiling.js
+19
-28
testRecorder.js
test-browser/tests/units/testRecorder.js
+1
-1
No files found.
test-browser/tests/compiling.js
View file @
a3fcd865
...
...
@@ -11,26 +11,9 @@ module.exports = {
'@sources'
:
function
()
{
return
sources
},
'Compiling'
:
function
(
browser
)
{
runTests
(
browser
)
},
tearDown
:
sauce
}
function
runTests
(
browser
)
{
browser
.
waitForElementVisible
(
'#icon-panel'
,
10000
)
.
clickLaunchIcon
(
'solidity'
)
.
perform
(()
=>
{
// the first fn is used to pass browser to the other ones.
async
.
waterfall
([
function
(
callback
)
{
callback
(
null
,
browser
)
},
testSimpleContract
,
testReturnValues
,
testInputValues
,
testRecorder
.
test
],
function
()
{
browser
.
end
()
})
})
}
function
testSimpleContract
(
browser
,
callback
)
{
browser
.
testContracts
(
'Untitled.sol'
,
sources
[
0
][
'browser/Untitled.sol'
],
[
'TestContract'
])
'Test Simple Contract'
:
function
(
browser
)
{
browser
.
testContracts
(
'Untitled.sol'
,
sources
[
0
][
'browser/Untitled.sol'
],
[
'TestContract'
])
.
clickLaunchIcon
(
'run'
)
.
click
(
'#runTabView button[class^="instanceButton"]'
)
.
waitForElementPresent
(
'.instance:nth-of-type(2)'
)
...
...
@@ -54,11 +37,10 @@ function testSimpleContract (browser, callback) {
"3": "uint256: 4"
}`
)
.
click
(
'i[class^="clearinstance"]'
)
.
perform
(()
=>
{
callback
(
null
,
browser
)
})
}
},
function
testReturnValues
(
browser
,
callback
)
{
browser
.
testContracts
(
'returnValues.sol'
,
sources
[
1
][
'browser/returnValues.sol'
],
[
'testReturnValues'
])
'Test Return Values'
:
function
(
browser
)
{
browser
.
testContracts
(
'returnValues.sol'
,
sources
[
1
][
'browser/returnValues.sol'
],
[
'testReturnValues'
])
.
clickLaunchIcon
(
'run'
)
.
click
(
'#runTabView button[class^="instanceButton"]'
)
.
waitForElementPresent
(
'.instance:nth-of-type(2)'
)
...
...
@@ -91,11 +73,11 @@ function testReturnValues (browser, callback) {
'[vm]
\
nfrom:0xca3...a733c
\
nto:testReturnValues.retunValues3() 0x5e7...26e9f
\
nvalue:0 wei
\
ndata:0x033...e0a7d
\
nlogs:0
\
nhash:0x94c...9d28a'
,
null
,
`{
"0": "uint8: _en 2",
"1": "int256[5][]: _a1 1,-45,-78,56,60,-1,42,334,-45455,-446,1,10,-5435,45,-7"
}`
).
click
(
'i[class^="clearinstance"]'
)
.
perform
(()
=>
{
callback
(
null
,
browser
)
})
}
}`
).
click
(
'i[class^="clearinstance"]'
)
},
function
testInputValues
(
browser
,
callback
)
{
browser
.
testContracts
(
'inputValues.sol'
,
sources
[
2
][
'browser/inputValues.sol'
],
[
'test'
])
'Test Input Values'
:
function
(
browser
)
{
browser
.
testContracts
(
'inputValues.sol'
,
sources
[
2
][
'browser/inputValues.sol'
],
[
'test'
])
.
clickLaunchIcon
(
'run'
)
.
click
(
'#runTabView button[class^="instanceButton"]'
)
.
waitForElementPresent
(
'.instance:nth-of-type(2)'
)
...
...
@@ -144,7 +126,16 @@ function testInputValues (browser, callback) {
}
]`
)
.
click
(
'i[class^="clearinstance"]'
)
.
perform
(()
=>
{
callback
(
null
,
browser
)
})
.
end
()
},
'Test Recorder'
:
function
(
browser
)
{
testRecorder
.
test
(
browser
,
()
=>
{
browser
.
end
()
})
},
tearDown
:
sauce
}
// @TODO test: bytes8[3][] type as input
...
...
test-browser/tests/units/testRecorder.js
View file @
a3fcd865
'use strict'
module
.
exports
=
{
'@disabled'
:
true
,
// run by compiling.
j
'@disabled'
:
true
,
// run by compiling.
'@sources'
:
function
()
{
return
sources
},
...
...
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