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
718a2cd9
Commit
718a2cd9
authored
Sep 22, 2021
by
aniket-engg
Committed by
Aniket
Sep 23, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
e2e tests added
parent
9e3216ee
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
0 deletions
+42
-0
solidityUnittests.spec.ts
apps/remix-ide-e2e/src/tests/solidityUnittests.spec.ts
+42
-0
No files found.
apps/remix-ide-e2e/src/tests/solidityUnittests.spec.ts
View file @
718a2cd9
...
@@ -207,6 +207,23 @@ module.exports = {
...
@@ -207,6 +207,23 @@ module.exports = {
.
removeFile
(
'tests/hhLogs_test.sol'
,
'workspace_new'
)
.
removeFile
(
'tests/hhLogs_test.sol'
,
'workspace_new'
)
},
},
'Solidity Unit tests with hardhat console log for EVM revert'
:
function
(
browser
:
NightwatchBrowser
)
{
browser
.
waitForElementPresent
(
'*[data-id="verticalIconsKindfilePanel"]'
)
.
addFile
(
'tests/ballotFailedLog_test.sol'
,
sources
[
0
][
'tests/ballotFailedLog_test.sol'
])
.
clickLaunchIcon
(
'solidityUnitTesting'
)
.
waitForElementVisible
(
'*[id="singleTesttests/4_Ballot_test.sol"]'
,
60000
)
.
click
(
'*[id="singleTesttests/4_Ballot_test.sol"]'
)
.
click
(
'#runTestsTabRunAction'
)
.
pause
(
2000
)
.
waitForElementVisible
(
'*[data-id="testTabSolidityUnitTestsOutputheader"]'
,
120000
)
.
waitForElementContainsText
(
'#solidityUnittestsOutput'
,
'tests/ballotFailedLog_test.sol'
,
60000
)
.
assert
.
containsText
(
'#journal > div:nth-child(6) > span > div'
,
'Check winning proposal:'
)
.
assert
.
containsText
(
'#journal > div:nth-child(6) > span > div'
,
'Inside checkWinningProposal'
)
.
openFile
(
'tests/ballotFailedLog_test.sol'
)
.
removeFile
(
'tests/ballotFailedLog_test.sol'
,
'workspace_new'
)
},
'Debug failed test using debugger'
:
function
(
browser
:
NightwatchBrowser
)
{
'Debug failed test using debugger'
:
function
(
browser
:
NightwatchBrowser
)
{
browser
browser
.
waitForElementPresent
(
'*[data-id="verticalIconsKindfilePanel"]'
)
.
waitForElementPresent
(
'*[data-id="verticalIconsKindfilePanel"]'
)
...
@@ -483,6 +500,31 @@ const sources = [
...
@@ -483,6 +500,31 @@ const sources = [
}
}
}`
}`
},
},
'tests/ballotFailedLog_test.sol'
:
{
content
:
`// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0 <0.9.0;
import "remix_tests.sol"; // this import is automatically injected by Remix.
import "../contracts/3_Ballot.sol";
import "hardhat/console.sol";
contract BallotTest {
bytes32[] proposalNames;
Ballot ballotToTest;
function beforeAll () public {
proposalNames.push(bytes32("candidate1"));
ballotToTest = new Ballot(proposalNames);
}
function checkWinningProposal () public {
console.log("Inside checkWinningProposal");
ballotToTest.vote(1); // This will revert the transaction
}
}`
},
'tests/hhLogs_test.sol'
:
{
'tests/hhLogs_test.sol'
:
{
content
:
`// SPDX-License-Identifier: GPL-3.0
content
:
`// SPDX-License-Identifier: GPL-3.0
...
...
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