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
0f2637b3
Unverified
Commit
0f2637b3
authored
Jan 14, 2021
by
yann300
Committed by
GitHub
Jan 14, 2021
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #709 from ethereum/fixRecorderTest
fix Recorder e2e tests
parents
33d9cebc
8ae7227d
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
16 additions
and
14 deletions
+16
-14
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
+3
-1
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
+4
-3
No files found.
apps/remix-ide-e2e/src/commands/createContract.ts
View file @
0f2637b3
...
@@ -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 @
0f2637b3
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 @
0f2637b3
...
@@ -83,6 +83,7 @@ module.exports = {
...
@@ -83,6 +83,7 @@ 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'
])
.
clickLaunchIcon
(
'udapp'
)
.
waitForElementPresent
(
'*[title="Deploy - transact (not payable)"]'
,
35000
)
.
waitForElementPresent
(
'*[title="Deploy - transact (not payable)"]'
,
35000
)
.
selectContract
(
'ERC20'
)
.
selectContract
(
'ERC20'
)
.
createContract
(
'"tokenName", "symbol"'
)
.
createContract
(
'"tokenName", "symbol"'
)
...
@@ -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 @
0f2637b3
...
@@ -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 @
0f2637b3
...
@@ -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'
)
...
@@ -57,19 +58,19 @@ module.exports = {
...
@@ -57,19 +58,19 @@ module.exports = {
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
))
})
})
.
end
()
},
},
'Record more than one contract'
:
''
+
function
(
browser
:
NightwatchBrowser
)
{
'Record more than one contract'
:
function
(
browser
:
NightwatchBrowser
)
{
// deploy 2 contracts (2 different ABIs), save the record, reexecute and test one of the function.
// deploy 2 contracts (2 different ABIs), save the record, reexecute and test one of the function.
let
addressRef
let
addressRef
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