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
30ce6255
Commit
30ce6255
authored
Jan 21, 2019
by
yann300
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix browser tests
parent
d1ea7129
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
71 additions
and
35 deletions
+71
-35
plugin-manager-component.js
src/app/components/plugin-manager-component.js
+2
-2
swap-panel-component.js
src/app/components/swap-panel-component.js
+1
-0
compileTab.js
src/app/tabs/compileTab/compileTab.js
+3
-3
contracts.js
test-browser/helpers/contracts.js
+14
-8
init.js
test-browser/helpers/init.js
+20
-1
ballot.js
test-browser/tests/ballot.js
+7
-4
compiling.js
test-browser/tests/compiling.js
+6
-5
sharedFolderExplorer.js
test-browser/tests/sharedFolderExplorer.js
+4
-2
simpleContract.js
test-browser/tests/simpleContract.js
+8
-6
staticanalysis.js
test-browser/tests/staticanalysis.js
+4
-3
testRecorder.js
test-browser/tests/units/testRecorder.js
+2
-1
No files found.
src/app/components/plugin-manager-component.js
View file @
30ce6255
...
@@ -105,12 +105,12 @@ class PluginManagerComponent {
...
@@ -105,12 +105,12 @@ class PluginManagerComponent {
</div>`
</div>`
return
yo
`
return
yo
`
<div id=
${
item
}
class=
${
css
.
plugin
}
>
<div id=
${
item
}
title="
${
item
}
"
class=
${
css
.
plugin
}
>
<h3>
${
mod
.
profile
.
name
}
</h3>
<h3>
${
mod
.
profile
.
name
}
</h3>
${
mod
.
profile
.
description
}
${
mod
.
profile
.
description
}
${
ctrBtns
}
${
ctrBtns
}
</div>
</div>
`
`
}
}
reRender
()
{
reRender
()
{
...
...
src/app/components/swap-panel-component.js
View file @
30ce6255
...
@@ -15,6 +15,7 @@ class SwapPanelComponent {
...
@@ -15,6 +15,7 @@ class SwapPanelComponent {
showContent
(
moduleName
)
{
showContent
(
moduleName
)
{
// hiding the current view and display the `moduleName`
// hiding the current view and display the `moduleName`
if
(
moduleName
===
this
.
currentNode
)
return
if
(
this
.
contents
[
moduleName
])
{
if
(
this
.
contents
[
moduleName
])
{
this
.
contents
[
moduleName
].
style
.
display
=
'block'
this
.
contents
[
moduleName
].
style
.
display
=
'block'
if
(
this
.
currentNode
)
{
if
(
this
.
currentNode
)
{
...
...
src/app/tabs/compileTab/compileTab.js
View file @
30ce6255
...
@@ -56,8 +56,8 @@ class CompileTab {
...
@@ -56,8 +56,8 @@ class CompileTab {
(
error
,
content
,
cleanUrl
,
type
,
url
)
=>
{
(
error
,
content
,
cleanUrl
,
type
,
url
)
=>
{
if
(
error
)
return
cb
(
error
)
if
(
error
)
return
cb
(
error
)
if
(
this
.
_deps
.
fileProviders
[
type
])
{
if
(
this
.
fileProviders
[
type
])
{
this
.
_deps
.
fileProviders
[
type
].
addReadOnly
(
cleanUrl
,
content
,
url
)
this
.
fileProviders
[
type
].
addReadOnly
(
cleanUrl
,
content
,
url
)
}
}
cb
(
null
,
content
)
cb
(
null
,
content
)
})
})
...
@@ -66,7 +66,7 @@ class CompileTab {
...
@@ -66,7 +66,7 @@ class CompileTab {
importFileCb
(
url
,
filecb
)
{
importFileCb
(
url
,
filecb
)
{
if
(
url
.
indexOf
(
'/remix_tests.sol'
)
!==
-
1
)
return
filecb
(
null
,
remixTests
.
assertLibCode
)
if
(
url
.
indexOf
(
'/remix_tests.sol'
)
!==
-
1
)
return
filecb
(
null
,
remixTests
.
assertLibCode
)
var
provider
=
this
.
_deps
.
fileManager
.
fileProviderOf
(
url
)
var
provider
=
this
.
fileManager
.
fileProviderOf
(
url
)
if
(
provider
)
{
if
(
provider
)
{
if
(
provider
.
type
===
'localhost'
&&
!
provider
.
isConnected
())
{
if
(
provider
.
type
===
'localhost'
&&
!
provider
.
isConnected
())
{
return
filecb
(
`file provider
${
provider
.
type
}
not available while trying to resolve
${
url
}
`
)
return
filecb
(
`file provider
${
provider
.
type
}
not available while trying to resolve
${
url
}
`
)
...
...
test-browser/helpers/contracts.js
View file @
30ce6255
...
@@ -23,11 +23,17 @@ module.exports = {
...
@@ -23,11 +23,17 @@ module.exports = {
testEditorValue
,
testEditorValue
,
renameFile
,
renameFile
,
removeFile
,
removeFile
,
getAddressAtPosition
getAddressAtPosition
,
clickLaunchIcon
}
function
clickLaunchIcon
(
icon
)
{
this
.
click
(
'#icon-panel div[title="'
+
icon
+
'"]'
)
return
this
}
}
function
getCompiledContracts
(
browser
,
compiled
,
callback
)
{
function
getCompiledContracts
(
browser
,
compiled
,
callback
)
{
browser
.
execute
(
function
()
{
browser
.
clickLaunchIcon
(
'solidity'
).
execute
(
function
()
{
var
contracts
=
document
.
querySelectorAll
(
'#compileTabView select option'
)
var
contracts
=
document
.
querySelectorAll
(
'#compileTabView select option'
)
if
(
!
contracts
)
{
if
(
!
contracts
)
{
return
null
return
null
...
@@ -44,14 +50,14 @@ function getCompiledContracts (browser, compiled, callback) {
...
@@ -44,14 +50,14 @@ function getCompiledContracts (browser, compiled, callback) {
}
}
function
selectContract
(
browser
,
contractName
,
callback
)
{
function
selectContract
(
browser
,
contractName
,
callback
)
{
browser
.
click
(
'.runView
'
)
browser
.
click
LaunchIcon
(
'settings'
).
clickLaunchIcon
(
'run transactions
'
)
.
setValue
(
'#runTabView select[class^="contractNames"]'
,
contractName
).
perform
(()
=>
{
.
setValue
(
'#runTabView select[class^="contractNames"]'
,
contractName
).
perform
(()
=>
{
callback
()
callback
()
})
})
}
}
function
createContract
(
browser
,
inputParams
,
callback
)
{
function
createContract
(
browser
,
inputParams
,
callback
)
{
browser
.
click
(
'.runView
'
)
browser
.
click
LaunchIcon
(
'settings'
).
clickLaunchIcon
(
'run transactions
'
)
.
setValue
(
'div[class^="contractActionsContainerSingle"] input'
,
inputParams
,
function
()
{
.
setValue
(
'div[class^="contractActionsContainerSingle"] input'
,
inputParams
,
function
()
{
browser
.
click
(
'#runTabView button[class^="instanceButton"]'
).
pause
(
500
).
perform
(
function
()
{
callback
()
})
browser
.
click
(
'#runTabView button[class^="instanceButton"]'
).
pause
(
500
).
perform
(
function
()
{
callback
()
})
})
})
...
@@ -79,7 +85,7 @@ function verifyContract (browser, compiledContractNames, callback) {
...
@@ -79,7 +85,7 @@ function verifyContract (browser, compiledContractNames, callback) {
function
testContracts
(
browser
,
fileName
,
contractCode
,
compiledContractNames
,
callback
)
{
function
testContracts
(
browser
,
fileName
,
contractCode
,
compiledContractNames
,
callback
)
{
browser
browser
.
click
(
'.compileView
'
)
.
click
LaunchIcon
(
'solidity
'
)
.
clearValue
(
'#input textarea'
)
.
clearValue
(
'#input textarea'
)
.
perform
((
client
,
done
)
=>
{
.
perform
((
client
,
done
)
=>
{
addFile
(
browser
,
fileName
,
contractCode
,
done
)
addFile
(
browser
,
fileName
,
contractCode
,
done
)
...
@@ -211,7 +217,7 @@ function setEditorValue (value, callback) {
...
@@ -211,7 +217,7 @@ function setEditorValue (value, callback) {
}
}
function
addInstance
(
browser
,
address
,
isValidFormat
,
isValidChecksum
,
callback
)
{
function
addInstance
(
browser
,
address
,
isValidFormat
,
isValidChecksum
,
callback
)
{
browser
.
clearValue
(
'.ataddressinput'
).
setValue
(
'.ataddressinput'
,
address
,
function
()
{
browser
.
cl
ickLaunchIcon
(
'run transactions'
).
cl
earValue
(
'.ataddressinput'
).
setValue
(
'.ataddressinput'
,
address
,
function
()
{
browser
.
click
(
'div[class^="atAddress"]'
)
browser
.
click
(
'div[class^="atAddress"]'
)
.
execute
(
function
()
{
.
execute
(
function
()
{
var
ret
=
document
.
querySelector
(
'div[class^="modalBody"] div'
).
innerHTML
var
ret
=
document
.
querySelector
(
'div[class^="modalBody"] div'
).
innerHTML
...
@@ -259,7 +265,7 @@ function modalFooterOKClick () {
...
@@ -259,7 +265,7 @@ function modalFooterOKClick () {
}
}
function
addFile
(
browser
,
name
,
content
,
done
)
{
function
addFile
(
browser
,
name
,
content
,
done
)
{
browser
.
click
(
'.newFile'
)
browser
.
click
LaunchIcon
(
'run transactions'
).
clickLaunchIcon
(
'file explorers'
).
click
(
'.newFile'
)
.
perform
((
client
,
done
)
=>
{
.
perform
((
client
,
done
)
=>
{
browser
.
execute
(
function
(
fileName
)
{
browser
.
execute
(
function
(
fileName
)
{
if
(
fileName
!==
'Untitled.sol'
)
{
if
(
fileName
!==
'Untitled.sol'
)
{
...
@@ -366,7 +372,7 @@ function useFilter (browser, filter, test, done) {
...
@@ -366,7 +372,7 @@ function useFilter (browser, filter, test, done) {
}
}
function
switchFile
(
browser
,
name
,
done
)
{
function
switchFile
(
browser
,
name
,
done
)
{
browser
browser
.
clickLaunchIcon
(
'settings'
).
clickLaunchIcon
(
'file explorers'
)
.
click
(
'li[key="'
+
name
+
'"]'
)
.
click
(
'li[key="'
+
name
+
'"]'
)
.
pause
(
2000
)
.
pause
(
2000
)
.
perform
(()
=>
{
.
perform
(()
=>
{
...
...
test-browser/helpers/init.js
View file @
30ce6255
var
helpers
=
require
(
'./contracts'
)
module
.
exports
=
function
(
browser
,
callback
)
{
module
.
exports
=
function
(
browser
,
callback
)
{
browser
.
clickLaunchIcon
=
helpers
.
clickLaunchIcon
browser
browser
.
url
(
'http://127.0.0.1:8080/#version=builtin'
)
.
url
(
'http://127.0.0.1:8080/#version=builtin'
)
.
injectScript
(
'test-browser/helpers/applytestmode.js'
,
function
()
{
.
injectScript
(
'test-browser/helpers/applytestmode.js'
,
function
()
{
browser
.
resizeWindow
(
2560
,
1440
,
()
=>
{
browser
.
resizeWindow
(
2560
,
1440
,
()
=>
{
browser
.
click
(
'#autoCompile'
)
initModules
(
browser
,
()
=>
{
browser
.
clickLaunchIcon
(
'solidity'
).
click
(
'#autoCompile'
)
.
perform
(
function
()
{
.
perform
(
function
()
{
callback
()
callback
()
})
})
})
})
})
})
})
}
}
function
initModules
(
browser
,
callback
)
{
browser
.
click
(
'#icon-panel div[title="plugin manager"]'
)
.
execute
(
function
()
{
document
.
querySelector
(
'div[title="plugin manager"]'
).
scrollTop
=
document
.
querySelector
(
'div[title="plugin manager"]'
).
scrollHeight
},
[],
function
()
{
browser
.
click
(
'#pluginManager div[title="solidity"] button'
)
.
click
(
'#pluginManager div[title="run transactions"] button'
)
.
click
(
'#pluginManager div[title="solidity static analysis"] button'
)
.
click
(
'#pluginManager div[title="debugger"] button'
)
.
click
(
'#icon-panel div[title="file explorers"]'
)
.
perform
(()
=>
{
callback
()
})
})
}
test-browser/tests/ballot.js
View file @
30ce6255
...
@@ -26,14 +26,15 @@ function runTests (browser, testData) {
...
@@ -26,14 +26,15 @@ function runTests (browser, testData) {
browser
.
clickFunction
=
contractHelper
.
clickFunction
browser
.
clickFunction
=
contractHelper
.
clickFunction
browser
.
modalFooterOKClick
=
contractHelper
.
modalFooterOKClick
browser
.
modalFooterOKClick
=
contractHelper
.
modalFooterOKClick
browser
.
setEditorValue
=
contractHelper
.
setEditorValue
browser
.
setEditorValue
=
contractHelper
.
setEditorValue
browser
.
clickLaunchIcon
=
contractHelper
.
clickLaunchIcon
browser
browser
.
waitForElementVisible
(
'
.newFile
'
,
10000
)
.
waitForElementVisible
(
'
#icon-panel
'
,
10000
)
.
click
(
'.compileView
'
)
.
click
LaunchIcon
(
'solidity
'
)
.
perform
((
client
,
done
)
=>
{
.
perform
((
client
,
done
)
=>
{
contractHelper
.
testContracts
(
browser
,
'Untitled.sol'
,
sources
[
0
][
'browser/Untitled.sol'
],
[
'Ballot'
],
function
()
{
contractHelper
.
testContracts
(
browser
,
'Untitled.sol'
,
sources
[
0
][
'browser/Untitled.sol'
],
[
'Ballot'
],
function
()
{
done
()
done
()
})
})
}).
click
(
'.runView
'
)
}).
click
LaunchIcon
(
'run transactions
'
)
.
setValue
(
'input[placeholder="uint8 _numProposals"]'
,
'1'
)
.
setValue
(
'input[placeholder="uint8 _numProposals"]'
,
'1'
)
.
click
(
'#runTabView button[class^="instanceButton"]'
)
.
click
(
'#runTabView button[class^="instanceButton"]'
)
.
waitForElementPresent
(
'.instance:nth-of-type(2)'
)
.
waitForElementPresent
(
'.instance:nth-of-type(2)'
)
...
@@ -44,6 +45,7 @@ function runTests (browser, testData) {
...
@@ -44,6 +45,7 @@ function runTests (browser, testData) {
.
pause
(
500
)
.
pause
(
500
)
.
click
(
'span#tx0x0571a2439ea58bd349dd130afb8aff62a33af14c06de0dbc3928519bdf13ce2e div[class^="debug"]'
)
.
click
(
'span#tx0x0571a2439ea58bd349dd130afb8aff62a33af14c06de0dbc3928519bdf13ce2e div[class^="debug"]'
)
.
pause
(
2000
)
.
pause
(
2000
)
.
clickLaunchIcon
(
'debugger'
)
.
click
(
'#jumppreviousbreakpoint'
)
.
click
(
'#jumppreviousbreakpoint'
)
.
pause
(
2000
)
.
pause
(
2000
)
.
perform
(
function
(
client
,
done
)
{
.
perform
(
function
(
client
,
done
)
{
...
@@ -63,7 +65,7 @@ function runTests (browser, testData) {
...
@@ -63,7 +65,7 @@ function runTests (browser, testData) {
done
()
done
()
})
})
})
})
.
click
(
'.runView
'
)
.
click
LaunchIcon
(
'run transactions
'
)
.
click
(
'div[class^="udappClose"]'
)
.
click
(
'div[class^="udappClose"]'
)
.
perform
((
client
,
done
)
=>
{
.
perform
((
client
,
done
)
=>
{
console
.
log
(
'ballot.abi'
)
console
.
log
(
'ballot.abi'
)
...
@@ -77,6 +79,7 @@ function runTests (browser, testData) {
...
@@ -77,6 +79,7 @@ function runTests (browser, testData) {
done
()
done
()
})
})
})
})
.
clickLaunchIcon
(
'file explorers'
)
.
perform
((
client
,
done
)
=>
{
.
perform
((
client
,
done
)
=>
{
console
.
log
(
'addInstance 0x692a70D2e424a56D2C6C27aA97D1a86395877b3A'
)
console
.
log
(
'addInstance 0x692a70D2e424a56D2C6C27aA97D1a86395877b3A'
)
contractHelper
.
addInstance
(
browser
,
'0x692a70D2e424a56D2C6C27aA97D1a86395877b3A'
,
true
,
true
,
()
=>
{
contractHelper
.
addInstance
(
browser
,
'0x692a70D2e424a56D2C6C27aA97D1a86395877b3A'
,
true
,
true
,
()
=>
{
...
...
test-browser/tests/compiling.js
View file @
30ce6255
...
@@ -24,9 +24,10 @@ function runTests (browser) {
...
@@ -24,9 +24,10 @@ function runTests (browser) {
browser
.
setEditorValue
=
contractHelper
.
setEditorValue
browser
.
setEditorValue
=
contractHelper
.
setEditorValue
browser
.
modalFooterOKClick
=
contractHelper
.
modalFooterOKClick
browser
.
modalFooterOKClick
=
contractHelper
.
modalFooterOKClick
browser
.
getEditorValue
=
contractHelper
.
getEditorValue
browser
.
getEditorValue
=
contractHelper
.
getEditorValue
browser
.
clickLaunchIcon
=
contractHelper
.
clickLaunchIcon
browser
browser
.
waitForElementVisible
(
'
.newFile
'
,
10000
)
.
waitForElementVisible
(
'
#icon-panel
'
,
10000
)
.
click
(
'.compileView
'
)
.
click
LaunchIcon
(
'solidity
'
)
.
perform
(()
=>
{
.
perform
(()
=>
{
// the first fn is used to pass browser to the other ones.
// 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
()
{
async
.
waterfall
([
function
(
callback
)
{
callback
(
null
,
browser
)
},
testSimpleContract
,
testReturnValues
,
testInputValues
,
testRecorder
.
test
],
function
()
{
...
@@ -37,7 +38,7 @@ function runTests (browser) {
...
@@ -37,7 +38,7 @@ function runTests (browser) {
function
testSimpleContract
(
browser
,
callback
)
{
function
testSimpleContract
(
browser
,
callback
)
{
contractHelper
.
testContracts
(
browser
,
'Untitled.sol'
,
sources
[
0
][
'browser/Untitled.sol'
],
[
'TestContract'
],
function
()
{
contractHelper
.
testContracts
(
browser
,
'Untitled.sol'
,
sources
[
0
][
'browser/Untitled.sol'
],
[
'TestContract'
],
function
()
{
browser
.
click
(
'.runView
'
)
browser
.
click
LaunchIcon
(
'run transactions
'
)
.
click
(
'#runTabView button[class^="instanceButton"]'
)
.
click
(
'#runTabView button[class^="instanceButton"]'
)
.
waitForElementPresent
(
'.instance:nth-of-type(2)'
)
.
waitForElementPresent
(
'.instance:nth-of-type(2)'
)
.
click
(
'.instance:nth-of-type(2)'
)
.
click
(
'.instance:nth-of-type(2)'
)
...
@@ -68,7 +69,7 @@ function testSimpleContract (browser, callback) {
...
@@ -68,7 +69,7 @@ function testSimpleContract (browser, callback) {
function
testReturnValues
(
browser
,
callback
)
{
function
testReturnValues
(
browser
,
callback
)
{
contractHelper
.
testContracts
(
browser
,
'returnValues.sol'
,
sources
[
1
][
'browser/returnValues.sol'
],
[
'testReturnValues'
],
function
()
{
contractHelper
.
testContracts
(
browser
,
'returnValues.sol'
,
sources
[
1
][
'browser/returnValues.sol'
],
[
'testReturnValues'
],
function
()
{
browser
.
click
(
'.runView
'
)
browser
.
click
LaunchIcon
(
'run transactions
'
)
.
click
(
'#runTabView button[class^="instanceButton"]'
)
.
click
(
'#runTabView button[class^="instanceButton"]'
)
.
waitForElementPresent
(
'.instance:nth-of-type(2)'
)
.
waitForElementPresent
(
'.instance:nth-of-type(2)'
)
.
click
(
'.instance:nth-of-type(2)'
)
.
click
(
'.instance:nth-of-type(2)'
)
...
@@ -106,7 +107,7 @@ function testReturnValues (browser, callback) {
...
@@ -106,7 +107,7 @@ function testReturnValues (browser, callback) {
function
testInputValues
(
browser
,
callback
)
{
function
testInputValues
(
browser
,
callback
)
{
contractHelper
.
testContracts
(
browser
,
'inputValues.sol'
,
sources
[
2
][
'browser/inputValues.sol'
],
[
'test'
],
function
()
{
contractHelper
.
testContracts
(
browser
,
'inputValues.sol'
,
sources
[
2
][
'browser/inputValues.sol'
],
[
'test'
],
function
()
{
browser
.
click
(
'.runView
'
)
browser
.
click
LaunchIcon
(
'run transactions
'
)
.
click
(
'#runTabView button[class^="instanceButton"]'
)
.
click
(
'#runTabView button[class^="instanceButton"]'
)
.
waitForElementPresent
(
'.instance:nth-of-type(2)'
)
.
waitForElementPresent
(
'.instance:nth-of-type(2)'
)
.
click
(
'.instance:nth-of-type(2)'
)
.
click
(
'.instance:nth-of-type(2)'
)
...
...
test-browser/tests/sharedFolderExplorer.js
View file @
30ce6255
...
@@ -52,6 +52,7 @@ function runTests (browser, testData) {
...
@@ -52,6 +52,7 @@ function runTests (browser, testData) {
browser
.
modalFooterOKClick
=
contractHelper
.
modalFooterOKClick
browser
.
modalFooterOKClick
=
contractHelper
.
modalFooterOKClick
browser
.
getEditorValue
=
contractHelper
.
getEditorValue
browser
.
getEditorValue
=
contractHelper
.
getEditorValue
browser
.
testEditorValue
=
contractHelper
.
testEditorValue
browser
.
testEditorValue
=
contractHelper
.
testEditorValue
browser
.
clickLaunchIcon
=
contractHelper
.
clickLaunchIcon
var
browserName
=
browser
.
options
.
desiredCapabilities
.
browserName
var
browserName
=
browser
.
options
.
desiredCapabilities
.
browserName
if
(
browserName
===
'safari'
||
browserName
===
'internet explorer'
)
{
if
(
browserName
===
'safari'
||
browserName
===
'internet explorer'
)
{
console
.
log
(
'do not run remixd test for '
+
browserName
+
': sauce labs doesn
\'
t seems to handle websocket'
)
console
.
log
(
'do not run remixd test for '
+
browserName
+
': sauce labs doesn
\'
t seems to handle websocket'
)
...
@@ -64,7 +65,8 @@ function runTests (browser, testData) {
...
@@ -64,7 +65,8 @@ function runTests (browser, testData) {
return
return
}
}
browser
browser
.
waitForElementVisible
(
'.newFile'
,
10000
)
.
waitForElementVisible
(
'#icon-panel'
,
10000
)
.
clickLaunchIcon
(
'file explorers'
)
.
click
(
'.websocketconn'
)
.
click
(
'.websocketconn'
)
.
waitForElementVisible
(
'#modal-footer-ok'
,
10000
)
.
waitForElementVisible
(
'#modal-footer-ok'
,
10000
)
.
click
(
'#modal-footer-ok'
)
.
click
(
'#modal-footer-ok'
)
...
@@ -125,7 +127,7 @@ function runTests (browser, testData) {
...
@@ -125,7 +127,7 @@ function runTests (browser, testData) {
testImportFromRemixd
(
browser
,
()
=>
{
done
()
})
testImportFromRemixd
(
browser
,
()
=>
{
done
()
})
})
})
.
perform
(
function
()
{
.
perform
(
function
()
{
browser
.
click
(
'[data-path="localhost"]'
)
// collapse and expand
browser
.
click
LaunchIcon
(
'file explorers'
).
click
(
'[data-path="localhost"]'
)
// collapse and expand
.
waitForElementNotVisible
(
'[data-path="localhost/folder1"]'
)
.
waitForElementNotVisible
(
'[data-path="localhost/folder1"]'
)
.
click
(
'[data-path="localhost"]'
)
.
click
(
'[data-path="localhost"]'
)
.
waitForElementVisible
(
'[data-path="localhost/folder1"]'
)
.
waitForElementVisible
(
'[data-path="localhost/folder1"]'
)
...
...
test-browser/tests/simpleContract.js
View file @
30ce6255
...
@@ -20,10 +20,12 @@ module.exports = {
...
@@ -20,10 +20,12 @@ module.exports = {
function
runTests
(
browser
)
{
function
runTests
(
browser
)
{
browser
.
setEditorValue
=
contractHelper
.
setEditorValue
browser
.
setEditorValue
=
contractHelper
.
setEditorValue
browser
.
getEditorValue
=
contractHelper
.
getEditorValue
browser
.
getEditorValue
=
contractHelper
.
getEditorValue
browser
.
clickLaunchIcon
=
contractHelper
.
clickLaunchIcon
browser
browser
.
waitForElementVisible
(
'.newFile'
,
10000
)
.
waitForElementVisible
(
'#icon-panel'
,
10000
)
.
click
(
'.compileView'
)
.
clickLaunchIcon
(
'solidity'
)
.
click
(
'#filepanel label[data-path="browser"]'
)
.
clickLaunchIcon
(
'file explorers'
)
.
click
(
'#swap-panel label[data-path="browser"]'
)
.
perform
(()
=>
{
.
perform
(()
=>
{
// the first fn is used to pass browser to the other ones.
// the first fn is used to pass browser to the other ones.
async
.
waterfall
([
function
(
callback
)
{
callback
(
null
,
browser
)
},
async
.
waterfall
([
function
(
callback
)
{
callback
(
null
,
browser
)
},
...
@@ -63,7 +65,7 @@ function testSuccessImport (browser, callback) {
...
@@ -63,7 +65,7 @@ function testSuccessImport (browser, callback) {
function
testFailedImport
(
browser
,
callback
)
{
function
testFailedImport
(
browser
,
callback
)
{
console
.
log
(
'testFailedImport'
)
console
.
log
(
'testFailedImport'
)
contractHelper
.
addFile
(
browser
,
'Untitled3.sol'
,
sources
[
2
][
'browser/Untitled3.sol'
],
()
=>
{
contractHelper
.
addFile
(
browser
,
'Untitled3.sol'
,
sources
[
2
][
'browser/Untitled3.sol'
],
()
=>
{
browser
.
assert
.
containsText
(
'#compileTabView .error pre'
,
'Unable to import "browser/Untitled11.sol": File not found'
)
browser
.
clickLaunchIcon
(
'solidity'
).
assert
.
containsText
(
'#compileTabView .error pre'
,
'Unable to import "browser/Untitled11.sol": File not found'
)
.
perform
(
function
()
{
.
perform
(
function
()
{
callback
(
null
,
browser
)
callback
(
null
,
browser
)
})
})
...
@@ -94,8 +96,8 @@ function testAutoDeployLib (browser, callback) {
...
@@ -94,8 +96,8 @@ function testAutoDeployLib (browser, callback) {
function
testManualDeployLib
(
browser
,
callback
)
{
function
testManualDeployLib
(
browser
,
callback
)
{
console
.
log
(
'testManualDeployLib'
)
console
.
log
(
'testManualDeployLib'
)
browser
.
click
(
'i[class^="clearinstance"]'
).
pause
(
5000
).
click
(
'.settingsView
'
).
click
(
'#generatecontractmetadata'
).
perform
(()
=>
{
browser
.
click
(
'i[class^="clearinstance"]'
).
pause
(
5000
).
click
LaunchIcon
(
'settings
'
).
click
(
'#generatecontractmetadata'
).
perform
(()
=>
{
browser
.
click
(
'.compileView
'
).
click
(
'#compile'
).
perform
(()
=>
{
// that should generate the JSON artefact
browser
.
click
LaunchIcon
(
'solidity
'
).
click
(
'#compile'
).
perform
(()
=>
{
// that should generate the JSON artefact
contractHelper
.
verifyContract
(
browser
,
[
'test'
],
()
=>
{
contractHelper
.
verifyContract
(
browser
,
[
'test'
],
()
=>
{
contractHelper
.
selectContract
(
browser
,
'lib'
,
()
=>
{
// deploy lib
contractHelper
.
selectContract
(
browser
,
'lib'
,
()
=>
{
// deploy lib
contractHelper
.
createContract
(
browser
,
''
,
()
=>
{
contractHelper
.
createContract
(
browser
,
''
,
()
=>
{
...
...
test-browser/tests/staticanalysis.js
View file @
30ce6255
...
@@ -34,12 +34,13 @@ module.exports = {
...
@@ -34,12 +34,13 @@ module.exports = {
function
runTests
(
browser
)
{
function
runTests
(
browser
)
{
browser
.
setEditorValue
=
contractHelper
.
setEditorValue
browser
.
setEditorValue
=
contractHelper
.
setEditorValue
browser
.
clickLaunchIcon
=
contractHelper
.
clickLaunchIcon
browser
browser
.
waitForElementVisible
(
'
.newFile
'
,
10000
)
.
waitForElementVisible
(
'
#icon-panel
'
,
10000
)
.
click
(
'.compileView
'
)
.
click
LaunchIcon
(
'solidity
'
)
contractHelper
.
testContracts
(
browser
,
'Untitled.sol'
,
sources
[
0
][
'browser/Untitled.sol'
],
[
'TooMuchGas'
,
'test1'
,
'test2'
],
function
()
{
contractHelper
.
testContracts
(
browser
,
'Untitled.sol'
,
sources
[
0
][
'browser/Untitled.sol'
],
[
'TooMuchGas'
,
'test1'
,
'test2'
],
function
()
{
browser
browser
.
click
(
'.staticanalysisView
'
)
.
click
LaunchIcon
(
'solidity static analysis
'
)
.
click
(
'#staticanalysisView button'
)
.
click
(
'#staticanalysisView button'
)
.
waitForElementPresent
(
'#staticanalysisresult .staticAnalysisWarning'
,
2000
,
true
,
function
()
{
.
waitForElementPresent
(
'#staticanalysisresult .staticAnalysisWarning'
,
2000
,
true
,
function
()
{
dom
.
listSelectorContains
([
'browser/Untitled.sol:2:33:Use of tx.origin'
,
dom
.
listSelectorContains
([
'browser/Untitled.sol:2:33:Use of tx.origin'
,
...
...
test-browser/tests/units/testRecorder.js
View file @
30ce6255
...
@@ -7,9 +7,10 @@ module.exports = {
...
@@ -7,9 +7,10 @@ module.exports = {
return
sources
return
sources
},
},
test
:
function
(
browser
,
callback
)
{
test
:
function
(
browser
,
callback
)
{
browser
.
clickLaunchIcon
=
contractHelper
.
clickLaunchIcon
contractHelper
.
addFile
(
browser
,
'scenario.json'
,
{
content
:
records
},
()
=>
{
contractHelper
.
addFile
(
browser
,
'scenario.json'
,
{
content
:
records
},
()
=>
{
browser
browser
.
click
(
'.runView
'
)
.
click
LaunchIcon
(
'run transactions
'
)
.
click
(
'div[class^="cardContainer"] i[class^="arrow"]'
)
.
click
(
'div[class^="cardContainer"] i[class^="arrow"]'
)
.
click
(
'#runTabView .runtransaction'
)
.
click
(
'#runTabView .runtransaction'
)
.
waitForElementPresent
(
'.instance:nth-of-type(2)'
)
.
waitForElementPresent
(
'.instance:nth-of-type(2)'
)
...
...
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