Files
recipes/cookbook/tests/api/docs/reports/tests/tests.html
2024-08-24 09:18:57 +02:00

770 lines
42 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title id="head-title">tests.html</title>
<link href="assets\style.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<h1 id="title">tests.html</h1>
<p>Report generated on 24-Aug-2024 at 09:17:29 by <a href="https://pypi.python.org/pypi/pytest-html">pytest-html</a>
v4.1.1</p>
<div id="environment-header">
<h2>Environment</h2>
</div>
<table id="environment"></table>
<!-- TEMPLATES -->
<template id="template_environment_row">
<tr>
<td></td>
<td></td>
</tr>
</template>
<template id="template_results-table__body--empty">
<tbody class="results-table-row">
<tr id="not-found-message">
<td colspan="4">No results found. Check the filters.</th>
</tr>
</template>
<template id="template_results-table__tbody">
<tbody class="results-table-row">
<tr class="collapsible">
</tr>
<tr class="extras-row">
<td class="extra" colspan="4">
<div class="extraHTML"></div>
<div class="media">
<div class="media-container">
<div class="media-container__nav--left"><</div>
<div class="media-container__viewport">
<img src="" />
<video controls>
<source src="" type="video/mp4">
</video>
</div>
<div class="media-container__nav--right">></div>
</div>
<div class="media__name"></div>
<div class="media__counter"></div>
</div>
<div class="logwrapper">
<div class="logexpander"></div>
<div class="log"></div>
</div>
</td>
</tr>
</tbody>
</template>
<!-- END TEMPLATES -->
<div class="summary">
<div class="summary__data">
<h2>Summary</h2>
<div class="additional-summary prefix">
</div>
<p class="run-count">1 test took 00:00:24.</p>
<p class="filter">(Un)check the boxes to filter the results.</p>
<div class="summary__reload">
<div class="summary__reload__button hidden" onclick="location.reload()">
<div>There are still tests running. <br />Reload this page to get the latest results!</div>
</div>
</div>
<div class="summary__spacer"></div>
<div class="controls">
<div class="filters">
<input checked="true" class="filter" name="filter_checkbox" type="checkbox" data-test-result="failed" disabled/>
<span class="failed">0 Failed,</span>
<input checked="true" class="filter" name="filter_checkbox" type="checkbox" data-test-result="passed" />
<span class="passed">1 Passed,</span>
<input checked="true" class="filter" name="filter_checkbox" type="checkbox" data-test-result="skipped" disabled/>
<span class="skipped">0 Skipped,</span>
<input checked="true" class="filter" name="filter_checkbox" type="checkbox" data-test-result="xfailed" disabled/>
<span class="xfailed">0 Expected failures,</span>
<input checked="true" class="filter" name="filter_checkbox" type="checkbox" data-test-result="xpassed" disabled/>
<span class="xpassed">0 Unexpected passes,</span>
<input checked="true" class="filter" name="filter_checkbox" type="checkbox" data-test-result="error" disabled/>
<span class="error">0 Errors,</span>
<input checked="true" class="filter" name="filter_checkbox" type="checkbox" data-test-result="rerun" disabled/>
<span class="rerun">0 Reruns</span>
</div>
<div class="collapse">
<button id="show_all_details">Show all details</button>&nbsp;/&nbsp;<button id="hide_all_details">Hide all details</button>
</div>
</div>
</div>
<div class="additional-summary summary">
</div>
<div class="additional-summary postfix">
</div>
</div>
<table id="results-table">
<thead id="results-table-head">
<tr>
<th class="sortable" data-column-type="result">Result</th>
<th class="sortable" data-column-type="testId">Test</th>
<th class="sortable" data-column-type="duration">Duration</th>
<th>Links</th>
</tr>
</thead>
</table>
</body>
<footer>
<div id="data-container" data-jsonblob="{&#34;environment&#34;: {&#34;Python&#34;: &#34;3.12.5&#34;, &#34;Platform&#34;: &#34;Windows-11-10.0.22631-SP0&#34;, &#34;Packages&#34;: {&#34;pytest&#34;: &#34;8.0.0&#34;, &#34;pluggy&#34;: &#34;1.4.0&#34;}, &#34;Plugins&#34;: {&#34;Faker&#34;: &#34;23.2.1&#34;, &#34;asyncio&#34;: &#34;0.23.5&#34;, &#34;cov&#34;: &#34;5.0.0&#34;, &#34;django&#34;: &#34;4.8.0&#34;, &#34;factoryboy&#34;: &#34;2.6.0&#34;, &#34;html&#34;: &#34;4.1.1&#34;, &#34;metadata&#34;: &#34;3.1.1&#34;, &#34;xdist&#34;: &#34;3.6.1&#34;}}, &#34;tests&#34;: {&#34;cookbook/tests/api/test_api_space.py::test_list_multiple&#34;: [{&#34;extras&#34;: [], &#34;result&#34;: &#34;Passed&#34;, &#34;testId&#34;: &#34;cookbook/tests/api/test_api_space.py::test_list_multiple&#34;, &#34;duration&#34;: &#34;00:00:24&#34;, &#34;resultsTableRow&#34;: [&#34;&lt;td class=\&#34;col-result\&#34;&gt;Passed&lt;/td&gt;&#34;, &#34;&lt;td class=\&#34;col-testId\&#34;&gt;cookbook/tests/api/test_api_space.py::test_list_multiple&lt;/td&gt;&#34;, &#34;&lt;td class=\&#34;col-duration\&#34;&gt;00:00:24&lt;/td&gt;&#34;, &#34;&lt;td class=\&#34;col-links\&#34;&gt;&lt;/td&gt;&#34;], &#34;log&#34;: &#34;---------------------------- Captured stdout setup -----------------------------\nOperations to perform:\n Synchronize unmigrated apps: allauth, crispy_bootstrap4, crispy_forms, debug_toolbar, django_prometheus, django_tables2, django_vite, drf_spectacular, drf_spectacular_sidecar, postgres, rest_framework, treebeard, webpack_loader\n Apply all migrations: account, admin, auth, authtoken, contenttypes, cookbook, oauth2_provider, open_data_plugin, sessions, socialaccount\nSynchronizing apps without migrations:\n Creating tables...\n Running deferred SQL...\nRunning migrations:\n Applying contenttypes.0001_initial... OK\n Applying auth.0001_initial... OK\n Applying account.0001_initial... OK\n Applying account.0002_email_max_length... OK\n Applying account.0003_alter_emailaddress_create_unique_verified_email... OK\n Applying account.0004_alter_emailaddress_drop_unique_email... OK\n Applying account.0005_emailaddress_idx_upper_email... OK\n Applying admin.0001_initial... OK\n Applying admin.0002_logentry_remove_auto_add... OK\n Applying admin.0003_logentry_add_action_flag_choices... OK\n Applying contenttypes.0002_remove_content_type_name... OK\n Applying auth.0002_alter_permission_name_max_length... OK\n Applying auth.0003_alter_user_email_max_length... OK\n Applying auth.0004_alter_user_username_opts... OK\n Applying auth.0005_alter_user_last_login_null... OK\n Applying auth.0006_require_contenttypes_0002... OK\n Applying auth.0007_alter_validators_add_error_messages... OK\n Applying auth.0008_alter_user_username_max_length... OK\n Applying auth.0009_alter_user_last_name_max_length... OK\n Applying auth.0010_alter_group_name_max_length... OK\n Applying auth.0011_update_proxy_permissions... OK\n Applying auth.0012_alter_user_first_name_max_length... OK\n Applying authtoken.0001_initial... OK\n Applying authtoken.0002_auto_20160226_1747... OK\n Applying authtoken.0003_tokenproxy... OK\n Applying authtoken.0004_alter_tokenproxy_options... OK\n Applying cookbook.0001_initial... OK\n Applying cookbook.0002_auto_20191119_2035... OK\n Applying cookbook.0003_enable_pgtrm... OK\n Applying cookbook.0004_storage_created_by... OK\n Applying cookbook.0005_recipebook_recipebookentry... OK\n Applying cookbook.0006_recipe_image... OK\n Applying cookbook.0007_auto_20191226_0852... OK\n Applying cookbook.0008_mealplan... OK\n Applying cookbook.0009_auto_20200130_1056... OK\n Applying cookbook.0010_auto_20200130_1059... OK\n Applying cookbook.0011_remove_recipeingredients_unit... OK\n Applying cookbook.0012_auto_20200130_1116... OK\n Applying cookbook.0013_userpreference... OK\n Applying cookbook.0014_auto_20200213_2332... OK\n Applying cookbook.0015_auto_20200213_2334... OK\n Applying cookbook.0016_auto_20200213_2335... OK\n Applying cookbook.0017_auto_20200216_2257... OK\n Applying cookbook.0018_auto_20200216_2303... OK\n Applying cookbook.0019_ingredient... OK\n Applying cookbook.0020_recipeingredient_ingredient... OK\n Applying cookbook.0021_auto_20200216_2309... OK\n Applying cookbook.0022_remove_recipeingredient_name... OK\n Applying cookbook.0023_auto_20200216_2311... OK\n Applying cookbook.0024_auto_20200216_2313... OK\n Applying cookbook.0025_userpreference_nav_color... OK\n Applying cookbook.0026_auto_20200219_1605... OK\n Applying cookbook.0027_ingredient_recipe... OK\n Applying cookbook.0028_auto_20200317_1901... OK\n Applying cookbook.0029_auto_20200317_1901... OK\n Applying cookbook.0030_recipeingredient_note... OK\n Applying cookbook.0031_auto_20200407_1841... OK\n Applying cookbook.0032_userpreference_default_unit... OK\n Applying cookbook.0033_userpreference_default_page... OK\n Applying cookbook.0034_auto_20200426_1614... OK\n Applying cookbook.0035_auto_20200427_1637... OK\n Applying cookbook.0036_auto_20200427_1800... OK\n Applying cookbook.0037_userpreference_search_style... OK\n Applying cookbook.0038_auto_20200502_1259... OK\n Applying cookbook.0039_recipebook_shared... OK\n Applying cookbook.0040_auto_20200502_1433... OK\n Applying cookbook.0041_auto_20200502_1446... OK\n Applying cookbook.0042_cooklog... OK\n Applying cookbook.0043_auto_20200507_2302... OK\n Applying cookbook.0044_viewlog... OK\n Applying cookbook.0045_userpreference_show_recent... OK\n Applying cookbook.0046_auto_20200602_1133... OK\n Applying cookbook.0047_auto_20200602_1133... OK\n Applying cookbook.0048_auto_20200602_1140... OK\n Applying cookbook.0049_mealtype_created_by... OK\n Applying cookbook.0050_auto_20200611_1509... OK\n Applying cookbook.0051_auto_20200611_1518... OK\n Applying cookbook.0052_userpreference_ingredient_decimals... OK\n Applying cookbook.0053_auto_20200611_2217... OK\n Applying cookbook.0054_sharelink... OK\n Applying cookbook.0055_auto_20200616_1236... OK\n Applying cookbook.0056_auto_20200625_2118... OK\n Applying cookbook.0057_auto_20200625_2127... OK\n Applying cookbook.0058_auto_20200625_2128... OK\n Applying cookbook.0059_auto_20200625_2137... OK\n Applying cookbook.0060_auto_20200625_2144... OK\n Applying cookbook.0056_auto_20200625_2157... OK\n Applying cookbook.0061_merge_20200625_2209... OK\n Applying cookbook.0062_auto_20200625_2219... OK\n Applying cookbook.0063_auto_20200625_2230... OK\n Applying cookbook.0064_auto_20200625_2329... OK\n Applying cookbook.0065_auto_20200626_1444... OK\n Applying cookbook.0066_auto_20200626_1455... OK\n Applying cookbook.0067_auto_20200629_1508... OK\n Applying cookbook.0068_auto_20200629_2127... OK\n Applying cookbook.0069_auto_20200629_2134... OK\n Applying cookbook.0070_auto_20200701_2007... OK\n Applying cookbook.0071_auto_20200701_2048... OK\n Applying cookbook.0072_step_show_as_header... OK\n Applying cookbook.0073_auto_20200708_2311... OK\n Applying cookbook.0074_remove_keyword_created_by... OK\n Applying cookbook.0075_shoppinglist_shoppinglistentry_shoppinglistrecipe... OK\n Applying cookbook.0076_shoppinglist_entries... OK\n Applying cookbook.0077_invitelink... OK\n Applying cookbook.0078_invitelink_used_by... OK\n Applying cookbook.0079_invitelink_group... OK\n Applying cookbook.0080_auto_20200921_2331... OK\n Applying cookbook.0081_auto_20200921_2349... OK\n Applying cookbook.0082_auto_20200922_1143... OK\n Applying cookbook.0083_space... OK\n Applying cookbook.0084_auto_20200922_1233... OK\n Applying cookbook.0085_auto_20200922_1235... OK\n Applying cookbook.0086_auto_20200929_1143... OK\n Applying cookbook.0087_auto_20200929_1152... OK\n Applying cookbook.0088_shoppinglist_finished... OK\n Applying cookbook.0089_auto_20201117_2222... OK\n Applying cookbook.0090_auto_20201214_1359... OK\n Applying cookbook.0091_auto_20201226_1551... OK\n Applying cookbook.0092_recipe_servings... OK\n Applying cookbook.0093_auto_20201231_1236... OK\n Applying cookbook.0094_auto_20201231_1238... OK\n Applying cookbook.0095_auto_20210107_1804... OK\n Applying cookbook.0096_auto_20210109_2044... OK\n Applying cookbook.0097_auto_20210113_1315... OK\n Applying cookbook.0098_auto_20210113_1320... OK\n Applying cookbook.0099_auto_20210113_1518... OK\n Applying cookbook.0100_recipe_servings_text... OK\n Applying cookbook.0101_storage_path... OK\n Applying cookbook.0102_auto_20210125_1147... OK\n Applying cookbook.0103_food_ignore_shopping... OK\n Applying cookbook.0104_auto_20210125_2133... OK\n Applying cookbook.0105_auto_20210126_1604... OK\n Applying cookbook.0106_shoppinglist_supermarket... OK\n Applying cookbook.0107_auto_20210128_1535... OK\n Applying cookbook.0108_auto_20210219_1410... OK\n Applying cookbook.0109_auto_20210221_1204... OK\n Applying cookbook.0110_auto_20210221_1406... OK\n Applying cookbook.0111_space_created_by... OK\n Applying cookbook.0112_remove_synclog_space... OK\n Applying cookbook.0113_auto_20210317_2017... OK\n Applying cookbook.0114_importlog... OK\n Applying cookbook.0115_telegrambot... OK\n Applying cookbook.0116_auto_20210319_0012... OK\n Applying cookbook.0117_space_max_recipes... OK\n Applying cookbook.0118_auto_20210406_1805... OK\n Applying cookbook.0119_auto_20210411_2101... OK\n Applying cookbook.0120_bookmarklet... OK\n Applying cookbook.0121_auto_20210518_1638... OK\n Applying cookbook.0122_auto_20210527_1712... OK\n Applying cookbook.0123_invitelink_email... OK\n Applying cookbook.0124_alter_userpreference_theme... OK\n Applying cookbook.0125_space_demo... OK\n Applying cookbook.0126_alter_userpreference_theme... OK\n Applying cookbook.0127_remove_invitelink_username... OK\n Applying cookbook.0128_userfile... OK\n Applying cookbook.0129_auto_20210608_1233... OK\n Applying cookbook.0130_alter_userfile_file_size_kb... OK\n Applying cookbook.0131_auto_20210608_1929... OK\n Applying cookbook.0132_sharelink_request_count... OK\n Applying cookbook.0133_sharelink_abuse_blocked... OK\n Applying cookbook.0134_space_allow_sharing... OK\n Applying cookbook.0135_auto_20210615_2210... OK\n Applying cookbook.0136_auto_20210617_1343... OK\n Applying cookbook.0137_auto_20210617_1501... OK\n Applying cookbook.0138_auto_20210617_1602... OK\n Applying cookbook.0139_space_created_at... OK\n Applying cookbook.0140_userpreference_created_at... OK\n Applying cookbook.0141_auto_20210713_1042... OK\n Applying cookbook.0142_alter_userpreference_search_style... OK\n Applying cookbook.0143_build_full_text_index... OK\n Applying cookbook.0144_create_searchfields... OK\n Applying cookbook.0145_alter_userpreference_search_style... OK\n Applying cookbook.0146_alter_userpreference_use_fractions... OK\n Applying cookbook.0147_keyword_to_tree... OK\n Applying cookbook.0148_auto_20210813_1829... OK\n Applying cookbook.0149_fix_leading_trailing_spaces... OK\n Applying cookbook.0150_food_to_tree... OK\n Applying cookbook.0151_auto_20210915_1037... OK\n Applying cookbook.0152_automation... OK\n Applying cookbook.0153_auto_20210915_2327... OK\n Applying cookbook.0154_auto_20210922_1705... OK\n Applying cookbook.0155_mealtype_default... OK\n Applying cookbook.0156_searchpreference_trigram_threshold... OK\n Applying cookbook.0157_alter_searchpreference_trigram... OK\n Applying cookbook.0158_userpreference_use_kj... OK\n Applying cookbook.0159_add_shoppinglistentry_fields... OK\n Applying cookbook.0160_delete_shoppinglist_orphans... OK\n Applying cookbook.0161_alter_shoppinglistentry_food... OK\n Applying cookbook.0162_userpreference_csv_delim... OK\n Applying cookbook.0163_auto_20220105_0758... OK\n Applying cookbook.0164_space_show_facet_count... OK\n Applying cookbook.0165_remove_step_type... OK\n Applying cookbook.0166_alter_userpreference_shopping_add_onhand... OK\n Applying cookbook.0167_userpreference_left_handed... OK\n Applying cookbook.0168_add_unit_searchfields... OK\n Applying cookbook.0169_exportlog... OK\n Applying cookbook.0170_auto_20220207_1848... OK\n Applying cookbook.0171_alter_searchpreference_trigram_threshold... OK\n Applying cookbook.0172_ingredient_original_text... OK\n Applying cookbook.0173_recipe_source_url... OK\n Applying cookbook.0174_alter_food_substitute_userspace... OK\n Applying cookbook.0175_remove_userpreference_space... OK\n Applying cookbook.0176_alter_searchpreference_icontains_and_more... OK\n Applying cookbook.0177_recipe_show_ingredient_overview... OK\n Applying cookbook.0178_remove_userpreference_search_style_and_more... OK\n Applying cookbook.0179_recipe_private_recipe_shared... OK\n Applying cookbook.0180_invitelink_reusable... OK\n Applying cookbook.0181_space_image... OK\n Applying cookbook.0182_userpreference_image... OK\n Applying cookbook.0183_alter_space_image... OK\n Applying cookbook.0184_alter_userpreference_image... OK\n Applying cookbook.0185_food_plural_name_ingredient_always_use_plural_food_and_more... OK\n Applying cookbook.0186_automation_order_alter_automation_type... OK\n Applying cookbook.0187_alter_space_use_plural... OK\n Applying cookbook.0188_space_no_sharing_limit... OK\n Applying cookbook.0189_property_propertytype_unitconversion_food_fdc_id_and_more... OK\n Applying cookbook.0190_auto_20230525_1506...Transforming nutrition information, this might take a while on large databases\n OK\n Applying cookbook.0191_foodproperty_property_import_food_id_and_more... OK\n Applying cookbook.0192_food_food_unique_open_data_slug_per_space_and_more... OK\n Applying cookbook.0193_space_internal_note... OK\n Applying cookbook.0194_alter_food_properties_food_amount... OK\n Applying cookbook.0195_invitelink_internal_note_userspace_internal_note_and_more... OK\n Applying cookbook.0196_food_url... OK\n Applying cookbook.0197_step_show_ingredients_table_and_more... OK\n Applying cookbook.0198_propertytype_order... OK\n Applying cookbook.0199_alter_propertytype_options_alter_automation_type_and_more... OK\n Applying cookbook.0200_alter_propertytype_options_remove_keyword_icon_and_more... OK\n Applying cookbook.0201_rename_date_mealplan_from_date_mealplan_to_date... OK\n Applying cookbook.0202_remove_space_show_facet_count... OK\n Applying cookbook.0203_alter_unique_contstraints... OK\n Applying cookbook.0204_propertytype_fdc_id... OK\n Applying cookbook.0205_alter_food_fdc_id_alter_propertytype_fdc_id... OK\n Applying cookbook.0206_rename_sticky_navbar_userpreference_nav_sticky_and_more... OK\n Applying cookbook.0207_space_logo_color_128_space_logo_color_144_and_more... OK\n Applying cookbook.0208_space_app_name_userpreference_max_owned_spaces... OK\n Applying cookbook.0209_remove_space_use_plural... OK\n Applying cookbook.0210_shoppinglistentry_updated_at... OK\n Applying cookbook.0211_recipebook_order... OK\n Applying cookbook.0212_alter_property_property_amount... OK\n Applying cookbook.0213_remove_property_property_unique_import_food_per_space_and_more... OK\n Applying cookbook.0214_cooklog_comment_cooklog_updated_at_and_more... OK\n Applying cookbook.0215_connectorconfig... OK\n Applying cookbook.0216_delete_shoppinglist... OK\n Applying cookbook.0217_alter_userpreference_default_page... OK\n Applying cookbook.0218_alter_mealplan_from_date_alter_mealplan_to_date... OK\n Applying oauth2_provider.0001_initial... OK\n Applying oauth2_provider.0002_auto_20190406_1805... OK\n Applying oauth2_provider.0003_auto_20201211_1314... OK\n Applying oauth2_provider.0004_auto_20200902_2022... OK\n Applying oauth2_provider.0005_auto_20211222_2352... OK\n Applying oauth2_provider.0006_alter_application_client_secret... OK\n Applying oauth2_provider.0007_application_post_logout_redirect_uris... OK\n Applying oauth2_provider.0008_alter_accesstoken_token... OK\n Applying oauth2_provider.0009_add_hash_client_secret... OK\n Applying oauth2_provider.0010_application_allowed_origins... OK\n Applying open_data_plugin.0001_initial... OK\n Applying open_data_plugin.0002_remove_opendatafoodproperty_comment_and_more... OK\n Applying open_data_plugin.0003_opendatafood_properties_food_amount_and_more... OK\n Applying open_data_plugin.0004_opendatauser... OK\n Applying open_data_plugin.0005_alter_opendatastorecategory_category_and_more... OK\n Applying open_data_plugin.0006_opendataversion_opendatacategory_version_and_more... OK\n Applying open_data_plugin.0007_opendatacategory_description... OK\n Applying open_data_plugin.0008_alter_opendatacategory_description... OK\n Applying open_data_plugin.0009_alter_opendatafood_fdc_id... OK\n Applying open_data_plugin.0010_opendataconversion_f_unique_conversion_per_food... OK\n Applying sessions.0001_initial... OK\n Applying socialaccount.0001_initial... OK\n Applying socialaccount.0002_token_max_lengths... OK\n Applying socialaccount.0003_extra_data_default_dict... OK\n Applying socialaccount.0004_app_provider_id_settings... OK\n Applying socialaccount.0005_socialtoken_nullable_app... OK\n Applying socialaccount.0006_alter_socialaccount_extra_data... OK\n\n---------------------------- Captured stderr setup -----------------------------\nCreating test database for alias &amp;#x27;default&amp;#x27; (&amp;#x27;file:memorydb_default?mode=memory&amp;amp;cache=shared&amp;#x27;)...\r\n--------------------------- Captured stderr teardown ---------------------------\nDestroying test database for alias &amp;#x27;default&amp;#x27; (&amp;#x27;file:memorydb_default?mode=memory&amp;amp;cache=shared&amp;#x27;)...\r\n&#34;}]}, &#34;renderCollapsed&#34;: [&#34;passed&#34;], &#34;initialSort&#34;: &#34;result&#34;, &#34;title&#34;: &#34;tests.html&#34;}"></div>
<script>
(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
const { getCollapsedCategory, setCollapsedIds } = require('./storage.js')
class DataManager {
setManager(data) {
const collapsedCategories = [...getCollapsedCategory(data.renderCollapsed)]
const collapsedIds = []
const tests = Object.values(data.tests).flat().map((test, index) => {
const collapsed = collapsedCategories.includes(test.result.toLowerCase())
const id = `test_${index}`
if (collapsed) {
collapsedIds.push(id)
}
return {
...test,
id,
collapsed,
}
})
const dataBlob = { ...data, tests }
this.data = { ...dataBlob }
this.renderData = { ...dataBlob }
setCollapsedIds(collapsedIds)
}
get allData() {
return { ...this.data }
}
resetRender() {
this.renderData = { ...this.data }
}
setRender(data) {
this.renderData.tests = [...data]
}
toggleCollapsedItem(id) {
this.renderData.tests = this.renderData.tests.map((test) =>
test.id === id ? { ...test, collapsed: !test.collapsed } : test,
)
}
set allCollapsed(collapsed) {
this.renderData = { ...this.renderData, tests: [...this.renderData.tests.map((test) => (
{ ...test, collapsed }
))] }
}
get testSubset() {
return [...this.renderData.tests]
}
get environment() {
return this.renderData.environment
}
get initialSort() {
return this.data.initialSort
}
}
module.exports = {
manager: new DataManager(),
}
},{"./storage.js":8}],2:[function(require,module,exports){
const mediaViewer = require('./mediaviewer.js')
const templateEnvRow = document.getElementById('template_environment_row')
const templateResult = document.getElementById('template_results-table__tbody')
function htmlToElements(html) {
const temp = document.createElement('template')
temp.innerHTML = html
return temp.content.childNodes
}
const find = (selector, elem) => {
if (!elem) {
elem = document
}
return elem.querySelector(selector)
}
const findAll = (selector, elem) => {
if (!elem) {
elem = document
}
return [...elem.querySelectorAll(selector)]
}
const dom = {
getStaticRow: (key, value) => {
const envRow = templateEnvRow.content.cloneNode(true)
const isObj = typeof value === 'object' && value !== null
const values = isObj ? Object.keys(value).map((k) => `${k}: ${value[k]}`) : null
const valuesElement = htmlToElements(
values ? `<ul>${values.map((val) => `<li>${val}</li>`).join('')}<ul>` : `<div>${value}</div>`)[0]
const td = findAll('td', envRow)
td[0].textContent = key
td[1].appendChild(valuesElement)
return envRow
},
getResultTBody: ({ testId, id, log, extras, resultsTableRow, tableHtml, result, collapsed }) => {
const resultBody = templateResult.content.cloneNode(true)
resultBody.querySelector('tbody').classList.add(result.toLowerCase())
resultBody.querySelector('tbody').id = testId
resultBody.querySelector('.collapsible').dataset.id = id
resultsTableRow.forEach((html) => {
const t = document.createElement('template')
t.innerHTML = html
resultBody.querySelector('.collapsible').appendChild(t.content)
})
if (log) {
// Wrap lines starting with "E" with span.error to color those lines red
const wrappedLog = log.replace(/^E.*$/gm, (match) => `<span class="error">${match}</span>`)
resultBody.querySelector('.log').innerHTML = wrappedLog
} else {
resultBody.querySelector('.log').remove()
}
if (collapsed) {
resultBody.querySelector('.collapsible > td')?.classList.add('collapsed')
resultBody.querySelector('.extras-row').classList.add('hidden')
} else {
resultBody.querySelector('.collapsible > td')?.classList.remove('collapsed')
}
const media = []
extras?.forEach(({ name, format_type, content }) => {
if (['image', 'video'].includes(format_type)) {
media.push({ path: content, name, format_type })
}
if (format_type === 'html') {
resultBody.querySelector('.extraHTML').insertAdjacentHTML('beforeend', `<div>${content}</div>`)
}
})
mediaViewer.setup(resultBody, media)
// Add custom html from the pytest_html_results_table_html hook
tableHtml?.forEach((item) => {
resultBody.querySelector('td[class="extra"]').insertAdjacentHTML('beforeend', item)
})
return resultBody
},
}
module.exports = {
dom,
htmlToElements,
find,
findAll,
}
},{"./mediaviewer.js":6}],3:[function(require,module,exports){
const { manager } = require('./datamanager.js')
const { doSort } = require('./sort.js')
const storageModule = require('./storage.js')
const getFilteredSubSet = (filter) =>
manager.allData.tests.filter(({ result }) => filter.includes(result.toLowerCase()))
const doInitFilter = () => {
const currentFilter = storageModule.getVisible()
const filteredSubset = getFilteredSubSet(currentFilter)
manager.setRender(filteredSubset)
}
const doFilter = (type, show) => {
if (show) {
storageModule.showCategory(type)
} else {
storageModule.hideCategory(type)
}
const currentFilter = storageModule.getVisible()
const filteredSubset = getFilteredSubSet(currentFilter)
manager.setRender(filteredSubset)
const sortColumn = storageModule.getSort()
doSort(sortColumn, true)
}
module.exports = {
doFilter,
doInitFilter,
}
},{"./datamanager.js":1,"./sort.js":7,"./storage.js":8}],4:[function(require,module,exports){
const { redraw, bindEvents, renderStatic } = require('./main.js')
const { doInitFilter } = require('./filter.js')
const { doInitSort } = require('./sort.js')
const { manager } = require('./datamanager.js')
const data = JSON.parse(document.getElementById('data-container').dataset.jsonblob)
function init() {
manager.setManager(data)
doInitFilter()
doInitSort()
renderStatic()
redraw()
bindEvents()
}
init()
},{"./datamanager.js":1,"./filter.js":3,"./main.js":5,"./sort.js":7}],5:[function(require,module,exports){
const { dom, find, findAll } = require('./dom.js')
const { manager } = require('./datamanager.js')
const { doSort } = require('./sort.js')
const { doFilter } = require('./filter.js')
const {
getVisible,
getCollapsedIds,
setCollapsedIds,
getSort,
getSortDirection,
possibleFilters,
} = require('./storage.js')
const removeChildren = (node) => {
while (node.firstChild) {
node.removeChild(node.firstChild)
}
}
const renderStatic = () => {
const renderEnvironmentTable = () => {
const environment = manager.environment
const rows = Object.keys(environment).map((key) => dom.getStaticRow(key, environment[key]))
const table = document.getElementById('environment')
removeChildren(table)
rows.forEach((row) => table.appendChild(row))
}
renderEnvironmentTable()
}
const addItemToggleListener = (elem) => {
elem.addEventListener('click', ({ target }) => {
const id = target.parentElement.dataset.id
manager.toggleCollapsedItem(id)
const collapsedIds = getCollapsedIds()
if (collapsedIds.includes(id)) {
const updated = collapsedIds.filter((item) => item !== id)
setCollapsedIds(updated)
} else {
collapsedIds.push(id)
setCollapsedIds(collapsedIds)
}
redraw()
})
}
const renderContent = (tests) => {
const sortAttr = getSort(manager.initialSort)
const sortAsc = JSON.parse(getSortDirection())
const rows = tests.map(dom.getResultTBody)
const table = document.getElementById('results-table')
const tableHeader = document.getElementById('results-table-head')
const newTable = document.createElement('table')
newTable.id = 'results-table'
// remove all sorting classes and set the relevant
findAll('.sortable', tableHeader).forEach((elem) => elem.classList.remove('asc', 'desc'))
tableHeader.querySelector(`.sortable[data-column-type="${sortAttr}"]`)?.classList.add(sortAsc ? 'desc' : 'asc')
newTable.appendChild(tableHeader)
if (!rows.length) {
const emptyTable = document.getElementById('template_results-table__body--empty').content.cloneNode(true)
newTable.appendChild(emptyTable)
} else {
rows.forEach((row) => {
if (!!row) {
findAll('.collapsible td:not(.col-links', row).forEach(addItemToggleListener)
find('.logexpander', row).addEventListener('click',
(evt) => evt.target.parentNode.classList.toggle('expanded'),
)
newTable.appendChild(row)
}
})
}
table.replaceWith(newTable)
}
const renderDerived = () => {
const currentFilter = getVisible()
possibleFilters.forEach((result) => {
const input = document.querySelector(`input[data-test-result="${result}"]`)
input.checked = currentFilter.includes(result)
})
}
const bindEvents = () => {
const filterColumn = (evt) => {
const { target: element } = evt
const { testResult } = element.dataset
doFilter(testResult, element.checked)
const collapsedIds = getCollapsedIds()
const updated = manager.renderData.tests.map((test) => {
return {
...test,
collapsed: collapsedIds.includes(test.id),
}
})
manager.setRender(updated)
redraw()
}
const header = document.getElementById('environment-header')
header.addEventListener('click', () => {
const table = document.getElementById('environment')
table.classList.toggle('hidden')
header.classList.toggle('collapsed')
})
findAll('input[name="filter_checkbox"]').forEach((elem) => {
elem.addEventListener('click', filterColumn)
})
findAll('.sortable').forEach((elem) => {
elem.addEventListener('click', (evt) => {
const { target: element } = evt
const { columnType } = element.dataset
doSort(columnType)
redraw()
})
})
document.getElementById('show_all_details').addEventListener('click', () => {
manager.allCollapsed = false
setCollapsedIds([])
redraw()
})
document.getElementById('hide_all_details').addEventListener('click', () => {
manager.allCollapsed = true
const allIds = manager.renderData.tests.map((test) => test.id)
setCollapsedIds(allIds)
redraw()
})
}
const redraw = () => {
const { testSubset } = manager
renderContent(testSubset)
renderDerived()
}
module.exports = {
redraw,
bindEvents,
renderStatic,
}
},{"./datamanager.js":1,"./dom.js":2,"./filter.js":3,"./sort.js":7,"./storage.js":8}],6:[function(require,module,exports){
class MediaViewer {
constructor(assets) {
this.assets = assets
this.index = 0
}
nextActive() {
this.index = this.index === this.assets.length - 1 ? 0 : this.index + 1
return [this.activeFile, this.index]
}
prevActive() {
this.index = this.index === 0 ? this.assets.length - 1 : this.index -1
return [this.activeFile, this.index]
}
get currentIndex() {
return this.index
}
get activeFile() {
return this.assets[this.index]
}
}
const setup = (resultBody, assets) => {
if (!assets.length) {
resultBody.querySelector('.media').classList.add('hidden')
return
}
const mediaViewer = new MediaViewer(assets)
const container = resultBody.querySelector('.media-container')
const leftArrow = resultBody.querySelector('.media-container__nav--left')
const rightArrow = resultBody.querySelector('.media-container__nav--right')
const mediaName = resultBody.querySelector('.media__name')
const counter = resultBody.querySelector('.media__counter')
const imageEl = resultBody.querySelector('img')
const sourceEl = resultBody.querySelector('source')
const videoEl = resultBody.querySelector('video')
const setImg = (media, index) => {
if (media?.format_type === 'image') {
imageEl.src = media.path
imageEl.classList.remove('hidden')
videoEl.classList.add('hidden')
} else if (media?.format_type === 'video') {
sourceEl.src = media.path
videoEl.classList.remove('hidden')
imageEl.classList.add('hidden')
}
mediaName.innerText = media?.name
counter.innerText = `${index + 1} / ${assets.length}`
}
setImg(mediaViewer.activeFile, mediaViewer.currentIndex)
const moveLeft = () => {
const [media, index] = mediaViewer.prevActive()
setImg(media, index)
}
const doRight = () => {
const [media, index] = mediaViewer.nextActive()
setImg(media, index)
}
const openImg = () => {
window.open(mediaViewer.activeFile.path, '_blank')
}
if (assets.length === 1) {
container.classList.add('media-container--fullscreen')
} else {
leftArrow.addEventListener('click', moveLeft)
rightArrow.addEventListener('click', doRight)
}
imageEl.addEventListener('click', openImg)
}
module.exports = {
setup,
}
},{}],7:[function(require,module,exports){
const { manager } = require('./datamanager.js')
const storageModule = require('./storage.js')
const genericSort = (list, key, ascending, customOrder) => {
let sorted
if (customOrder) {
sorted = list.sort((a, b) => {
const aValue = a.result.toLowerCase()
const bValue = b.result.toLowerCase()
const aIndex = customOrder.findIndex((item) => item.toLowerCase() === aValue)
const bIndex = customOrder.findIndex((item) => item.toLowerCase() === bValue)
// Compare the indices to determine the sort order
return aIndex - bIndex
})
} else {
sorted = list.sort((a, b) => a[key] === b[key] ? 0 : a[key] > b[key] ? 1 : -1)
}
if (ascending) {
sorted.reverse()
}
return sorted
}
const durationSort = (list, ascending) => {
const parseDuration = (duration) => {
if (duration.includes(':')) {
// If it's in the format "HH:mm:ss"
const [hours, minutes, seconds] = duration.split(':').map(Number)
return (hours * 3600 + minutes * 60 + seconds) * 1000
} else {
// If it's in the format "nnn ms"
return parseInt(duration)
}
}
const sorted = list.sort((a, b) => parseDuration(a['duration']) - parseDuration(b['duration']))
if (ascending) {
sorted.reverse()
}
return sorted
}
const doInitSort = () => {
const type = storageModule.getSort(manager.initialSort)
const ascending = storageModule.getSortDirection()
const list = manager.testSubset
const initialOrder = ['Error', 'Failed', 'Rerun', 'XFailed', 'XPassed', 'Skipped', 'Passed']
storageModule.setSort(type)
storageModule.setSortDirection(ascending)
if (type?.toLowerCase() === 'original') {
manager.setRender(list)
} else {
let sortedList
switch (type) {
case 'duration':
sortedList = durationSort(list, ascending)
break
case 'result':
sortedList = genericSort(list, type, ascending, initialOrder)
break
default:
sortedList = genericSort(list, type, ascending)
break
}
manager.setRender(sortedList)
}
}
const doSort = (type, skipDirection) => {
const newSortType = storageModule.getSort(manager.initialSort) !== type
const currentAsc = storageModule.getSortDirection()
let ascending
if (skipDirection) {
ascending = currentAsc
} else {
ascending = newSortType ? false : !currentAsc
}
storageModule.setSort(type)
storageModule.setSortDirection(ascending)
const list = manager.testSubset
const sortedList = type === 'duration' ? durationSort(list, ascending) : genericSort(list, type, ascending)
manager.setRender(sortedList)
}
module.exports = {
doInitSort,
doSort,
}
},{"./datamanager.js":1,"./storage.js":8}],8:[function(require,module,exports){
const possibleFilters = [
'passed',
'skipped',
'failed',
'error',
'xfailed',
'xpassed',
'rerun',
]
const getVisible = () => {
const url = new URL(window.location.href)
const settings = new URLSearchParams(url.search).get('visible')
const lower = (item) => {
const lowerItem = item.toLowerCase()
if (possibleFilters.includes(lowerItem)) {
return lowerItem
}
return null
}
return settings === null ?
possibleFilters :
[...new Set(settings?.split(',').map(lower).filter((item) => item))]
}
const hideCategory = (categoryToHide) => {
const url = new URL(window.location.href)
const visibleParams = new URLSearchParams(url.search).get('visible')
const currentVisible = visibleParams ? visibleParams.split(',') : [...possibleFilters]
const settings = [...new Set(currentVisible)].filter((f) => f !== categoryToHide).join(',')
url.searchParams.set('visible', settings)
window.history.pushState({}, null, unescape(url.href))
}
const showCategory = (categoryToShow) => {
if (typeof window === 'undefined') {
return
}
const url = new URL(window.location.href)
const currentVisible = new URLSearchParams(url.search).get('visible')?.split(',').filter(Boolean) ||
[...possibleFilters]
const settings = [...new Set([categoryToShow, ...currentVisible])]
const noFilter = possibleFilters.length === settings.length || !settings.length
noFilter ? url.searchParams.delete('visible') : url.searchParams.set('visible', settings.join(','))
window.history.pushState({}, null, unescape(url.href))
}
const getSort = (initialSort) => {
const url = new URL(window.location.href)
let sort = new URLSearchParams(url.search).get('sort')
if (!sort) {
sort = initialSort || 'result'
}
return sort
}
const setSort = (type) => {
const url = new URL(window.location.href)
url.searchParams.set('sort', type)
window.history.pushState({}, null, unescape(url.href))
}
const getCollapsedCategory = (renderCollapsed) => {
let categories
if (typeof window !== 'undefined') {
const url = new URL(window.location.href)
const collapsedItems = new URLSearchParams(url.search).get('collapsed')
switch (true) {
case !renderCollapsed && collapsedItems === null:
categories = ['passed']
break
case collapsedItems?.length === 0 || /^["']{2}$/.test(collapsedItems):
categories = []
break
case /^all$/.test(collapsedItems) || collapsedItems === null && /^all$/.test(renderCollapsed):
categories = [...possibleFilters]
break
default:
categories = collapsedItems?.split(',').map((item) => item.toLowerCase()) || renderCollapsed
break
}
} else {
categories = []
}
return categories
}
const getSortDirection = () => JSON.parse(sessionStorage.getItem('sortAsc')) || false
const setSortDirection = (ascending) => sessionStorage.setItem('sortAsc', ascending)
const getCollapsedIds = () => JSON.parse(sessionStorage.getItem('collapsedIds')) || []
const setCollapsedIds = (list) => sessionStorage.setItem('collapsedIds', JSON.stringify(list))
module.exports = {
getVisible,
hideCategory,
showCategory,
getCollapsedIds,
setCollapsedIds,
getSort,
setSort,
getSortDirection,
setSortDirection,
getCollapsedCategory,
possibleFilters,
}
},{}]},{},[4]);
</script>
</footer>
</html>