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
ecf0dc03
Commit
ecf0dc03
authored
Oct 25, 2021
by
bunsenstraat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test accounts
parent
d6769dff
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
15 deletions
+30
-15
plugin_api.ts
apps/remix-ide-e2e/src/tests/plugin_api.ts
+30
-15
No files found.
apps/remix-ide-e2e/src/tests/plugin_api.ts
View file @
ecf0dc03
...
...
@@ -55,6 +55,14 @@ const setPayload = async (browser: NightwatchBrowser, payload: any) => {
})
}
const
clearPayLoad
=
async
(
browser
:
NightwatchBrowser
)
=>
{
return
new
Promise
((
resolve
)
=>
{
browser
.
clearValue
(
'//*[@id="payload"]'
,
()
=>
{
resolve
(
true
)
})
})
}
const
clickButton
=
async
(
browser
:
NightwatchBrowser
,
buttonText
:
string
)
=>
{
return
new
Promise
((
resolve
)
=>
{
browser
.
useXpath
().
waitForElementVisible
(
`//*[@data-id='
${
buttonText
}
']`
).
pause
(
100
)
...
...
@@ -92,6 +100,8 @@ const setAppend = async (browser: NightwatchBrowser) => {
const
clickAndCheckLog
=
async
(
browser
:
NightwatchBrowser
,
buttonText
:
string
,
methodResult
:
any
,
eventResult
:
any
,
payload
:
any
)
=>
{
if
(
payload
)
{
await
setPayload
(
browser
,
payload
)
}
else
{
await
clearPayLoad
(
browser
)
}
if
(
methodResult
&&
typeof
methodResult
!==
'string'
)
{
methodResult
=
JSON
.
stringify
(
methodResult
)
}
if
(
eventResult
&&
typeof
eventResult
!==
'string'
)
{
eventResult
=
JSON
.
stringify
(
eventResult
)
}
...
...
@@ -123,6 +133,11 @@ module.exports = {
.
frame
(
0
).
useXpath
()
},
// UDAPP
'Should get accounts'
:
async
function
(
browser
:
NightwatchBrowser
)
{
await
clickAndCheckLog
(
browser
,
'udapp:getAccounts'
,
'0x5B38Da6a701c568545dCfcB03FcB875f56beddC4'
,
null
,
null
)
},
// context menu item
'Should create context menu item'
:
async
function
(
browser
:
NightwatchBrowser
)
{
...
...
@@ -229,21 +244,6 @@ module.exports = {
await
setAppend
(
browser
)
},
// COMPILER
'Should compile a file'
:
async
function
(
browser
:
NightwatchBrowser
)
{
await
setAppend
(
browser
)
await
clickAndCheckLog
(
browser
,
'solidity:compile'
,
null
,
null
,
'contracts/1_Storage.sol'
)
browser
.
pause
(
5000
,
async
()
=>
{
await
clickAndCheckLog
(
browser
,
'solidity:compile'
,
null
,
'compilationFinished'
,
null
)
await
setAppend
(
browser
)
})
},
'Should get compilationresults'
:
async
function
(
browser
:
NightwatchBrowser
)
{
await
clickAndCheckLog
(
browser
,
'solidity:getCompilationResult'
,
'contracts/1_Storage.sol'
,
null
,
null
)
},
// DGIT
'Should have changes on new workspace'
:
async
function
(
browser
:
NightwatchBrowser
)
{
await
clickAndCheckLog
(
browser
,
'filePanel:createWorkspace'
,
null
,
null
,
'dgit'
)
...
...
@@ -274,5 +274,20 @@ module.exports = {
'Should test from path with solidityUnitTesting'
:
async
function
(
browser
:
NightwatchBrowser
)
{
await
clickAndCheckLog
(
browser
,
'solidityUnitTesting:testFromPath'
,
'"totalPassing":2,"totalFailing":0'
,
null
,
'tests/4_Ballot_test.sol'
)
},
// COMPILER
'Should compile a file'
:
async
function
(
browser
:
NightwatchBrowser
)
{
await
setAppend
(
browser
)
await
clickAndCheckLog
(
browser
,
'solidity:compile'
,
null
,
null
,
'contracts/1_Storage.sol'
)
browser
.
pause
(
5000
,
async
()
=>
{
await
clickAndCheckLog
(
browser
,
'solidity:compile'
,
null
,
'compilationFinished'
,
null
)
await
setAppend
(
browser
)
})
},
'Should get compilationresults'
:
async
function
(
browser
:
NightwatchBrowser
)
{
await
clickAndCheckLog
(
browser
,
'solidity:getCompilationResult'
,
'contracts/1_Storage.sol'
,
null
,
null
)
}
}
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