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
1bc99662
Commit
1bc99662
authored
Jul 01, 2016
by
yann300
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add tests
parent
08f19ed2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
62 additions
and
5 deletions
+62
-5
Slider.js
src/Slider.js
+3
-2
TxBrowser.js
src/TxBrowser.js
+2
-2
index.js
test-browser/index.js
+57
-1
No files found.
src/Slider.js
View file @
1bc99662
...
...
@@ -23,7 +23,8 @@ Slider.prototype.render = function () {
min=0
max=
${
this
.
max
}
value=0
onmouseup=
${
function
()
{
self
.
onMouseUp
()
}
}
onkeyup=
${
function
()
{
self
.
onChange
()
}
}
onmouseup=
${
function
()
{
self
.
onChange
()
}
}
disabled=
${
this
.
disabled
}
/>
</div>`
if
(
!
this
.
view
)
{
...
...
@@ -39,7 +40,7 @@ Slider.prototype.init = function (length) {
this
.
setValue
(
0
)
}
Slider
.
prototype
.
on
MouseUp
=
function
(
event
)
{
Slider
.
prototype
.
on
Change
=
function
(
event
)
{
var
value
=
document
.
getElementById
(
'slider'
).
value
this
.
trigger
(
'moved'
,
[
parseInt
(
value
)])
}
...
...
src/TxBrowser.js
View file @
1bc99662
...
...
@@ -108,9 +108,9 @@ TxBrowser.prototype.render = function () {
<input onkeyup=
${
function
()
{
self
.
updateBlockN
(
arguments
[
0
])
}
} type='text' placeholder=
${
'Block number (default 1000110)'
+
this
.
blockNumber
}
/>
<input id='txinput' onkeyup=
${
function
()
{
self
.
updateTxN
(
arguments
[
0
])
}
} type='text' value=
${
this
.
txNumber
}
placeholder=
${
'Transaction Number or hash (default 2) '
+
this
.
txNumber
}
/>
<button id='load' onclick=
${
function
()
{
self
.
submit
()
}
}>
Get
Load
</button>
<button onclick=
${
function
()
{
self
.
trigger
(
'unloadRequested'
)
}
}>Unload</button>
<button
id='unload'
onclick=
${
function
()
{
self
.
trigger
(
'unloadRequested'
)
}
}>Unload</button>
<div style=
${
ui
.
formatCss
(
style
.
transactionInfo
)}
>
<table>
<tbody>
...
...
test-browser/index.js
View file @
1bc99662
...
...
@@ -22,12 +22,68 @@ module.exports = {
.
assert
.
containsText
(
'#txhash'
,
'0x20ef65b8b186ca942fcccd634f37074dde49b541c27994fc7596740ef44cfd51'
)
.
assert
.
containsText
(
'#txfrom'
,
'0x00101c5bfa3fc8bad02c9f5fd65b069306251915'
)
.
assert
.
containsText
(
'#txto'
,
'0x0d3a18d64dfe4f927832ab58d6451cecc4e517c5'
)
.
click
(
'#unload'
)
.
waitForElementNotVisible
(
'#vmdebugger'
,
1000
)
.
end
()
}
},
'Stepping'
:
function
(
browser
)
{
browser
.
clearValue
(
'#txinput'
)
.
setValue
(
'#txinput'
,
'0x20ef65b8b186ca942fcccd634f37074dde49b541c27994fc7596740ef44cfd51'
)
.
click
(
'#load'
)
.
waitForElementVisible
(
'#vmdebugger'
,
1000
)
.
click
(
'#intoforward'
)
.
click
(
'#intoforward'
)
.
checkCurrentSelectedItem
(
'004 MSTORE'
)
.
click
(
'#intoforward'
)
.
click
(
'#intoback'
)
.
click
(
'#intoback'
)
.
checkCurrentSelectedItem
(
'002 PUSH 40'
)
.
click
(
'#nextcall'
)
.
checkCurrentSelectedItem
(
'181 CREATE'
)
.
click
(
'#intoforward'
)
.
click
(
'#intoforward'
)
.
click
(
'#intoforward'
)
.
click
(
'#intoforward'
)
.
click
(
'#overforward'
)
.
checkCurrentSelectedItem
(
'058 RETURN'
)
.
click
(
'#intoforward'
)
.
click
(
'#overback'
)
.
checkCurrentSelectedItem
(
'181 CREATE'
)
.
end
()
},
'Slider'
:
function
(
browser
)
{
browser
.
clearValue
(
'#txinput'
)
.
setValue
(
'#txinput'
,
'0x20ef65b8b186ca942fcccd634f37074dde49b541c27994fc7596740ef44cfd51'
)
.
click
(
'#load'
)
.
waitForElementVisible
(
'#vmdebugger'
,
1000
)
.
click
(
'#intoforward'
)
.
click
(
'#intoforward'
)
.
sendKeys
(
'#slider'
,
browser
.
Keys
.
RIGHT_ARROW
)
.
sendKeys
(
'#slider'
,
browser
.
Keys
.
RIGHT_ARROW
)
.
sendKeys
(
'#slider'
,
browser
.
Keys
.
RIGHT_ARROW
)
.
sendKeys
(
'#slider'
,
browser
.
Keys
.
RIGHT_ARROW
)
.
sendKeys
(
'#slider'
,
browser
.
Keys
.
RIGHT_ARROW
)
.
sendKeys
(
'#slider'
,
browser
.
Keys
.
RIGHT_ARROW
)
.
sendKeys
(
'#slider'
,
browser
.
Keys
.
RIGHT_ARROW
)
.
sendKeys
(
'#slider'
,
browser
.
Keys
.
RIGHT_ARROW
)
.
sendKeys
(
'#slider'
,
browser
.
Keys
.
LEFT_ARROW
)
.
checkCurrentSelectedItem
(
'041 PUSH 60fe47b1'
)
.
end
()
}
}
function
init
(
browser
,
callback
)
{
browser
.
checkCurrentSelectedItem
=
function
(
expected
)
{
browser
.
getValue
(
'#asmitems'
,
function
(
result
)
{
browser
.
assert
.
containsText
(
'#asmitems option[value="'
+
result
.
value
+
'"]'
,
expected
)
})
return
browser
}
browser
.
url
(
'http://127.0.0.1:8080'
)
injectScript
(
'./test/resources/testWeb3.js'
,
browser
,
function
()
{
...
...
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