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
df362b90
Commit
df362b90
authored
Apr 20, 2020
by
LianaHus
Committed by
Aniket
Apr 24, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
disable Stop:
parent
8fec5d48
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
20 deletions
+27
-20
test-tab.js
src/app/tabs/test-tab.js
+27
-20
No files found.
src/app/tabs/test-tab.js
View file @
df362b90
...
@@ -150,18 +150,25 @@ module.exports = class TestTab extends ViewPlugin {
...
@@ -150,18 +150,25 @@ module.exports = class TestTab extends ViewPlugin {
this
.
testsSummary
.
appendChild
(
yo
`<div class="text-success" >
${
result
.
totalPassing
}
passing (
${
result
.
totalTime
}
s)</div>`
)
this
.
testsSummary
.
appendChild
(
yo
`<div class="text-success" >
${
result
.
totalPassing
}
passing (
${
result
.
totalTime
}
s)</div>`
)
this
.
testsSummary
.
appendChild
(
yo
`<br>`
)
this
.
testsSummary
.
appendChild
(
yo
`<br>`
)
}
}
if
(
result
.
totalFailing
>
0
)
{
if
(
result
)
{
this
.
testsSummary
.
appendChild
(
yo
`<div class="text-danger" >
${
result
.
totalFailing
}
failing</div>`
)
if
(
result
.
totalFailing
>
0
)
{
this
.
testsSummary
.
appendChild
(
yo
`<br>`
)
this
.
testsSummary
.
appendChild
(
yo
`<div class="text-danger" >
${
result
.
totalFailing
}
failing</div>`
)
this
.
testsSummary
.
appendChild
(
yo
`<br>`
)
}
result
.
errors
.
forEach
((
error
,
index
)
=>
{
this
.
testsSummary
.
appendChild
(
yo
`<div class="text-danger" >
${
error
.
context
}
-
${
error
.
value
}
</div>`
)
this
.
testsSummary
.
appendChild
(
yo
`<div class="
${
css
.
testFailureSummary
}
text-danger" >
${
error
.
message
}
</div>`
)
this
.
testsSummary
.
appendChild
(
yo
`<br>`
)
})
}
}
result
.
errors
.
forEach
((
error
,
index
)
=>
{
this
.
testsSummary
.
appendChild
(
yo
`<div class="text-danger" >
${
error
.
context
}
-
${
error
.
value
}
</div>`
)
this
.
testsSummary
.
appendChild
(
yo
`<div class="
${
css
.
testFailureSummary
}
text-danger" >
${
error
.
message
}
</div>`
)
this
.
testsSummary
.
appendChild
(
yo
`<br>`
)
})
if
(
this
.
hasBeenStopped
)
{
if
(
this
.
hasBeenStopped
)
{
this
.
testsSummary
.
appendChild
(
yo
`<label class="text-warning h5">The test execution has been stopped</label>`
)
this
.
testsSummary
.
appendChild
(
yo
`<label class="text-warning h5">The test execution has been stopped</label>`
)
}
}
const
stopBtn
=
document
.
getElementById
(
'runTestsTabStopAction'
)
const
stopBtnLabel
=
document
.
getElementById
(
'runTestsTabStopActionLabel'
)
stopBtnLabel
.
innerText
=
'Stop'
stopBtn
.
setAttribute
(
'disabled'
,
'disabled'
)
}
}
async
testFromPath
(
path
)
{
async
testFromPath
(
path
)
{
...
@@ -229,6 +236,9 @@ module.exports = class TestTab extends ViewPlugin {
...
@@ -229,6 +236,9 @@ module.exports = class TestTab extends ViewPlugin {
}
}
runTests
()
{
runTests
()
{
this
.
hasBeenStopped
=
false
;
const
stopBtn
=
document
.
getElementById
(
'runTestsTabStopAction'
)
stopBtn
.
removeAttribute
(
'disabled'
)
this
.
call
(
'editor'
,
'clearAnnotations'
)
this
.
call
(
'editor'
,
'clearAnnotations'
)
this
.
testsOutput
.
innerHTML
=
''
this
.
testsOutput
.
innerHTML
=
''
this
.
testsSummary
.
innerHTML
=
''
this
.
testsSummary
.
innerHTML
=
''
...
@@ -240,6 +250,8 @@ module.exports = class TestTab extends ViewPlugin {
...
@@ -240,6 +250,8 @@ module.exports = class TestTab extends ViewPlugin {
stopTests
()
{
stopTests
()
{
this
.
hasBeenStopped
=
true
this
.
hasBeenStopped
=
true
const
stopBtnLabel
=
document
.
getElementById
(
'runTestsTabStopActionLabel'
)
stopBtnLabel
.
innerText
=
'Stopping...'
}
}
updateGenerateFileAction
(
currentFile
)
{
updateGenerateFileAction
(
currentFile
)
{
...
@@ -258,9 +270,9 @@ module.exports = class TestTab extends ViewPlugin {
...
@@ -258,9 +270,9 @@ module.exports = class TestTab extends ViewPlugin {
updateRunAction
(
currentFile
)
{
updateRunAction
(
currentFile
)
{
let
el
=
yo
`
let
el
=
yo
`
<button id="runTestsTabRunAction" data-id="testTabRunTestsTabRunAction" class="w-50 btn btn-primary" onclick="
${()
=>
{
this
.
hasBeenStopped
=
false
;
this
.
runTests
()
}
}
">
<button id="runTestsTabRunAction" data-id="testTabRunTestsTabRunAction" class="w-50 btn btn-primary" onclick="
${()
=>
this
.
runTests
()
}
">
<span class="fas fa-play ml-2"></span>
<span class="fas fa-play ml-2"></span>
<label class="
btn
b
tn
-
primary
p
-
1
ml
-
2
m
-
0
">Run</label>
<label class="btn b
g-transparent
p-1 ml-2 m-0">Run</label>
</button>
</button>
`
`
const
isSolidityActive
=
this
.
appManager
.
actives
.
includes
(
'solidity'
)
const
isSolidityActive
=
this
.
appManager
.
actives
.
includes
(
'solidity'
)
...
@@ -281,17 +293,12 @@ module.exports = class TestTab extends ViewPlugin {
...
@@ -281,17 +293,12 @@ module.exports = class TestTab extends ViewPlugin {
}
}
updateStopAction
()
{
updateStopAction
()
{
const runBtn = document.getElementById('runTestsTabRunAction')
return
yo
`
const stopBtn = yo`
<button id="runTestsTabStopAction" class="w-50 pl-2 ml-2 btn btn-secondary" disabled="disabled" title="Stop running tests" onclick=
${()
=>
this
.
stopTests
()}
">
<button id="
runTestsTabStopAction
" class="
w
-
50
pl
-
2
ml
-
2
btn
btn
-
secondary
" title="
Stop
running
tests
" onclick=${() => this.stopTests()}"
>
<span class="fas fa-stop ml-2"></span>
<
span
class
=
"fas fa-stop ml-2"
><
/span
>
<label class="btn bg-transparent p-1 ml-2 m-0" id="runTestsTabStopActionLabel">Stop</label>
<
label
class
=
"btn btn-secondary p-1 ml-2 m-0"
>
Stop
<
/label
>
</button>
<
/button
>
`
`
if (runBtn && runBtn.getAttribute('disabled')) {
runBtn.setAttribute('disabled', 'disabled')
}
return stopBtn
}
}
updateTestFileList
(
tests
)
{
updateTestFileList
(
tests
)
{
...
...
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