Merge e76199b716
into 4b88ee41bd
This commit is contained in:
commit
b76949b1ee
|
@ -276,6 +276,16 @@ Note that the query parameter takes precedence.
|
||||||
[pytest]
|
[pytest]
|
||||||
render_collapsed = failed,error
|
render_collapsed = failed,error
|
||||||
|
|
||||||
|
Expand all logs
|
||||||
|
~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
By default, logs are shown in short form. To display them in full form use ini option `expand_logs`.
|
||||||
|
|
||||||
|
.. code-block:: ini
|
||||||
|
|
||||||
|
[pytest]
|
||||||
|
expand_logs = true
|
||||||
|
|
||||||
Controlling Test Result Visibility
|
Controlling Test Result Visibility
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
|
|
@ -72,6 +72,12 @@ def pytest_addoption(parser):
|
||||||
default="result",
|
default="result",
|
||||||
help="column to initially sort on.",
|
help="column to initially sort on.",
|
||||||
)
|
)
|
||||||
|
parser.addini(
|
||||||
|
"expand_logs",
|
||||||
|
type="string",
|
||||||
|
default=False,
|
||||||
|
help="expand all logs by default.",
|
||||||
|
)
|
||||||
parser.addini(
|
parser.addini(
|
||||||
"generate_report_on_test",
|
"generate_report_on_test",
|
||||||
type="bool",
|
type="bool",
|
||||||
|
|
|
@ -61,6 +61,9 @@ class ReportData:
|
||||||
initial_sort = config.getini("initial_sort")
|
initial_sort = config.getini("initial_sort")
|
||||||
self._data["initialSort"] = initial_sort
|
self._data["initialSort"] = initial_sort
|
||||||
|
|
||||||
|
expand_logs = config.getini("expand_logs")
|
||||||
|
self._data["expandLogs"] = expand_logs
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def additional_summary(self):
|
def additional_summary(self):
|
||||||
return self._additional_summary
|
return self._additional_summary
|
||||||
|
|
|
@ -57,6 +57,10 @@ class DataManager {
|
||||||
get initialSort() {
|
get initialSort() {
|
||||||
return this.data.initialSort
|
return this.data.initialSort
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get expandLogs() {
|
||||||
|
return this.data.expandLogs
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
|
|
|
@ -6,6 +6,7 @@ const {
|
||||||
getVisible,
|
getVisible,
|
||||||
getCollapsedIds,
|
getCollapsedIds,
|
||||||
setCollapsedIds,
|
setCollapsedIds,
|
||||||
|
getExpandLogs,
|
||||||
getSort,
|
getSort,
|
||||||
getSortDirection,
|
getSortDirection,
|
||||||
possibleFilters,
|
possibleFilters,
|
||||||
|
@ -47,10 +48,12 @@ const addItemToggleListener = (elem) => {
|
||||||
|
|
||||||
const renderContent = (tests) => {
|
const renderContent = (tests) => {
|
||||||
const sortAttr = getSort(manager.initialSort)
|
const sortAttr = getSort(manager.initialSort)
|
||||||
|
const expandLogs = getExpandLogs(manager.expandLogs)
|
||||||
const sortAsc = JSON.parse(getSortDirection())
|
const sortAsc = JSON.parse(getSortDirection())
|
||||||
const rows = tests.map(dom.getResultTBody)
|
const rows = tests.map(dom.getResultTBody)
|
||||||
const table = document.getElementById('results-table')
|
const table = document.getElementById('results-table')
|
||||||
const tableHeader = document.getElementById('results-table-head')
|
const tableHeader = document.getElementById('results-table-head')
|
||||||
|
const clickEvent = new Event('click')
|
||||||
|
|
||||||
const newTable = document.createElement('table')
|
const newTable = document.createElement('table')
|
||||||
newTable.id = 'results-table'
|
newTable.id = 'results-table'
|
||||||
|
@ -70,6 +73,9 @@ const renderContent = (tests) => {
|
||||||
find('.logexpander', row).addEventListener('click',
|
find('.logexpander', row).addEventListener('click',
|
||||||
(evt) => evt.target.parentNode.classList.toggle('expanded'),
|
(evt) => evt.target.parentNode.classList.toggle('expanded'),
|
||||||
)
|
)
|
||||||
|
if (expandLogs) {
|
||||||
|
find('.logexpander', row).dispatchEvent(clickEvent)
|
||||||
|
}
|
||||||
newTable.appendChild(row)
|
newTable.appendChild(row)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
@ -47,6 +47,16 @@ const showCategory = (categoryToShow) => {
|
||||||
window.history.pushState({}, null, unescape(url.href))
|
window.history.pushState({}, null, unescape(url.href))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const getExpandLogs = (expandLogs) => {
|
||||||
|
if (expandLogs === 'true') {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
if (expandLogs) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
const getSort = (initialSort) => {
|
const getSort = (initialSort) => {
|
||||||
const url = new URL(window.location.href)
|
const url = new URL(window.location.href)
|
||||||
let sort = new URLSearchParams(url.search).get('sort')
|
let sort = new URLSearchParams(url.search).get('sort')
|
||||||
|
@ -99,6 +109,7 @@ module.exports = {
|
||||||
showCategory,
|
showCategory,
|
||||||
getCollapsedIds,
|
getCollapsedIds,
|
||||||
setCollapsedIds,
|
setCollapsedIds,
|
||||||
|
getExpandLogs,
|
||||||
getSort,
|
getSort,
|
||||||
setSort,
|
setSort,
|
||||||
getSortDirection,
|
getSortDirection,
|
||||||
|
|
Loading…
Reference in New Issue