Skip to content

Commit

Permalink
new frontend tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jenriordan committed Dec 18, 2024
1 parent 3da356c commit 7a5e5fa
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/test_frontend/fixtures/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
RecipientBase,
StartBase,
)
from tests.test_frontend.fixtures.data import LEGAL_GROUNDS_HEADERS


class TestLicensingGrounds(StartBase, ProviderBase, RecipientBase, LicensingGroundsBase):
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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"))

0 comments on commit 7a5e5fa

Please sign in to comment.