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
14742577
Commit
14742577
authored
May 27, 2021
by
aniket-engg
Committed by
Aniket
May 28, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
contract call tests for web3 provider
parent
8df9d5e6
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
50 additions
and
42 deletions
+50
-42
ballot.test.ts
apps/remix-ide-e2e/src/tests/ballot.test.ts
+50
-42
No files found.
apps/remix-ide-e2e/src/tests/ballot.test.ts
View file @
14742577
...
@@ -34,50 +34,50 @@ module.exports = {
...
@@ -34,50 +34,50 @@ module.exports = {
})
})
},
},
'Call method from Ballot to check return value'
:
function
(
browser
:
NightwatchBrowser
)
{
//
'Call method from Ballot to check return value': function (browser: NightwatchBrowser) {
browser
//
browser
.
clickFunction
(
'winnerName - call'
)
//
.clickFunction('winnerName - call')
// Test in terminal
//
// Test in terminal
.
testFunction
(
'last'
,
//
.testFunction('last',
{
//
{
to
:
'Ballot.winnerName() 0x692a70D2e424a56D2C6C27aA97D1a86395877b3A'
,
//
to: 'Ballot.winnerName() 0x692a70D2e424a56D2C6C27aA97D1a86395877b3A',
'decoded output'
:
{
"0"
:
"bytes32: winnerName_ 0x48656c6c6f20576f726c64210000000000000000000000000000000000000000"
}
//
'decoded output': { "0": "bytes32: winnerName_ 0x48656c6c6f20576f726c64210000000000000000000000000000000000000000" }
})
//
})
// Test in Udapp UI
//
// Test in Udapp UI
.
assert
.
containsText
(
'*[data-id="treeViewDiv0"]'
,
"bytes32: winnerName_ 0x48656c6c6f20576f726c64210000000000000000000000000000000000000000"
)
//
.assert.containsText('*[data-id="treeViewDiv0"]', "bytes32: winnerName_ 0x48656c6c6f20576f726c64210000000000000000000000000000000000000000")
},
//
},
'Debug Ballot / delegate'
:
function
(
browser
:
NightwatchBrowser
)
{
//
'Debug Ballot / delegate': function (browser: NightwatchBrowser) {
browser
.
pause
(
500
)
//
browser.pause(500)
.
click
(
'*[data-id="txLoggerDebugButton0x41fab8ea5b1d9fba5e0a6545ca1a2d62fff518578802c033c2b9a031a01c31b3"]'
)
//
.click('*[data-id="txLoggerDebugButton0x41fab8ea5b1d9fba5e0a6545ca1a2d62fff518578802c033c2b9a031a01c31b3"]')
.
waitForElementVisible
(
'*[data-id="buttonNavigatorJumpPreviousBreakpoint"]'
)
//
.waitForElementVisible('*[data-id="buttonNavigatorJumpPreviousBreakpoint"]')
.
click
(
'*[data-id="buttonNavigatorJumpPreviousBreakpoint"]'
)
//
.click('*[data-id="buttonNavigatorJumpPreviousBreakpoint"]')
.
pause
(
2000
)
//
.pause(2000)
.
waitForElementVisible
(
'#stepdetail'
)
//
.waitForElementVisible('#stepdetail')
.
goToVMTraceStep
(
144
)
//
.goToVMTraceStep(144)
.
pause
(
2000
)
//
.pause(2000)
.
checkVariableDebug
(
'soliditystate'
,
stateCheck
)
//
.checkVariableDebug('soliditystate', stateCheck)
.
checkVariableDebug
(
'soliditylocals'
,
localsCheck
)
//
.checkVariableDebug('soliditylocals', localsCheck)
},
//
},
'Access Ballot via at address'
:
function
(
browser
:
NightwatchBrowser
)
{
//
'Access Ballot via at address': function (browser: NightwatchBrowser) {
browser
.
clickLaunchIcon
(
'udapp'
)
//
browser.clickLaunchIcon('udapp')
.
click
(
'*[data-id="universalDappUiUdappClose"]'
)
//
.click('*[data-id="universalDappUiUdappClose"]')
.
addFile
(
'ballot.abi'
,
{
content
:
ballotABI
})
//
.addFile('ballot.abi', { content: ballotABI })
// we are not changing the visibility for not checksumed contracts
//
// we are not changing the visibility for not checksumed contracts
// .addAtAddressInstance('0x692a70D2e424a56D2C6C27aA97D1a86395877b3B', true, false)
//
// .addAtAddressInstance('0x692a70D2e424a56D2C6C27aA97D1a86395877b3B', true, false)
.
clickLaunchIcon
(
'filePanel'
)
//
.clickLaunchIcon('filePanel')
.
addAtAddressInstance
(
'0x692a70D2e424a56D2C6C27aA97D1a86395877b3A'
,
true
,
true
)
//
.addAtAddressInstance('0x692a70D2e424a56D2C6C27aA97D1a86395877b3A', true, true)
.
pause
(
500
)
//
.pause(500)
.
waitForElementPresent
(
'*[data-id="universalDappUiContractActionWrapper"]'
,
60000
)
//
.waitForElementPresent('*[data-id="universalDappUiContractActionWrapper"]', 60000)
.
click
(
'*[data-id="universalDappUiTitleExpander"]'
)
//
.click('*[data-id="universalDappUiTitleExpander"]')
.
clickFunction
(
'delegate - transact (not payable)'
,
{
types
:
'address to'
,
values
:
'"0x4b0897b0513fdc7c541b6d9d7e929c4e5364d2db"'
})
//
.clickFunction('delegate - transact (not payable)', { types: 'address to', values: '"0x4b0897b0513fdc7c541b6d9d7e929c4e5364d2db"' })
.
testFunction
(
'last'
,
//
.testFunction('last',
{
//
{
status
:
'false Transaction mined but execution failed'
,
//
status: 'false Transaction mined but execution failed',
'decoded input'
:
{
'address to'
:
'0x4B0897b0513fdC7C541B6d9D7E929C4e5364D2dB'
}
//
'decoded input': { 'address to': '0x4B0897b0513fdC7C541B6d9D7E929C4e5364D2dB' }
})
//
})
},
//
},
'Deploy and use Ballot using external web3'
:
function
(
browser
:
NightwatchBrowser
)
{
'Deploy and use Ballot using external web3'
:
function
(
browser
:
NightwatchBrowser
)
{
browser
browser
...
@@ -93,6 +93,14 @@ module.exports = {
...
@@ -93,6 +93,14 @@ module.exports = {
.
clickFunction
(
'delegate - transact (not payable)'
,
{
types
:
'address to'
,
values
:
'0xCA35b7d915458EF540aDe6068dFe2F44E8fa733c'
})
.
clickFunction
(
'delegate - transact (not payable)'
,
{
types
:
'address to'
,
values
:
'0xCA35b7d915458EF540aDe6068dFe2F44E8fa733c'
})
.
journalLastChildIncludes
(
'Ballot.delegate(address)'
)
.
journalLastChildIncludes
(
'Ballot.delegate(address)'
)
.
journalLastChildIncludes
(
'data: 0x5c1...a733c'
)
.
journalLastChildIncludes
(
'data: 0x5c1...a733c'
)
.
clickFunction
(
'winnerName - call'
)
// Test in terminal
.
testFunction
(
'last'
,
{
'decoded output'
:
{
"0"
:
"bytes32: winnerName_ 0x48656c6c6f20576f726c64210000000000000000000000000000000000000000"
}
})
// Test in Udapp UI
.
assert
.
containsText
(
'*[data-id="treeViewDiv0"]'
,
"bytes32: winnerName_ 0x48656c6c6f20576f726c64210000000000000000000000000000000000000000"
)
.
end
()
.
end
()
}
}
}
}
...
...
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