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
9a3f4e9b
Unverified
Commit
9a3f4e9b
authored
Nov 25, 2020
by
yann300
Committed by
GitHub
Nov 25, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #615 from ethereum/e2e_recorder
add tests for recorder
parents
7a48ab40
079e98d4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
53 additions
and
3 deletions
+53
-3
selectContract.ts
apps/remix-ide-e2e/src/commands/selectContract.ts
+1
-1
recorder.test.ts
apps/remix-ide-e2e/src/tests/recorder.test.ts
+52
-2
No files found.
apps/remix-ide-e2e/src/commands/selectContract.ts
View file @
9a3f4e9b
...
@@ -15,7 +15,7 @@ class SelectContract extends EventEmitter {
...
@@ -15,7 +15,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
.
clickLaunchIcon
(
'settings'
).
clickLaunchIcon
(
'udapp'
)
.
pause
(
1000
0
)
.
pause
(
1000
)
.
setValue
(
'#runTabView select[class^="contractNames"]'
,
contractName
).
perform
(()
=>
{
.
setValue
(
'#runTabView select[class^="contractNames"]'
,
contractName
).
perform
(()
=>
{
callback
()
callback
()
})
})
...
...
apps/remix-ide-e2e/src/tests/recorder.test.ts
View file @
9a3f4e9b
...
@@ -56,7 +56,36 @@ module.exports = {
...
@@ -56,7 +56,36 @@ module.exports = {
browser
.
assert
.
equal
(
JSON
.
stringify
(
parsed
.
transactions
[
1
].
record
.
name
),
JSON
.
stringify
(
scenario
.
transactions
[
1
].
record
.
name
))
browser
.
assert
.
equal
(
JSON
.
stringify
(
parsed
.
transactions
[
1
].
record
.
name
),
JSON
.
stringify
(
scenario
.
transactions
[
1
].
record
.
name
))
browser
.
assert
.
equal
(
JSON
.
stringify
(
parsed
.
transactions
[
1
].
record
.
type
),
JSON
.
stringify
(
scenario
.
transactions
[
1
].
record
.
type
))
browser
.
assert
.
equal
(
JSON
.
stringify
(
parsed
.
transactions
[
1
].
record
.
type
),
JSON
.
stringify
(
scenario
.
transactions
[
1
].
record
.
type
))
browser
.
assert
.
equal
(
JSON
.
stringify
(
parsed
.
transactions
[
1
].
record
.
from
),
JSON
.
stringify
(
scenario
.
transactions
[
1
].
record
.
from
))
browser
.
assert
.
equal
(
JSON
.
stringify
(
parsed
.
transactions
[
1
].
record
.
from
),
JSON
.
stringify
(
scenario
.
transactions
[
1
].
record
.
from
))
})
})
},
'Record more than one contract'
:
function
(
browser
:
NightwatchBrowser
)
{
// deploy 2 contracts (2 different ABIs), save the record, reexecute and test one of the function.
let
addressRef
browser
.
click
(
'*[data-id="deployAndRunClearInstances"]'
)
.
testContracts
(
'multipleContracts.sol'
,
sources
[
1
][
'browser/multipleContracts.sol'
],
[
't1est'
,
't2est'
])
.
selectContract
(
't1est'
)
.
pause
(
1000
)
.
createContract
(
''
)
.
pause
(
1000
)
.
selectContract
(
't2est'
)
.
pause
(
1000
)
.
createContract
(
''
)
.
click
(
'i.savetransaction'
)
.
modalFooterOKClick
()
.
click
(
'*[data-id="deployAndRunClearInstances"]'
)
// clear udapp
.
click
(
'*[data-id="terminalClearConsole"]'
)
// clear terminal
.
click
(
'#runTabView .runtransaction'
)
.
clickInstance
(
1
)
.
pause
(
1000
)
.
clickFunction
(
'set2 - transact (not payable)'
,
{
types
:
'uint256 _po'
,
values
:
'10'
})
.
testFunction
(
'0xa88bf726e706480f61f04a066452929030c0a0216cc6923106f863963339bdb7'
,
{
status
:
'true Transaction mined and execution succeed'
,
'transaction hash'
:
'0xa88bf726e706480f61f04a066452929030c0a0216cc6923106f863963339bdb7'
,
'decoded input'
:
{
"uint256 _po"
:{
"type"
:
"BigNumber"
,
"hex"
:
"0x0a"
}}
})
.
end
()
.
end
()
},
},
tearDown
:
sauce
tearDown
:
sauce
...
@@ -69,7 +98,28 @@ const sources = [{'browser/testRecorder.sol': {content: `contract testRecorder {
...
@@ -69,7 +98,28 @@ const sources = [{'browser/testRecorder.sol': {content: `contract testRecorder {
function set (uint _p) public {
function set (uint _p) public {
}
}
}`
}}]
}`
}},
{
'browser/multipleContracts.sol'
:
{
content
:
`contract t1est {
uint p;
t2est t;
constructor () public {
t = new t2est();
t.set2(34);
}
function set(uint _p) public {
p = _p;
t.set2(12);
}
}
contract t2est {
uint p;
function set2(uint _po) public {
p = _po;
}
}`
}}
]
const
records
=
`{
const
records
=
`{
"accounts": {
"accounts": {
...
...
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