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
9ad00485
Commit
9ad00485
authored
Apr 22, 2020
by
LianaHus
Committed by
Aniket
Apr 24, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ignore checkboxes
parent
47e35676
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
10 deletions
+20
-10
test-tab.js
src/app/tabs/test-tab.js
+20
-10
No files found.
src/app/tabs/test-tab.js
View file @
9ad00485
...
@@ -30,6 +30,8 @@ module.exports = class TestTab extends ViewPlugin {
...
@@ -30,6 +30,8 @@ module.exports = class TestTab extends ViewPlugin {
this
.
appManager
=
appManager
this
.
appManager
=
appManager
this
.
renderer
=
renderer
this
.
renderer
=
renderer
this
.
hasBeenStopped
=
false
this
.
hasBeenStopped
=
false
this
.
runningTestsNumber
=
0
this
.
readyTestsNumber
=
0
this
.
baseurl
=
'https://solc-bin.ethereum.org/bin'
this
.
baseurl
=
'https://solc-bin.ethereum.org/bin'
appManager
.
event
.
on
(
'activate'
,
(
name
)
=>
{
appManager
.
event
.
on
(
'activate'
,
(
name
)
=>
{
if
(
name
===
'solidity'
)
this
.
updateRunAction
(
fileManager
.
currentFile
())
if
(
name
===
'solidity'
)
this
.
updateRunAction
(
fileManager
.
currentFile
())
...
@@ -94,8 +96,10 @@ module.exports = class TestTab extends ViewPlugin {
...
@@ -94,8 +96,10 @@ module.exports = class TestTab extends ViewPlugin {
if
(
eChecked
)
{
if
(
eChecked
)
{
checkAll
.
checked
=
true
checkAll
.
checked
=
true
runBtn
.
removeAttribute
(
'disabled'
)
if
((
this
.
readyTestsNumber
===
this
.
runningTestsNumber
||
this
.
hasBeenStopped
)
&&
document
.
getElementById
(
'runTestsTabStopAction'
).
innerText
===
'Stop'
)
{
runBtn
.
setAttribute
(
'title'
,
'Run tests'
)
runBtn
.
removeAttribute
(
'disabled'
)
runBtn
.
setAttribute
(
'title'
,
'Run tests'
)
}
}
else
if
(
!
selectedTests
.
length
)
{
}
else
if
(
!
selectedTests
.
length
)
{
checkAll
.
checked
=
false
checkAll
.
checked
=
false
runBtn
.
setAttribute
(
'disabled'
,
'disabled'
)
runBtn
.
setAttribute
(
'disabled'
,
'disabled'
)
...
@@ -129,6 +133,7 @@ module.exports = class TestTab extends ViewPlugin {
...
@@ -129,6 +133,7 @@ module.exports = class TestTab extends ViewPlugin {
// result.passingNum
// result.passingNum
// result.failureNum
// result.failureNum
// result.timePassed
// result.timePassed
this
.
testsSummary
.
hidden
=
false
cb
()
cb
()
}
}
...
@@ -164,17 +169,19 @@ module.exports = class TestTab extends ViewPlugin {
...
@@ -164,17 +169,19 @@ module.exports = class TestTab extends ViewPlugin {
this
.
testsSummary
.
appendChild
(
yo
`<br>`
)
this
.
testsSummary
.
appendChild
(
yo
`<br>`
)
})
})
}
}
if
(
this
.
hasBeenStopped
)
{
if
(
this
.
hasBeenStopped
&&
(
this
.
readyTestsNumber
!==
this
.
runningTestsNumber
)
)
{
this
.
testsExecutionStopped
.
hidden
=
false
this
.
testsExecutionStopped
.
hidden
=
false
}
}
if
(
this
.
hasBeenStopped
||
this
.
readyTestsNumber
===
this
.
data
.
selectedTests
.
length
)
{
if
(
this
.
hasBeenStopped
||
this
.
readyTestsNumber
===
this
.
runningTestsNumber
)
{
// All tests are ready or the operation has been canceled
// All tests are ready or the operation has been canceled
const
stopBtn
=
document
.
getElementById
(
'runTestsTabStopAction'
)
const
stopBtn
=
document
.
getElementById
(
'runTestsTabStopAction'
)
stopBtn
.
setAttribute
(
'disabled'
,
'disabled'
)
stopBtn
.
setAttribute
(
'disabled'
,
'disabled'
)
const
stopBtnLabel
=
document
.
getElementById
(
'runTestsTabStopActionLabel'
)
const
stopBtnLabel
=
document
.
getElementById
(
'runTestsTabStopActionLabel'
)
stopBtnLabel
.
innerText
=
'Stop'
stopBtnLabel
.
innerText
=
'Stop'
const
runBtn
=
document
.
getElementById
(
'runTestsTabRunAction'
)
if
(
this
.
data
.
selectedTests
.
length
!==
0
)
{
runBtn
.
removeAttribute
(
'disabled'
)
const
runBtn
=
document
.
getElementById
(
'runTestsTabRunAction'
)
runBtn
.
removeAttribute
(
'disabled'
)
}
}
}
}
}
...
@@ -244,6 +251,7 @@ module.exports = class TestTab extends ViewPlugin {
...
@@ -244,6 +251,7 @@ module.exports = class TestTab extends ViewPlugin {
runTests
()
{
runTests
()
{
this
.
hasBeenStopped
=
false
this
.
hasBeenStopped
=
false
this
.
readyTestsNumber
=
0
this
.
readyTestsNumber
=
0
this
.
runningTestsNumber
=
this
.
data
.
selectedTests
.
length
yo
.
update
(
this
.
resultStatistics
,
this
.
createResultLabel
())
yo
.
update
(
this
.
resultStatistics
,
this
.
createResultLabel
())
const
stopBtn
=
document
.
getElementById
(
'runTestsTabStopAction'
)
const
stopBtn
=
document
.
getElementById
(
'runTestsTabStopAction'
)
stopBtn
.
removeAttribute
(
'disabled'
)
stopBtn
.
removeAttribute
(
'disabled'
)
...
@@ -251,7 +259,9 @@ module.exports = class TestTab extends ViewPlugin {
...
@@ -251,7 +259,9 @@ module.exports = class TestTab extends ViewPlugin {
runBtn
.
setAttribute
(
'disabled'
,
'disabled'
)
runBtn
.
setAttribute
(
'disabled'
,
'disabled'
)
this
.
call
(
'editor'
,
'clearAnnotations'
)
this
.
call
(
'editor'
,
'clearAnnotations'
)
this
.
testsOutput
.
innerHTML
=
''
this
.
testsOutput
.
innerHTML
=
''
this
.
testsOutput
.
hidden
=
true
this
.
testsSummary
.
innerHTML
=
''
this
.
testsSummary
.
innerHTML
=
''
this
.
testsSummary
.
hidden
=
true
this
.
testsExecutionStopped
.
hidden
=
true
this
.
testsExecutionStopped
.
hidden
=
true
const
tests
=
this
.
data
.
selectedTests
const
tests
=
this
.
data
.
selectedTests
if
(
!
tests
)
return
if
(
!
tests
)
return
...
@@ -366,14 +376,14 @@ module.exports = class TestTab extends ViewPlugin {
...
@@ -366,14 +376,14 @@ module.exports = class TestTab extends ViewPlugin {
createResultLabel () {
createResultLabel () {
if (!this.data.selectedTests) return yo`
<
span
><
/span>
`
if (!this.data.selectedTests) return yo`
<
span
><
/span>
`
const
ready
=
this
.
readyTestsNumber
?
`
${
this
.
readyTestsNumber
}
`
:
'0'
const
ready
=
this
.
readyTestsNumber
?
`
${
this
.
readyTestsNumber
}
`
:
'0'
return
yo
`<span class='text-info
ml-1'>Progress:
${
ready
}
finished (out of
${
this
.
data
.
selectedTests
.
length
}
)</span>`
return
yo
`<span class='text-info
h6'>Progress:
${
ready
}
finished (of
${
this
.
runningTestsNumber
}
)</span>`
}
}
render () {
render () {
this.onActivationInternal()
this.onActivationInternal()
this.testsOutput = yo`
<
div
class
=
"${css.container} mx-3 border-top border-primary"
hidden
=
'true'
id
=
"solidityUnittestsOutput"
data
-
id
=
"testTabSolidityUnitTestsOutput"
><
/a>
`
this.testsOutput = yo`
<
div
class
=
"${css.container} mx-3 border-top border-primary"
hidden
=
'true'
id
=
"solidityUnittestsOutput"
data
-
id
=
"testTabSolidityUnitTestsOutput"
><
/a>
`
this
.
testsSummary
=
yo
`<div class="
${
css
.
container
}
mx-3 pt-2 border-top border-primary" hidden='true' id="solidityUnittestsSummary" data-id="testTabSolidityUnitTestsSummary"></div>`
this
.
testsSummary
=
yo
`<div class="
${
css
.
container
}
mx-3 pt-2 border-top border-primary" hidden='true' id="solidityUnittestsSummary" data-id="testTabSolidityUnitTestsSummary"></div>`
this
.
testsExecutionStopped
=
yo
`<label class="text-warning h
5
">The test execution has been stopped</label>`
this
.
testsExecutionStopped
=
yo
`<label class="text-warning h
6
">The test execution has been stopped</label>`
this
.
testsExecutionStopped
.
hidden
=
true
this
.
testsExecutionStopped
.
hidden
=
true
this
.
resultStatistics
=
this
.
createResultLabel
()
this
.
resultStatistics
=
this
.
createResultLabel
()
this
.
resultStatistics
.
hidden
=
true
this
.
resultStatistics
.
hidden
=
true
...
@@ -394,8 +404,8 @@ module.exports = class TestTab extends ViewPlugin {
...
@@ -394,8 +404,8 @@ module.exports = class TestTab extends ViewPlugin {
</div>
</div>
${
this
.
selectAll
()}
${
this
.
selectAll
()}
${
this
.
updateTestFileList
()}
${
this
.
updateTestFileList
()}
<div class="align-items-start flex-column mt-2 mb-0">
<div class="align-items-start flex-column mt-2 m
x-3 m
b-0">
<h6>
${
this
.
resultStatistics
}
</h6>
${
this
.
resultStatistics
}
${
this
.
testsExecutionStopped
}
${
this
.
testsExecutionStopped
}
</div>
</div>
${
this
.
testsOutput
}
${
this
.
testsOutput
}
...
...
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