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
f2940c0e
Commit
f2940c0e
authored
Aug 08, 2017
by
yann300
Committed by
GitHub
Aug 08, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #668 from ethereum/compileRunTab12
compile run tab -12
parents
5001dc93
188a292d
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
32 additions
and
14 deletions
+32
-14
contracts.js
test-browser/helpers/contracts.js
+19
-6
ballot.js
test-browser/tests/ballot.js
+1
-1
compiling.js
test-browser/tests/compiling.js
+9
-4
sharedFolderExplorer.js
test-browser/tests/sharedFolderExplorer.js
+1
-1
simpleContract.js
test-browser/tests/simpleContract.js
+1
-1
staticanalysis.js
test-browser/tests/staticanalysis.js
+1
-1
No files found.
test-browser/helpers/contracts.js
View file @
f2940c0e
...
@@ -6,12 +6,25 @@ module.exports = {
...
@@ -6,12 +6,25 @@ module.exports = {
}
}
function
checkCompiledContracts
(
browser
,
compiled
,
callback
)
{
function
checkCompiledContracts
(
browser
,
compiled
,
callback
)
{
browser
.
elements
(
'css selector'
,
'.udapp .title'
,
function
(
elements
)
{
browser
.
execute
(
function
()
{
elements
.
value
.
map
(
function
(
item
,
i
)
{
var
contracts
=
document
.
querySelectorAll
(
'#compileTabView select option'
)
browser
.
elementIdText
(
item
.
ELEMENT
,
function
(
text
)
{
if
(
!
contracts
)
{
browser
.
assert
.
equal
(
text
.
value
.
split
(
'
\
n'
)[
0
],
compiled
[
i
])
return
null
})
}
else
{
var
ret
=
[]
for
(
var
c
in
contracts
)
{
ret
.
push
(
contracts
[
c
].
innerText
)
}
return
ret
}
},
[],
function
(
result
)
{
if
(
!
result
.
value
)
{
browser
.
end
(
'no compiled contracts'
)
}
else
{
result
.
value
.
map
(
function
(
item
,
i
)
{
browser
.
assert
.
equal
(
item
,
compiled
[
i
])
})
})
}
callback
()
callback
()
})
})
}
}
...
@@ -21,7 +34,7 @@ function testContracts (browser, contractCode, compiledContractNames, callback)
...
@@ -21,7 +34,7 @@ function testContracts (browser, contractCode, compiledContractNames, callback)
.
clearValue
(
'#input textarea'
)
.
clearValue
(
'#input textarea'
)
.
click
(
'.newFile'
)
.
click
(
'.newFile'
)
.
setValue
(
'#input textarea'
,
contractCode
,
function
()
{})
.
setValue
(
'#input textarea'
,
contractCode
,
function
()
{})
.
waitForElementPresent
(
'
.udapp .create
'
,
50000
,
true
,
function
()
{
.
waitForElementPresent
(
'
#compileTabView select option
'
,
50000
,
true
,
function
()
{
checkCompiledContracts
(
browser
,
compiledContractNames
,
callback
)
checkCompiledContracts
(
browser
,
compiledContractNames
,
callback
)
})
})
}
}
test-browser/tests/ballot.js
View file @
f2940c0e
...
@@ -26,7 +26,7 @@ module.exports = {
...
@@ -26,7 +26,7 @@ module.exports = {
function
runTests
(
browser
,
testData
)
{
function
runTests
(
browser
,
testData
)
{
browser
browser
.
waitForElementVisible
(
'.newFile'
,
10000
)
.
waitForElementVisible
(
'.newFile'
,
10000
)
.
click
(
'.
env
View'
)
.
click
(
'.
compile
View'
)
contractHelper
.
testContracts
(
browser
,
sources
.
sources
[
'browser/Untitled.sol'
],
[
'browser/Untitled.sol:Ballot'
],
function
()
{
contractHelper
.
testContracts
(
browser
,
sources
.
sources
[
'browser/Untitled.sol'
],
[
'browser/Untitled.sol:Ballot'
],
function
()
{
browser
.
end
()
browser
.
end
()
})
})
...
...
test-browser/tests/compiling.js
View file @
f2940c0e
...
@@ -26,11 +26,15 @@ module.exports = {
...
@@ -26,11 +26,15 @@ module.exports = {
function
runTests
(
browser
)
{
function
runTests
(
browser
)
{
browser
browser
.
waitForElementVisible
(
'.newFile'
,
10000
)
.
waitForElementVisible
(
'.newFile'
,
10000
)
.
click
(
'.
env
View'
)
.
click
(
'.
compile
View'
)
contractHelper
.
testContracts
(
browser
,
sources
.
sources
[
'browser/Untitled.sol'
],
[
'browser/Untitled.sol:TestContract'
],
function
()
{
contractHelper
.
testContracts
(
browser
,
sources
.
sources
[
'browser/Untitled.sol'
],
[
'browser/Untitled.sol:TestContract'
],
function
()
{
browser
.
click
(
'.create .constructor .call'
)
browser
.
click
(
'.runView'
)
.
waitForElementPresent
(
'.instance .call[title="f"]'
)
.
click
(
'#runTabView div[class^="create"]'
)
.
click
(
'.instance .call[title="f"]'
)
.
waitForElementPresent
(
'.instance button[title="f"]'
)
.
click
(
'.instance button[title="f"]'
)
.
end
()
/*
TODO: this will be logged in the dom console
.waitForElementPresent('.output .returned')
.waitForElementPresent('.output .returned')
.assert.containsText('.output .returned', '0x0000000000000000000000000000000000000000000000000000000000000008')
.assert.containsText('.output .returned', '0x0000000000000000000000000000000000000000000000000000000000000008')
.execute(function () {
.execute(function () {
...
@@ -39,5 +43,6 @@ function runTests (browser) {
...
@@ -39,5 +43,6 @@ function runTests (browser) {
browser.assert.containsText('.output .decoded li', 'uint256: 8')
browser.assert.containsText('.output .decoded li', 'uint256: 8')
.end()
.end()
})
})
*/
})
})
}
}
test-browser/tests/sharedFolderExplorer.js
View file @
f2940c0e
...
@@ -42,7 +42,7 @@ function runTests (browser, testData) {
...
@@ -42,7 +42,7 @@ function runTests (browser, testData) {
.
assert
.
containsText
(
'[data-path="localhost/folder1/contract1.sol"]'
,
'contract1.sol'
)
.
assert
.
containsText
(
'[data-path="localhost/folder1/contract1.sol"]'
,
'contract1.sol'
)
.
assert
.
containsText
(
'[data-path="localhost/folder1/contract2.sol"]'
,
'contract2.sol'
)
.
assert
.
containsText
(
'[data-path="localhost/folder1/contract2.sol"]'
,
'contract2.sol'
)
.
click
(
'[data-path="localhost/folder1/contract2.sol"]'
)
.
click
(
'[data-path="localhost/folder1/contract2.sol"]'
)
.
waitForElementPresent
(
'
.udapp .create
'
,
50000
,
true
,
function
()
{
.
waitForElementPresent
(
'
#compileTabView select option
'
,
50000
,
true
,
function
()
{
contractHelper
.
checkCompiledContracts
(
browser
,
[
'localhost/folder1/contract2.sol:test2'
],
function
()
{
contractHelper
.
checkCompiledContracts
(
browser
,
[
'localhost/folder1/contract2.sol:test2'
],
function
()
{
browser
.
click
(
'.websocketconn'
).
end
()
browser
.
click
(
'.websocketconn'
).
end
()
})
})
...
...
test-browser/tests/simpleContract.js
View file @
f2940c0e
...
@@ -25,7 +25,7 @@ module.exports = {
...
@@ -25,7 +25,7 @@ module.exports = {
function
runTests
(
browser
)
{
function
runTests
(
browser
)
{
browser
browser
.
waitForElementVisible
(
'.newFile'
,
10000
)
.
waitForElementVisible
(
'.newFile'
,
10000
)
.
click
(
'.
env
View'
)
.
click
(
'.
compile
View'
)
contractHelper
.
testContracts
(
browser
,
sources
.
sources
[
'browser/Untitled.sol'
],
[
'browser/Untitled.sol:test1'
,
'browser/Untitled.sol:test2'
],
function
()
{
contractHelper
.
testContracts
(
browser
,
sources
.
sources
[
'browser/Untitled.sol'
],
[
'browser/Untitled.sol:test1'
,
'browser/Untitled.sol:test2'
],
function
()
{
browser
.
end
()
browser
.
end
()
})
})
...
...
test-browser/tests/staticanalysis.js
View file @
f2940c0e
...
@@ -32,7 +32,7 @@ module.exports = {
...
@@ -32,7 +32,7 @@ module.exports = {
function
runTests
(
browser
)
{
function
runTests
(
browser
)
{
browser
browser
.
waitForElementVisible
(
'.newFile'
,
10000
)
.
waitForElementVisible
(
'.newFile'
,
10000
)
.
click
(
'.
env
View'
)
.
click
(
'.
compile
View'
)
contractHelper
.
testContracts
(
browser
,
sources
.
sources
[
'browser/Untitled.sol'
],
[
'browser/Untitled.sol:TooMuchGas'
,
'browser/Untitled.sol:test1'
,
'browser/Untitled.sol:test2'
],
function
()
{
contractHelper
.
testContracts
(
browser
,
sources
.
sources
[
'browser/Untitled.sol'
],
[
'browser/Untitled.sol:TooMuchGas'
,
'browser/Untitled.sol:test1'
,
'browser/Untitled.sol:test2'
],
function
()
{
browser
browser
.
click
(
'.staticanalysisView'
)
.
click
(
'.staticanalysisView'
)
...
...
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