From 09b2ee326162dff6eb353f884b61aab6a7d16e55 Mon Sep 17 00:00:00 2001 From: Mat Moore Date: Tue, 9 Apr 2024 13:39:43 +0100 Subject: [PATCH 1/6] Expand table caption It's more helpful for a screen reader if table captions are specific. --- templates/details_table.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/details_table.html b/templates/details_table.html index ff580710..39a7a38c 100644 --- a/templates/details_table.html +++ b/templates/details_table.html @@ -76,7 +76,7 @@

{% if table.column_details %} - + From 151532c05a76ee77bc002f5478a1365c5f104c0e Mon Sep 17 00:00:00 2001 From: Mat Moore Date: Tue, 9 Apr 2024 13:41:01 +0100 Subject: [PATCH 2/6] Replace schema details with table details This link goes to the top of the table page, whereas the schema is displayed in a section below. --- templates/details_data_product.html | 2 +- templates/details_database.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/details_data_product.html b/templates/details_data_product.html index 321b8d37..333bceb9 100644 --- a/templates/details_data_product.html +++ b/templates/details_data_product.html @@ -91,7 +91,7 @@

{{ table.description|markdown:3 }} {% endif %} -

+ {% endwith %} {% endfor %} diff --git a/templates/details_database.html b/templates/details_database.html index 8a2c6f55..20624e96 100644 --- a/templates/details_database.html +++ b/templates/details_database.html @@ -91,7 +91,7 @@

{{ table.description|markdown:3 }} {% endif %} -

+ {% endwith %} {% endfor %} From f764775d1fde29bd67e9e6112548324f0a80255d Mon Sep 17 00:00:00 2001 From: Mat Moore Date: Tue, 9 Apr 2024 13:44:47 +0100 Subject: [PATCH 3/6] Fix heading structure on details pages These were missing an h1 heading. --- templates/details_data_product.html | 2 +- templates/details_database.html | 2 +- templates/details_table.html | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/templates/details_data_product.html b/templates/details_data_product.html index 333bceb9..48d8978e 100644 --- a/templates/details_data_product.html +++ b/templates/details_data_product.html @@ -20,7 +20,7 @@
Data product -

{{result.name}}

+

{{result.name}}

diff --git a/templates/details_database.html b/templates/details_database.html index 20624e96..63519243 100644 --- a/templates/details_database.html +++ b/templates/details_database.html @@ -20,7 +20,7 @@
Database -

{{result.name}}

+

{{result.name}}

diff --git a/templates/details_table.html b/templates/details_table.html index 39a7a38c..b220dd0a 100644 --- a/templates/details_table.html +++ b/templates/details_table.html @@ -26,7 +26,7 @@
Table -

{{table.name}}

+

{{table.name}}

From a05d15ab8580da4e9e231ef9b3b4ed1d4c740b4a Mon Sep 17 00:00:00 2001 From: Mat Moore Date: Tue, 9 Apr 2024 13:45:42 +0100 Subject: [PATCH 4/6] replace schema with table schema --- templates/details_table.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/details_table.html b/templates/details_table.html index b220dd0a..bfde4395 100644 --- a/templates/details_table.html +++ b/templates/details_table.html @@ -97,7 +97,7 @@

SchemaTable schema
Column name Schema details Table details
Schema details Table details
{% else %} -

Schema

+

Table schema

The schema for this table is not available.

{% endif %} From 09b1316c939bfe1baccd9455deea77904e9367b7 Mon Sep 17 00:00:00 2001 From: Mat Moore Date: Tue, 9 Apr 2024 13:49:43 +0100 Subject: [PATCH 5/6] Render a message when tables are missing for any reason --- templates/details_data_product.html | 5 +++++ templates/details_database.html | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/templates/details_data_product.html b/templates/details_data_product.html index 48d8978e..aaec170a 100644 --- a/templates/details_data_product.html +++ b/templates/details_data_product.html @@ -70,6 +70,7 @@

+ {% if tables %} @@ -97,6 +98,10 @@

{% endfor %}

Data product content
+ {% else %} +

Data product content

+

This data product is missing table information.

+ {% endif %}

diff --git a/templates/details_database.html b/templates/details_database.html index 63519243..2c55d1d9 100644 --- a/templates/details_database.html +++ b/templates/details_database.html @@ -70,6 +70,7 @@

+ {% if tables %} @@ -97,6 +98,10 @@

{% endfor %}

Database content
+ {% else %} +

Database content

+

This database is missing table information.

+ {% endif %}
From 067fb0e4a970c1d7c0021d2f1c804ae7883ee275 Mon Sep 17 00:00:00 2001 From: Mat Moore Date: Tue, 9 Apr 2024 14:29:38 +0100 Subject: [PATCH 6/6] Update selenium --- tests/selenium/conftest.py | 3 +++ tests/selenium/test_search_scenarios.py | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/selenium/conftest.py b/tests/selenium/conftest.py index b9c7de25..c2e27cdf 100644 --- a/tests/selenium/conftest.py +++ b/tests/selenium/conftest.py @@ -68,6 +68,9 @@ def __init__(self, selenium): class DataProductDetailsPage(Page): + def primary_heading(self): + return self.selenium.find_element(By.TAG_NAME, "h1") + def secondary_heading(self): return self.selenium.find_element(By.TAG_NAME, "h2") diff --git a/tests/selenium/test_search_scenarios.py b/tests/selenium/test_search_scenarios.py index be6cf315..20468930 100644 --- a/tests/selenium/test_search_scenarios.py +++ b/tests/selenium/test_search_scenarios.py @@ -263,9 +263,9 @@ def click_on_the_first_result(self): def verify_i_am_on_the_details_page(self, item_name): assert item_name in self.selenium.title - secondary_heading_text = self.details_data_product_page.secondary_heading().text + heading_text = self.details_data_product_page.primary_heading().text - assert secondary_heading_text == item_name + assert heading_text == item_name def enter_a_query_and_submit(self, query): search_bar = self.search_page.search_bar()