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
9a8a82b0
Commit
9a8a82b0
authored
Oct 08, 2021
by
Aniket-Engg
Committed by
Aniket
Oct 15, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
e2e tests updated
parent
70ad1a35
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
8 deletions
+19
-8
solidityUnittests.spec.ts
apps/remix-ide-e2e/src/tests/solidityUnittests.spec.ts
+18
-7
test-tab.js
apps/remix-ide/src/app/tabs/test-tab.js
+1
-1
No files found.
apps/remix-ide-e2e/src/tests/solidityUnittests.spec.ts
View file @
9a8a82b0
...
...
@@ -229,7 +229,7 @@ module.exports = {
.
removeFile
(
'tests/ballotFailedLog_test.sol'
,
'workspace_new'
)
},
'Debug
failed test
using debugger'
:
function
(
browser
:
NightwatchBrowser
)
{
'Debug
tests
using debugger'
:
function
(
browser
:
NightwatchBrowser
)
{
browser
.
waitForElementPresent
(
'*[data-id="verticalIconsKindfilePanel"]'
)
.
addFile
(
'tests/ballotFailedDebug_test.sol'
,
sources
[
0
][
'tests/ballotFailedDebug_test.sol'
])
...
...
@@ -239,17 +239,19 @@ module.exports = {
.
click
(
'#runTestsTabRunAction'
)
.
waitForElementVisible
(
'*[data-id="testTabSolidityUnitTestsOutputheader"]'
,
120000
)
.
waitForElementContainsText
(
'#solidityUnittestsOutput'
,
'tests/ballotFailedDebug_test.sol'
,
60000
)
.
waitForElementContainsText
(
'#solidityUnittestsOutput'
,
'✘ Check winning proposal'
,
60000
)
.
waitForElementContainsText
(
'#solidityUnittestsOutput'
,
'✘ Check winning proposal failed'
,
60000
)
.
waitForElementContainsText
(
'#solidityUnittestsOutput'
,
'✓ Check winnin proposal passed'
,
60000
)
.
waitForElementContainsText
(
'#solidityUnittestsOutput'
,
'✘ Check winnin proposal again'
,
60000
)
.
waitForElementContainsText
(
'#solidityUnittestsOutput'
,
'✓ Check winnin proposal with return value'
,
60000
)
.
click
(
'
.fa-bug
'
)
.
click
(
'
#Check_winning_proposal_failed > i
'
)
.
waitForElementContainsText
(
'*[data-id="sidePanelSwapitTitle"]'
,
'DEBUGGER'
,
60000
)
.
waitForElementContainsText
(
'*[data-id="functionPanel"]'
,
'checkWinningProposal()'
,
60000
)
.
waitForElementContainsText
(
'*[data-id="functionPanel"]'
,
'checkWinningProposal
Failed
()'
,
60000
)
.
click
(
'*[data-id="dropdownPanelSolidityLocals"]'
)
.
waitForElementContainsText
(
'*[data-id="solidityLocals"]'
,
'no locals'
,
60000
)
// eslint-disable-next-line dot-notation
.
execute
(
function
()
{
document
.
getElementById
(
'slider'
)[
'value'
]
=
'235'
})
// It only moves slider to 235 but vm traces are not updated
.
setValue
(
'*[data-id="slider"]'
,
new
Array
(
1
).
fill
(
browser
.
Keys
.
RIGHT_ARROW
))
.
waitForElementContainsText
(
'*[data-id="functionPanel"]'
,
'checkWinningProposal()'
,
60000
)
.
waitForElementContainsText
(
'*[data-id="functionPanel"]'
,
'checkWinningProposal
Failed
()'
,
60000
)
.
waitForElementContainsText
(
'*[data-id="functionPanel"]'
,
'vote(proposal)'
,
60000
)
.
pause
(
2000
)
.
checkVariableDebug
(
'soliditylocals'
,
locals
)
...
...
@@ -495,11 +497,20 @@ const sources = [
ballotToTest = new Ballot(proposalNames);
}
function checkWinningProposal () public {
ballotToTest.vote(1);
// This will revert the transaction
function checkWinningProposal
Failed
() public {
ballotToTest.vote(1);
Assert.equal(ballotToTest.winningProposal(), uint(0), "proposal at index 0 should be the winning proposal");
}
function checkWinningProposalPassed () public {
ballotToTest.vote(0);
Assert.equal(ballotToTest.winningProposal(), uint(0), "proposal at index 0 should be the winning proposal");
}
function checkWinningProposalAgain () public {
Assert.equal(ballotToTest.winningProposal(), uint(1), "proposal at index 0 should be the winning proposal");
}
function checkWinninProposalWithReturnValue () public view returns (bool) {
return ballotToTest.winningProposal() == 0;
}
...
...
apps/remix-ide/src/app/tabs/test-tab.js
View file @
9a8a82b0
...
...
@@ -250,7 +250,7 @@ module.exports = class TestTab extends ViewPlugin {
let
debugBtn
=
yo
``
if
((
result
.
type
===
'testPass'
||
result
.
type
===
'testFailure'
)
&&
result
.
debugTxHash
)
{
const
{
web3
,
debugTxHash
}
=
result
debugBtn
=
yo
`<div class="btn border btn btn-sm ml-1" title="Start debugging" onclick=
${()
=>
this
.
startDebug
(
debugTxHash
,
web3
)}
>
debugBtn
=
yo
`<div
id=
${
result
.
value
.
replace
(
' '
,
'_'
)}
class="btn border btn btn-sm ml-1" title="Start debugging" onclick=
${()
=>
this
.
startDebug
(
debugTxHash
,
web3
)}
>
<i class="fas fa-bug"></i>
</div>`
debugBtn
.
style
.
cursor
=
'pointer'
...
...
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