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
f5ee5b59
Commit
f5ee5b59
authored
Apr 28, 2020
by
ioedeveloper
Committed by
Liana Husikyan
Apr 29, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed display of label for multiple test suites and removed output box for passing tests
parent
71ccc7a0
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
14 deletions
+36
-14
test-tab.js
src/app/tabs/test-tab.js
+35
-13
init.js
test-browser/helpers/init.js
+1
-1
No files found.
src/app/tabs/test-tab.js
View file @
f5ee5b59
...
@@ -128,9 +128,14 @@ module.exports = class TestTab extends ViewPlugin {
...
@@ -128,9 +128,14 @@ module.exports = class TestTab extends ViewPlugin {
this
.
testsOutput
.
hidden
=
false
this
.
testsOutput
.
hidden
=
false
if
(
result
.
type
===
'contract'
)
{
if
(
result
.
type
===
'contract'
)
{
this
.
testSuite
=
result
.
value
this
.
testSuite
=
result
.
value
if
(
this
.
testSuites
)
{
this
.
testSuites
.
push
(
this
.
testSuite
)
}
else
{
this
.
testSuites
=
[
this
.
testSuite
]
}
this
.
rawFileName
=
result
.
filename
this
.
rawFileName
=
result
.
filename
this
.
runningTestFileName
=
this
.
cleanFileName
(
this
.
rawFileName
)
this
.
runningTestFileName
=
this
.
cleanFileName
(
this
.
rawFileName
,
this
.
testSuite
)
this
.
outputHeader
=
yo
`<div class="
${
css
.
outputTitle
}
">
${
this
.
testSuite
}
<br />
${
this
.
rawFileName
}
</div>`
this
.
outputHeader
=
yo
`<div
id="
${
this
.
runningTestFileName
}
"
class="
${
css
.
outputTitle
}
">
${
this
.
testSuite
}
<br />
${
this
.
rawFileName
}
</div>`
this
.
testsOutput
.
appendChild
(
this
.
outputHeader
)
this
.
testsOutput
.
appendChild
(
this
.
outputHeader
)
}
else
if
(
result
.
type
===
'testPass'
)
{
}
else
if
(
result
.
type
===
'testPass'
)
{
this
.
testsOutput
.
appendChild
(
yo
`<div class="
${
css
.
testPass
}
${
css
.
testLog
}
alert-success bg-transparent border-0">✓
${
result
.
value
}
</div>`
)
this
.
testsOutput
.
appendChild
(
yo
`<div class="
${
css
.
testPass
}
${
css
.
testLog
}
alert-success bg-transparent border-0">✓
${
result
.
value
}
</div>`
)
...
@@ -150,19 +155,19 @@ module.exports = class TestTab extends ViewPlugin {
...
@@ -150,19 +155,19 @@ module.exports = class TestTab extends ViewPlugin {
cb
()
cb
()
}
}
cleanFileName
(
fileName
)
{
cleanFileName
(
fileName
,
testSuite
)
{
return
fileName
?
fileName
.
replace
(
/
\/
/g
,
'_'
).
replace
(
/
\.
/g
,
'_'
)
:
fileName
return
fileName
?
fileName
.
replace
(
/
\/
/g
,
'_'
).
replace
(
/
\.
/g
,
'_'
)
+
testSuite
:
fileName
}
}
setHeader
(
status
)
{
setHeader
(
status
)
{
if
(
status
)
{
if
(
status
)
{
const
label
=
yo
`<div class="alert-success d-inline-block mb-1 mr-1 p-1 passed_
${
this
.
runningTestFileName
}
">PASS</div>`
const
label
=
yo
`<div class="alert-success d-inline-block mb-1 mr-1 p-1 passed_
${
this
.
runningTestFileName
}
">PASS</div>`
this
.
outputHeader
&&
yo
.
update
(
this
.
outputHeader
,
yo
`<div class="
${
css
.
outputTitle
}
">
${
label
}
${
this
.
testSuite
}
<br />
${
this
.
rawFileName
}
</div>`
)
this
.
outputHeader
&&
yo
.
update
(
this
.
outputHeader
,
yo
`<div
id="
${
this
.
runningTestFileName
}
"
class="
${
css
.
outputTitle
}
">
${
label
}
${
this
.
testSuite
}
<br />
${
this
.
rawFileName
}
</div>`
)
}
else
{
}
else
{
const
label
=
yo
`<div class="alert-danger d-inline-block mb-1 mr-1 p-1 failed_
${
this
.
runningTestFileName
}
">FAIL</div>`
const
label
=
yo
`<div class="alert-danger d-inline-block mb-1 mr-1 p-1 failed_
${
this
.
runningTestFileName
}
">FAIL</div>`
this
.
outputHeader
&&
yo
.
update
(
this
.
outputHeader
,
yo
`<div class="
${
css
.
outputTitle
}
">
${
label
}
${
this
.
testSuite
}
<br />
${
this
.
rawFileName
}
</div>`
)
this
.
outputHeader
&&
yo
.
update
(
this
.
outputHeader
,
yo
`<div
id="
${
this
.
runningTestFileName
}
"
class="
${
css
.
outputTitle
}
">
${
label
}
${
this
.
testSuite
}
<br />
${
this
.
rawFileName
}
</div>`
)
}
}
}
}
...
@@ -185,24 +190,41 @@ module.exports = class TestTab extends ViewPlugin {
...
@@ -185,24 +190,41 @@ module.exports = class TestTab extends ViewPlugin {
if
(
result
)
{
if
(
result
)
{
if
(
result
.
totalPassing
>
0
&&
result
.
totalFailing
>
0
)
{
if
(
result
.
totalPassing
>
0
&&
result
.
totalFailing
>
0
)
{
this
.
testsOutput
.
appendChild
(
yo
`<div class="text-success">
${
result
.
totalPassing
}
passing, <span class="text-danger">
${
result
.
totalFailing
}
failing </span> (
${
result
.
totalTime
}
s)</div>`
)
this
.
testsOutput
.
appendChild
(
yo
`<div class="text-success">
${
result
.
totalPassing
}
passing, <span class="text-danger">
${
result
.
totalFailing
}
failing </span> (
${
result
.
totalTime
}
s)</div>`
)
if
(
this
.
rawFileName
===
filename
)
this
.
setHeader
(
false
)
}
else
if
(
result
.
totalPassing
>
0
&&
result
.
totalFailing
<=
0
)
{
}
else
if
(
result
.
totalPassing
>
0
&&
result
.
totalFailing
<=
0
)
{
this
.
testsOutput
.
appendChild
(
yo
`<div class="text-success">
${
result
.
totalPassing
}
passing (
${
result
.
totalTime
}
s)</div>`
)
this
.
testsOutput
.
appendChild
(
yo
`<div class="text-success">
${
result
.
totalPassing
}
passing (
${
result
.
totalTime
}
s)</div>`
)
if
(
this
.
rawFileName
===
filename
)
this
.
setHeader
(
true
)
}
else
if
(
result
.
totalPassing
<=
0
&&
result
.
totalFailing
>
0
)
{
}
else
if
(
result
.
totalPassing
<=
0
&&
result
.
totalFailing
>
0
)
{
this
.
testsOutput
.
appendChild
(
yo
`<div class="text-danger">
${
result
.
totalFailing
}
failing</div>`
)
this
.
testsOutput
.
appendChild
(
yo
`<div class="text-danger">
${
result
.
totalFailing
}
failing</div>`
)
if
(
this
.
rawFileName
===
filename
)
this
.
setHeader
(
false
)
}
}
//fix for displaying right label for multiple tests (testsuites) in a single file
this
.
testSuites
.
forEach
(
testSuite
=>
{
this
.
testSuite
=
testSuite
this
.
runningTestFileName
=
this
.
cleanFileName
(
filename
,
this
.
testSuite
)
this
.
outputHeader
=
document
.
querySelector
(
`#
${
this
.
runningTestFileName
}
`
)
this
.
setHeader
(
true
)
})
const
displayError
=
yo
`<div class="sol error alert alert-danger"></div>`
const
displayError
=
yo
`<div class="sol error alert alert-danger"></div>`
result
.
errors
.
forEach
((
error
,
index
)
=>
{
result
.
errors
.
forEach
((
error
,
index
)
=>
{
displayError
.
appendChild
(
yo
`<div>
this
.
testSuite
=
error
.
context
<ul type="disc" class="ml-3 mb-0"><li>
${
error
.
value
}
</li></ul>
this
.
runningTestFileName
=
this
.
cleanFileName
(
filename
,
error
.
context
)
this
.
outputHeader
=
document
.
querySelector
(
`#
${
this
.
runningTestFileName
}
`
)
const
isFailingLabel
=
document
.
querySelector
(
`.failed_
${
this
.
runningTestFileName
}
`
)
if
(
!
isFailingLabel
)
this
.
setHeader
(
false
)
displayError
.
appendChild
(
yo
`
<div>
<ul class="ml-3 mb-0">
<li>
${
error
.
value
}
</li>
</ul>
<span class="text-danger ml-3">
${
error
.
message
}
</span>
<span class="text-danger ml-3">
${
error
.
message
}
</span>
</div>`
)
</div>
`
)
})
})
if
(
result
.
errors
&&
result
.
errors
.
length
>
0
)
{
this
.
testsOutput
.
appendChild
(
displayError
)
this
.
testsOutput
.
appendChild
(
displayError
)
}
}
this
.
testsOutput
.
appendChild
(
yo
`<div><br /><p class="text-info border-top m-0"></p></div>`
)
}
if
(
this
.
hasBeenStopped
&&
(
this
.
readyTestsNumber
!==
this
.
runningTestsNumber
))
{
if
(
this
.
hasBeenStopped
&&
(
this
.
readyTestsNumber
!==
this
.
runningTestsNumber
))
{
// if all tests has been through before stopping no need to print this.
// if all tests has been through before stopping no need to print this.
this
.
testsExecutionStopped
.
hidden
=
false
this
.
testsExecutionStopped
.
hidden
=
false
...
@@ -416,7 +438,7 @@ module.exports = class TestTab extends ViewPlugin {
...
@@ -416,7 +438,7 @@ module.exports = class TestTab extends ViewPlugin {
render () {
render () {
this.onActivationInternal()
this.onActivationInternal()
this.testsOutput = yo`
<
div
class
=
"mx-3 mb-2 border-top border-
bottom border-
primary"
hidden
=
'true'
id
=
"solidityUnittestsOutput"
data
-
id
=
"testTabSolidityUnitTestsOutput"
><
/a>
`
this.testsOutput = yo`
<
div
class
=
"mx-3 mb-2 border-top border-primary"
hidden
=
'true'
id
=
"solidityUnittestsOutput"
data
-
id
=
"testTabSolidityUnitTestsOutput"
><
/a>
`
this
.
testsExecutionStopped
=
yo
`<label class="text-warning h6">The test execution has been stopped</label>`
this
.
testsExecutionStopped
=
yo
`<label class="text-warning h6">The test execution has been stopped</label>`
this
.
testsExecutionStopped
.
hidden
=
true
this
.
testsExecutionStopped
.
hidden
=
true
this
.
resultStatistics
=
this
.
createResultLabel
()
this
.
resultStatistics
=
this
.
createResultLabel
()
...
...
test-browser/helpers/init.js
View file @
f5ee5b59
...
@@ -24,7 +24,7 @@ module.exports = function (browser, callback, url, preloadPlugins = true) {
...
@@ -24,7 +24,7 @@ module.exports = function (browser, callback, url, preloadPlugins = true) {
}
}
function
initModules
(
browser
,
callback
)
{
function
initModules
(
browser
,
callback
)
{
browser
.
pause
(
20
000
)
browser
.
pause
(
5
000
)
.
click
(
'#icon-panel div[plugin="pluginManager"]'
)
.
click
(
'#icon-panel div[plugin="pluginManager"]'
)
.
scrollAndClick
(
'#pluginManager article[id="remixPluginManagerListItem_solidity"] button'
)
.
scrollAndClick
(
'#pluginManager article[id="remixPluginManagerListItem_solidity"] button'
)
.
pause
(
5000
)
.
pause
(
5000
)
...
...
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