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
70f83c00
Commit
70f83c00
authored
Apr 16, 2020
by
ioedeveloper
Committed by
Aniket
Apr 17, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Separated failing cases into single tests
parent
87290c2b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
5 deletions
+26
-5
solidityUnittests.js
test-browser/tests/solidityUnittests.js
+26
-5
No files found.
test-browser/tests/solidityUnittests.js
View file @
70f83c00
...
...
@@ -62,11 +62,16 @@ module.exports = {
.
click
(
'*[data-id="testTabCheckAllTests"]'
)
.
click
(
'.singleTestLabel:nth-of-type(3)'
)
.
scrollAndClick
(
'*[data-id="testTabRunTestsTabRunAction"]'
)
.
pause
(
15
000
)
.
pause
(
20
000
)
.
assert
.
containsText
(
'*[data-id="testTabSolidityUnitTestsOutput"]'
,
'browser/ks2b_test.sol (kickstarterTest)'
)
.
assert
.
containsText
(
'*[data-id="testTabSolidityUnitTestsOutput"]'
,
'✘ (Check project exists)'
)
.
assert
.
containsText
(
'*[data-id="testTabSolidityUnitTestsOutput"]'
,
'✓ (Check project exists)'
)
.
assert
.
containsText
(
'*[data-id="testTabSolidityUnitTestsOutput"]'
,
'✘ (Check wrong project owner)'
)
.
assert
.
containsText
(
'*[data-id="testTabSolidityUnitTestsOutput"]'
,
'✘ (Check wrong sender)'
)
.
assert
.
containsText
(
'*[data-id="testTabSolidityUnitTestsOutput"]'
,
'✘ (Check wrong value)'
)
.
assert
.
containsText
(
'*[data-id="testTabSolidityUnitTestsOutput"]'
,
'✓ (Check project is fundable)'
)
.
assert
.
containsText
(
'*[data-id="testTabSolidityUnitTestsSummary"]'
,
'owner is incorrect'
)
.
assert
.
containsText
(
'*[data-id="testTabSolidityUnitTestsSummary"]'
,
'wrong sender'
)
.
assert
.
containsText
(
'*[data-id="testTabSolidityUnitTestsSummary"]'
,
'wrong value'
)
},
'Should fail on compilation'
:
function
(
browser
)
{
...
...
@@ -265,14 +270,30 @@ var sources = [
(address owner, string memory name, uint goal, uint fundsAvailable, uint amountContributed, Kickstarter.State state) = kickstarter.projects(0);
Assert.equal(name, "ProjectA", "project name is incorrect");
Assert.equal(goal, 123000, "funding goal is incorrect");
Assert.equal(owner, TestsAccounts.getAccount(0), "owner is incorrect"); //failing case
Assert.equal(owner, address(this), "owner is incorrect");
Assert.equal(msg.sender, TestsAccounts.getAccount(0), "wrong sender"); //failing case
Assert.equal(msg.sender, TestsAccounts.getAccount(1), "wrong sender");
Assert.equal(msg.value, 5000000, "wrong value"); //failing case
Assert.equal(msg.value, 10000000, "wrong value");
}
/// #sender: account-1
/// #value: 10000000
function checkWrongProjectOwner () public payable {
(address owner,,,,,) = kickstarter.projects(0);
Assert.equal(owner, TestsAccounts.getAccount(0), "owner is incorrect"); //failing case
}
/// #sender: account-1
/// #value: 10000000
function checkWrongSender () public payable {
Assert.equal(msg.sender, TestsAccounts.getAccount(0), "wrong sender"); //failing case
}
/// #sender: account-1
/// #value: 10000000
function checkWrongValue () public payable {
Assert.equal(msg.value, 5000000, "wrong value"); //failing case
}
function checkProjectIsFundable () public {
kickstarter.fundProject.value(120000)(0);
(address owner, string memory name, uint goal, uint fundsAvailable, uint amountContributed, Kickstarter.State state) = kickstarter.projects(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