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
348f2d6a
Commit
348f2d6a
authored
Sep 08, 2021
by
aniket-engg
Committed by
yann300
Sep 08, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
e2e tests for hh logs in SUT plugin
parent
cfa0530e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
0 deletions
+48
-0
solidityUnittests.spec.ts
apps/remix-ide-e2e/src/tests/solidityUnittests.spec.ts
+48
-0
No files found.
apps/remix-ide-e2e/src/tests/solidityUnittests.spec.ts
View file @
348f2d6a
...
@@ -183,6 +183,29 @@ module.exports = {
...
@@ -183,6 +183,29 @@ module.exports = {
.
waitForElementContainsText
(
'#solidityUnittestsOutput'
,
'✓ Check winnin proposal with return value'
,
60000
)
.
waitForElementContainsText
(
'#solidityUnittestsOutput'
,
'✓ Check winnin proposal with return value'
,
60000
)
},
},
'Solidity Unit tests with hardhat console log'
:
function
(
browser
:
NightwatchBrowser
)
{
browser
.
waitForElementPresent
(
'*[data-id="verticalIconsKindfilePanel"]'
)
.
addFile
(
'tests/hhLogs_test.sol'
,
sources
[
0
][
'tests/hhLogs_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
)
.
waitForElementPresent
(
'#solidityUnittestsOutput div[class^="testPass"]'
,
60000
)
.
waitForElementContainsText
(
'#solidityUnittestsOutput'
,
'tests/hhLogs_test.sol'
,
60000
)
.
assert
.
containsText
(
'#journal > div:nth-child(3) > span > div'
,
'Before all:'
)
.
assert
.
containsText
(
'#journal > div:nth-child(3) > span > div'
,
'Inside beforeAll'
)
.
assert
.
containsText
(
'#journal > div:nth-child(4) > span > div'
,
'Check sender:'
)
.
assert
.
containsText
(
'#journal > div:nth-child(4) > span > div'
,
'msg.sender is 0x5B38Da6a701c568545dCfcB03FcB875f56beddC4'
)
.
assert
.
containsText
(
'#journal > div:nth-child(5) > span > div'
,
'Check int logs:'
)
.
assert
.
containsText
(
'#journal > div:nth-child(5) > span > div'
,
'10 20'
)
.
assert
.
containsText
(
'#journal > div:nth-child(5) > span > div'
,
'Number is 25'
)
.
openFile
(
'tests/hhLogs_test.sol'
)
.
removeFile
(
'tests/hhLogs_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"]'
)
...
@@ -458,6 +481,31 @@ const sources = [
...
@@ -458,6 +481,31 @@ const sources = [
return ballotToTest.winningProposal() == 0;
return ballotToTest.winningProposal() == 0;
}
}
}`
}`
},
'tests/hhLogs_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 "hardhat/console.sol";
contract hhLogs {
function beforeAll () public {
console.log('Inside beforeAll');
}
function checkSender () public {
console.log('msg.sender is %s', msg.sender);
Assert.ok(true, "should be true");
}
function checkIntLogs () public {
console.log(10,20);
console.log('Number is %d', 25);
Assert.ok(true, "should be true");
}
}`
}
}
}
}
]
]
...
...
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