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
fad190e1
Commit
fad190e1
authored
Jan 06, 2021
by
yann300
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix e2e tests
parent
4897d9b2
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
16 additions
and
13 deletions
+16
-13
createContract.ts
apps/remix-ide-e2e/src/commands/createContract.ts
+1
-4
selectContract.ts
apps/remix-ide-e2e/src/commands/selectContract.ts
+4
-6
debugger.test.ts
apps/remix-ide-e2e/src/tests/debugger.test.ts
+4
-2
libraryDeployment.test.ts
apps/remix-ide-e2e/src/tests/libraryDeployment.test.ts
+4
-0
recorder.test.ts
apps/remix-ide-e2e/src/tests/recorder.test.ts
+3
-1
No files found.
apps/remix-ide-e2e/src/commands/createContract.ts
View file @
fad190e1
...
@@ -15,14 +15,11 @@ class CreateContract extends EventEmitter {
...
@@ -15,14 +15,11 @@ class CreateContract extends EventEmitter {
function
createContract
(
browser
:
NightwatchBrowser
,
inputParams
:
string
,
callback
:
VoidFunction
)
{
function
createContract
(
browser
:
NightwatchBrowser
,
inputParams
:
string
,
callback
:
VoidFunction
)
{
if
(
inputParams
)
{
if
(
inputParams
)
{
browser
.
clickLaunchIcon
(
'settings'
).
clickLaunchIcon
(
'udapp'
)
browser
.
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
()
})
})
})
}
else
{
}
else
{
browser
browser
.
clickLaunchIcon
(
'settings'
)
.
clickLaunchIcon
(
'udapp'
)
.
click
(
'#runTabView button[class^="instanceButton"]'
)
.
click
(
'#runTabView button[class^="instanceButton"]'
)
.
pause
(
500
)
.
pause
(
500
)
.
perform
(
function
()
{
callback
()
})
.
perform
(
function
()
{
callback
()
})
...
...
apps/remix-ide-e2e/src/commands/selectContract.ts
View file @
fad190e1
import
{
NightwatchBrowser
}
from
'nightwatch'
import
{
NightwatchBrowser
}
from
'nightwatch'
import
EventEmitter
from
"events"
import
EventEmitter
from
"events"
const
selector
=
'#runTabView select[class^="contractNames"]'
class
SelectContract
extends
EventEmitter
{
class
SelectContract
extends
EventEmitter
{
command
(
this
:
NightwatchBrowser
,
contractName
:
string
):
NightwatchBrowser
{
command
(
this
:
NightwatchBrowser
,
contractName
:
string
):
NightwatchBrowser
{
this
.
api
.
perform
((
done
)
=>
{
this
.
api
.
waitForElementVisible
(
selector
).
perform
((
done
)
=>
{
selectContract
(
this
.
api
,
contractName
,
()
=>
{
selectContract
(
this
.
api
,
contractName
,
()
=>
{
done
()
done
()
this
.
emit
(
'complete'
)
this
.
emit
(
'complete'
)
...
@@ -14,11 +16,7 @@ class SelectContract extends EventEmitter {
...
@@ -14,11 +16,7 @@ class SelectContract extends EventEmitter {
}
}
function
selectContract
(
browser
:
NightwatchBrowser
,
contractName
:
string
,
callback
:
VoidFunction
)
{
function
selectContract
(
browser
:
NightwatchBrowser
,
contractName
:
string
,
callback
:
VoidFunction
)
{
browser
.
clickLaunchIcon
(
'settings'
).
clickLaunchIcon
(
'udapp'
)
browser
.
click
(
`
${
selector
}
option[value="
${
contractName
}
"]`
).
perform
(()
=>
callback
())
.
pause
(
10000
)
.
setValue
(
'#runTabView select[class^="contractNames"]'
,
contractName
).
perform
(()
=>
{
callback
()
})
}
}
module
.
exports
=
SelectContract
module
.
exports
=
SelectContract
apps/remix-ide-e2e/src/tests/debugger.test.ts
View file @
fad190e1
...
@@ -83,7 +83,8 @@ module.exports = {
...
@@ -83,7 +83,8 @@ module.exports = {
.
pause
(
2000
)
.
pause
(
2000
)
.
clickLaunchIcon
(
'udapp'
)
.
clickLaunchIcon
(
'udapp'
)
.
testContracts
(
'externalImport.sol'
,
sources
[
1
][
'browser/externalImport.sol'
],
[
'ERC20'
])
.
testContracts
(
'externalImport.sol'
,
sources
[
1
][
'browser/externalImport.sol'
],
[
'ERC20'
])
.
waitForElementPresent
(
'*[title="Deploy - transact (not payable)"]'
,
35000
)
.
clickLaunchIcon
(
'udapp'
)
.
waitForElementPresent
(
'*[title="Deploy - transact (not payable)"]'
,
35000
)
.
selectContract
(
'ERC20'
)
.
selectContract
(
'ERC20'
)
.
createContract
(
'"tokenName", "symbol"'
)
.
createContract
(
'"tokenName", "symbol"'
)
.
debugTransaction
(
2
)
.
debugTransaction
(
2
)
...
@@ -110,6 +111,7 @@ module.exports = {
...
@@ -110,6 +111,7 @@ module.exports = {
.
setSolidityCompilerVersion
(
'soljson-v0.6.12+commit.27d51765.js'
)
.
setSolidityCompilerVersion
(
'soljson-v0.6.12+commit.27d51765.js'
)
.
clickLaunchIcon
(
'udapp'
)
.
clickLaunchIcon
(
'udapp'
)
.
testContracts
(
'withABIEncoderV2.sol'
,
sources
[
2
][
'browser/withABIEncoderV2.sol'
],
[
'test'
])
.
testContracts
(
'withABIEncoderV2.sol'
,
sources
[
2
][
'browser/withABIEncoderV2.sol'
],
[
'test'
])
.
clickLaunchIcon
(
'udapp'
)
.
selectContract
(
'test'
)
.
selectContract
(
'test'
)
.
createContract
(
''
)
.
createContract
(
''
)
.
clickInstance
(
2
)
.
clickInstance
(
2
)
...
@@ -163,9 +165,9 @@ module.exports = {
...
@@ -163,9 +165,9 @@ module.exports = {
browser
browser
.
clickLaunchIcon
(
'solidity'
)
.
clickLaunchIcon
(
'solidity'
)
.
setSolidityCompilerVersion
(
'soljson-v0.7.2+commit.51b20bc0.js'
)
.
setSolidityCompilerVersion
(
'soljson-v0.7.2+commit.51b20bc0.js'
)
.
clickLaunchIcon
(
'udapp'
)
.
pause
(
2000
)
.
pause
(
2000
)
.
testContracts
(
'withGeneratedSources.sol'
,
sources
[
4
][
'browser/withGeneratedSources.sol'
],
[
'A'
])
.
testContracts
(
'withGeneratedSources.sol'
,
sources
[
4
][
'browser/withGeneratedSources.sol'
],
[
'A'
])
.
clickLaunchIcon
(
'udapp'
)
.
createContract
(
''
)
.
createContract
(
''
)
.
clickInstance
(
4
)
.
clickInstance
(
4
)
.
clickFunction
(
'f - transact (not payable)'
,
{
types
:
'uint256[] '
,
values
:
'[]'
})
.
clickFunction
(
'f - transact (not payable)'
,
{
types
:
'uint256[] '
,
values
:
'[]'
})
...
...
apps/remix-ide-e2e/src/tests/libraryDeployment.test.ts
View file @
fad190e1
...
@@ -21,6 +21,7 @@ module.exports = {
...
@@ -21,6 +21,7 @@ module.exports = {
'Test Auto Deploy Lib'
:
function
(
browser
:
NightwatchBrowser
)
{
'Test Auto Deploy Lib'
:
function
(
browser
:
NightwatchBrowser
)
{
let
addressRef
:
string
let
addressRef
:
string
browser
.
verifyContracts
([
'test'
])
browser
.
verifyContracts
([
'test'
])
.
clickLaunchIcon
(
'udapp'
)
.
selectContract
(
'test'
)
.
selectContract
(
'test'
)
.
createContract
(
''
)
.
createContract
(
''
)
.
getAddressAtPosition
(
0
,
(
address
)
=>
{
.
getAddressAtPosition
(
0
,
(
address
)
=>
{
...
@@ -45,6 +46,7 @@ module.exports = {
...
@@ -45,6 +46,7 @@ module.exports = {
.
clickLaunchIcon
(
'solidity'
)
.
clickLaunchIcon
(
'solidity'
)
.
click
(
'#compileTabView button[title="Compile"]'
)
// that should generate the JSON artefact
.
click
(
'#compileTabView button[title="Compile"]'
)
// that should generate the JSON artefact
.
verifyContracts
([
'test'
])
.
verifyContracts
([
'test'
])
.
clickLaunchIcon
(
'udapp'
)
.
selectContract
(
'lib'
)
// deploy lib
.
selectContract
(
'lib'
)
// deploy lib
.
createContract
(
''
)
.
createContract
(
''
)
.
perform
((
done
)
=>
{
.
perform
((
done
)
=>
{
...
@@ -74,6 +76,7 @@ function checkDeployShouldFail (browser: NightwatchBrowser, callback: VoidFuncti
...
@@ -74,6 +76,7 @@ function checkDeployShouldFail (browser: NightwatchBrowser, callback: VoidFuncti
browser
.
setEditorValue
(
JSON
.
stringify
(
config
))
browser
.
setEditorValue
(
JSON
.
stringify
(
config
))
})
})
.
openFile
(
'browser/Untitled5.sol'
)
.
openFile
(
'browser/Untitled5.sol'
)
.
clickLaunchIcon
(
'udapp'
)
.
selectContract
(
'test'
)
// deploy lib
.
selectContract
(
'test'
)
// deploy lib
.
createContract
(
''
)
.
createContract
(
''
)
.
getText
(
'div[class^="terminal"]'
,
(
value
)
=>
{
.
getText
(
'div[class^="terminal"]'
,
(
value
)
=>
{
...
@@ -96,6 +99,7 @@ function checkDeployShouldSucceed (browser: NightwatchBrowser, address: string,
...
@@ -96,6 +99,7 @@ function checkDeployShouldSucceed (browser: NightwatchBrowser, address: string,
browser
.
setEditorValue
(
JSON
.
stringify
(
config
))
browser
.
setEditorValue
(
JSON
.
stringify
(
config
))
})
})
.
openFile
(
'browser/Untitled5.sol'
)
.
openFile
(
'browser/Untitled5.sol'
)
.
clickLaunchIcon
(
'udapp'
)
.
selectContract
(
'test'
)
// deploy lib
.
selectContract
(
'test'
)
// deploy lib
.
createContract
(
''
)
.
createContract
(
''
)
.
getAddressAtPosition
(
1
,
(
address
)
=>
{
.
getAddressAtPosition
(
1
,
(
address
)
=>
{
...
...
apps/remix-ide-e2e/src/tests/recorder.test.ts
View file @
fad190e1
...
@@ -38,6 +38,7 @@ module.exports = {
...
@@ -38,6 +38,7 @@ module.exports = {
})
})
.
click
(
'*[data-id="deployAndRunClearInstances"]'
)
.
click
(
'*[data-id="deployAndRunClearInstances"]'
)
.
testContracts
(
'testRecorder.sol'
,
sources
[
0
][
'browser/testRecorder.sol'
],
[
'testRecorder'
])
.
testContracts
(
'testRecorder.sol'
,
sources
[
0
][
'browser/testRecorder.sol'
],
[
'testRecorder'
])
.
clickLaunchIcon
(
'udapp'
)
.
createContract
(
'12'
)
.
createContract
(
'12'
)
.
waitForElementPresent
(
'.instance:nth-of-type(2)'
)
.
waitForElementPresent
(
'.instance:nth-of-type(2)'
)
.
click
(
'.instance:nth-of-type(2) > div > button'
)
.
click
(
'.instance:nth-of-type(2) > div > button'
)
...
@@ -65,10 +66,11 @@ module.exports = {
...
@@ -65,10 +66,11 @@ module.exports = {
browser
browser
.
click
(
'*[data-id="deployAndRunClearInstances"]'
)
.
click
(
'*[data-id="deployAndRunClearInstances"]'
)
.
testContracts
(
'multipleContracts.sol'
,
sources
[
1
][
'browser/multipleContracts.sol'
],
[
't1est'
,
't2est'
])
.
testContracts
(
'multipleContracts.sol'
,
sources
[
1
][
'browser/multipleContracts.sol'
],
[
't1est'
,
't2est'
])
.
clickLaunchIcon
(
'udapp'
)
.
selectContract
(
't1est'
)
.
selectContract
(
't1est'
)
.
pause
(
1000
)
.
pause
(
1000
)
.
createContract
(
''
)
.
createContract
(
''
)
.
pause
(
100
0
)
.
clickInstance
(
0
)
.
selectContract
(
't2est'
)
.
selectContract
(
't2est'
)
.
pause
(
1000
)
.
pause
(
1000
)
.
createContract
(
''
)
.
createContract
(
''
)
...
...
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