diff --git a/tests/test_frontend/fixtures/data.py b/tests/test_frontend/fixtures/data.py index cec5a3fa..b4f5bf2a 100644 --- a/tests/test_frontend/fixtures/data.py +++ b/tests/test_frontend/fixtures/data.py @@ -27,3 +27,13 @@ "county": "County", "country": "DE", } + +LEGAL_GROUNDS_HEADERS = { + "legal_only": "Which of these licensing grounds describes the purpose of the relevant activity for which the " + "legal advice is being given? - Apply for a licence to provide sanctioned trade services - GOV.UK", + "legal_excluded": "For the other services you want to provide (excluding legal advisory), which of these " + "licensing grounds describes your purpose for providing them? - Apply for a licence to " + "provide sanctioned trade services - GOV.UK", + "non_legal": "Which of these licensing grounds describes your purpose for providing the sanctioned services? - " + "Apply for a licence to provide sanctioned trade services - GOV.UK", +} diff --git a/tests/test_frontend/test_apply_for_a_licence/test_licensing_grounds/test_licensing_grounds.py b/tests/test_frontend/test_apply_for_a_licence/test_licensing_grounds/test_licensing_grounds.py index 23c45f59..c869dd92 100644 --- a/tests/test_frontend/test_apply_for_a_licence/test_licensing_grounds/test_licensing_grounds.py +++ b/tests/test_frontend/test_apply_for_a_licence/test_licensing_grounds/test_licensing_grounds.py @@ -8,6 +8,7 @@ RecipientBase, StartBase, ) +from tests.test_frontend.fixtures.data import LEGAL_GROUNDS_HEADERS class TestLicensingGrounds(StartBase, ProviderBase, RecipientBase, LicensingGroundsBase): @@ -24,6 +25,13 @@ def test_legal(self): expect(self.page).to_have_url(re.compile(r".*/add-recipient")) self.no_more_additions(self.page) expect(self.page).to_have_url(re.compile(r".*/licensing-grounds")) + expect(self.page).to_have_title(LEGAL_GROUNDS_HEADERS["legal_only"]) + self.page.get_by_label("Civil society activities that").check() + self.page.get_by_role("button", name="Continue").click() + expect(self.page).to_have_url(re.compile(r".*/services-purpose")) + self.page.get_by_label("What is your purpose").fill("test") + self.page.get_by_role("button", name="Continue").click() + expect(self.page).to_have_url(re.compile(r".*/upload-documents")) def test_non_legal(self): self.page.goto(self.base_url) @@ -36,6 +44,13 @@ def test_non_legal(self): expect(self.page).to_have_url(re.compile(r".*/add-recipient")) self.no_more_additions(self.page) expect(self.page).to_have_url(re.compile(r".*/licensing-grounds")) + expect(self.page).to_have_title(LEGAL_GROUNDS_HEADERS["non_legal"]) + self.page.get_by_label("The delivery of humanitarian").check() + self.page.get_by_role("button", name="Continue").click() + expect(self.page).to_have_url(re.compile(r".*/services-purpose")) + self.page.get_by_label("What is your purpose").fill("test") + self.page.get_by_role("button", name="Continue").click() + expect(self.page).to_have_url(re.compile(r".*/upload-documents")) def test_legal_and_other(self): self.page.goto(self.base_url) @@ -48,6 +63,14 @@ def test_legal_and_other(self): expect(self.page).to_have_url(re.compile(r".*/add-recipient")) self.no_more_additions(self.page) expect(self.page).to_have_url(re.compile(r".*/licensing-grounds")) + expect(self.page).to_have_title(LEGAL_GROUNDS_HEADERS["legal_only"]) self.page.get_by_label("Civil society activities that").check() self.page.get_by_role("button", name="Continue").click() expect(self.page).to_have_url(re.compile(r".*/other-licensing-grounds")) + expect(self.page).to_have_title(LEGAL_GROUNDS_HEADERS["legal_excluded"]) + self.page.get_by_label("The delivery of humanitarian").check() + self.page.get_by_role("button", name="Continue").click() + expect(self.page).to_have_url(re.compile(r".*/services-purpose")) + self.page.get_by_label("What is your purpose").fill("test") + self.page.get_by_role("button", name="Continue").click() + expect(self.page).to_have_url(re.compile(r".*/upload-documents"))