diff --git a/src/app/tabs/test-tab.js b/src/app/tabs/test-tab.js
index a8daddc495..9cca1a4938 100644
--- a/src/app/tabs/test-tab.js
+++ b/src/app/tabs/test-tab.js
@@ -128,9 +128,14 @@ module.exports = class TestTab extends ViewPlugin {
this.testsOutput.hidden = false
if (result.type === 'contract') {
this.testSuite = result.value
+ if (this.testSuites) {
+ this.testSuites.push(this.testSuite)
+ } else {
+ this.testSuites = [this.testSuite]
+ }
this.rawFileName = result.filename
- this.runningTestFileName = this.cleanFileName(this.rawFileName)
- this.outputHeader = yo`
${this.testSuite} ${this.rawFileName}
`
+ this.runningTestFileName = this.cleanFileName(this.rawFileName, this.testSuite)
+ this.outputHeader = yo`${this.testSuite} ${this.rawFileName}
`
this.testsOutput.appendChild(this.outputHeader)
} else if (result.type === 'testPass') {
this.testsOutput.appendChild(yo`✓ ${result.value}
`)
@@ -150,19 +155,19 @@ module.exports = class TestTab extends ViewPlugin {
cb()
}
- cleanFileName (fileName) {
- return fileName ? fileName.replace(/\//g, '_').replace(/\./g, '_') : fileName
+ cleanFileName (fileName, testSuite) {
+ return fileName ? fileName.replace(/\//g, '_').replace(/\./g, '_') + testSuite : fileName
}
setHeader (status) {
if (status) {
const label = yo`PASS
`
- this.outputHeader && yo.update(this.outputHeader, yo`${label} ${this.testSuite} ${this.rawFileName}
`)
+ this.outputHeader && yo.update(this.outputHeader, yo`${label} ${this.testSuite} ${this.rawFileName}
`)
} else {
const label = yo`FAIL
`
- this.outputHeader && yo.update(this.outputHeader, yo`${label} ${this.testSuite} ${this.rawFileName}
`)
+ this.outputHeader && yo.update(this.outputHeader, yo`${label} ${this.testSuite} ${this.rawFileName}
`)
}
}
@@ -185,23 +190,40 @@ module.exports = class TestTab extends ViewPlugin {
if (result) {
if (result.totalPassing > 0 && result.totalFailing > 0) {
this.testsOutput.appendChild(yo`${result.totalPassing} passing, ${result.totalFailing} failing (${result.totalTime}s)
`)
- if (this.rawFileName === filename) this.setHeader(false)
} else if (result.totalPassing > 0 && result.totalFailing <= 0) {
this.testsOutput.appendChild(yo`${result.totalPassing} passing (${result.totalTime}s)
`)
- if (this.rawFileName === filename) this.setHeader(true)
} else if (result.totalPassing <= 0 && result.totalFailing > 0) {
this.testsOutput.appendChild(yo`${result.totalFailing} failing
`)
- 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`
`
result.errors.forEach((error, index) => {
- displayError.appendChild(yo``)
+ this.testSuite = error.context
+ 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`
+
+ `)
})
- this.testsOutput.appendChild(displayError)
+ if (result.errors && result.errors.length > 0) {
+ this.testsOutput.appendChild(displayError)
+ }
+ this.testsOutput.appendChild(yo``)
}
if (this.hasBeenStopped && (this.readyTestsNumber !== this.runningTestsNumber)) {
// if all tests has been through before stopping no need to print this.
@@ -416,7 +438,7 @@ module.exports = class TestTab extends ViewPlugin {
render () {
this.onActivationInternal()
- this.testsOutput = yo``
+ this.testsOutput = yo`
`
this.testsExecutionStopped = yo`The test execution has been stopped `
this.testsExecutionStopped.hidden = true
this.resultStatistics = this.createResultLabel()
diff --git a/test-browser/helpers/init.js b/test-browser/helpers/init.js
index 5a69a6384a..c4341a362b 100644
--- a/test-browser/helpers/init.js
+++ b/test-browser/helpers/init.js
@@ -24,7 +24,7 @@ module.exports = function (browser, callback, url, preloadPlugins = true) {
}
function initModules (browser, callback) {
- browser.pause(20000)
+ browser.pause(5000)
.click('#icon-panel div[plugin="pluginManager"]')
.scrollAndClick('#pluginManager article[id="remixPluginManagerListItem_solidity"] button')
.pause(5000)