diff --git a/features/agree_terms_of_use.feature b/features/agree_terms_of_use.feature index 77ef896a..106f21de 100644 --- a/features/agree_terms_of_use.feature +++ b/features/agree_terms_of_use.feature @@ -1,5 +1,5 @@ @TermsOfUse -Feature: Check if you need an appointment page +Feature: Agree terms of use page Scenario: The page is accessible Given I am logged in When I go to "/agree-terms-of-use" diff --git a/features/check_need_appointment.feature b/features/check_need_appointment.feature index 6b520b21..8aec67d8 100644 --- a/features/check_need_appointment.feature +++ b/features/check_need_appointment.feature @@ -4,6 +4,7 @@ Feature: Check if you need an appointment page Given I am logged in And I have answered have you ever smoked with an eligible response And I have answered date of birth with an eligible date of birth + And I have answered questions showing I have accepted the terms of use When I go to "/check-if-you-need-an-appointment" Then there are no accessibility violations diff --git a/features/date_of_birth_page.feature b/features/date_of_birth_page.feature index 463b3720..ad2540d8 100644 --- a/features/date_of_birth_page.feature +++ b/features/date_of_birth_page.feature @@ -2,6 +2,7 @@ Feature: Date of birth page Scenario: The page is accessible Given I am logged in + And I have answered questions showing I have accepted the terms of use And I have answered have you ever smoked with an eligible response When I go to "/date-of-birth" Then there are no accessibility violations diff --git a/features/have_you_ever_smoked_page.feature b/features/have_you_ever_smoked_page.feature index c567608d..5a181afd 100644 --- a/features/have_you_ever_smoked_page.feature +++ b/features/have_you_ever_smoked_page.feature @@ -2,6 +2,7 @@ Feature: Have you ever smoked page Scenario: The page is accessible Given I am logged in + And I have answered questions showing I have accepted the terms of use When I go to "/have-you-ever-smoked" Then there are no accessibility violations diff --git a/features/static.feature b/features/static.feature index 96e969d2..7dafe14f 100644 --- a/features/static.feature +++ b/features/static.feature @@ -11,6 +11,8 @@ Feature: Static Pages And I see a page title "NHS check if you need a lung scan privacy policy" When I go to "/contact-us" Then I see a page title "Contact us" + when I go to "/terms-of-use" + Then I see a page title "NHS check if you need a lung scan terms of use" Scenario: The static pages are available when logged in and accessible Given I am logged in @@ -27,3 +29,6 @@ Feature: Static Pages When I go to "/contact-us" Then there are no accessibility violations And I see a page title "Contact us" + And there are no accessibility violations + When I go to "/terms-of-use" + Then I see a page title "NHS check if you need a lung scan terms of use" diff --git a/lung_cancer_screening/core/jinja2/layout.jinja b/lung_cancer_screening/core/jinja2/layout.jinja index 5375a9ca..3a087950 100644 --- a/lung_cancer_screening/core/jinja2/layout.jinja +++ b/lung_cancer_screening/core/jinja2/layout.jinja @@ -9,7 +9,7 @@ {% endblock %} -{% block pageTitle %}Check if you need a lung scan{% endblock %} +{% block pageTitle %}{{ page_title|default("Check if you need a lung scan – NHS") }}{% endblock %} {% block header %} {{ header({ diff --git a/lung_cancer_screening/questions/forms/smoked_amount_form.py b/lung_cancer_screening/questions/forms/smoked_amount_form.py index 384f9d19..277a2050 100644 --- a/lung_cancer_screening/questions/forms/smoked_amount_form.py +++ b/lung_cancer_screening/questions/forms/smoked_amount_form.py @@ -88,6 +88,14 @@ def min_value_error_message(self): "must be at least 1" ) + def page_title(self) -> str: + if self.tobacco_smoking_history.is_normal(): + return (f"Number of {self.presenter.unit()} you normally {self.presenter.smoke_or_smoked()}") + else: + return(f"Number of {self.presenter.unit()} you smoked when your smoking {self.presenter.increased_or_decreased()}") + + + class Meta: model = SmokedAmountResponse fields = ['value'] diff --git a/lung_cancer_screening/questions/forms/smoked_total_years_form.py b/lung_cancer_screening/questions/forms/smoked_total_years_form.py index c3423825..a9967261 100644 --- a/lung_cancer_screening/questions/forms/smoked_total_years_form.py +++ b/lung_cancer_screening/questions/forms/smoked_total_years_form.py @@ -110,6 +110,8 @@ def greater_than_years_smoked_error_message(self): else: return self.changed_greater_than_years_smoked_error_message() + def page_title(self): + return self.label() class Meta: model = SmokedTotalYearsResponse diff --git a/lung_cancer_screening/questions/forms/smoking_change_form.py b/lung_cancer_screening/questions/forms/smoking_change_form.py index 8d9a471e..0e1f3fc4 100644 --- a/lung_cancer_screening/questions/forms/smoking_change_form.py +++ b/lung_cancer_screening/questions/forms/smoking_change_form.py @@ -96,6 +96,9 @@ def is_valid(self): return False return True + def page_title(self): + return f"Did the number of {self.tobacco_smoking_history.unit()} you smoke change over time?" + def _delete_levels_not_selected(self): for level in self._existing_levels(): diff --git a/lung_cancer_screening/questions/forms/smoking_frequency_form.py b/lung_cancer_screening/questions/forms/smoking_frequency_form.py index f2b498de..d219295c 100644 --- a/lung_cancer_screening/questions/forms/smoking_frequency_form.py +++ b/lung_cancer_screening/questions/forms/smoking_frequency_form.py @@ -85,3 +85,10 @@ def required_error_message(self): return self.normal_required_error_message() else: return self.changed_required_error_message() + + + def page_title(self): + if self.tobacco_smoking_history.is_normal(): + return(f"How often {self.presenter.do_or_did()} you smoke {self.presenter.human_type().lower()}?") + else: + return f"How often you {self.presenter.smoke_or_smoked()} {self.presenter.human_type().lower()} when your smoking {self.presenter.increased_or_decreased()}" diff --git a/lung_cancer_screening/questions/jinja2/age_range_exit.jinja b/lung_cancer_screening/questions/jinja2/age_range_exit.jinja index 66a5595c..e31e120a 100644 --- a/lung_cancer_screening/questions/jinja2/age_range_exit.jinja +++ b/lung_cancer_screening/questions/jinja2/age_range_exit.jinja @@ -1,6 +1,7 @@ {% extends 'layout.jinja' %} {% from 'nhsuk/components/back-link/macro.jinja' import backLink %} +{% block pageTitle %}You are not in the age range for NHS lung cancer screening – NHS{% endblock %} {% block beforeContent %}