aboutsummaryrefslogtreecommitdiffstats
path: root/ctrack/users/tests/test_functional.py
diff options
context:
space:
mode:
authorMatthew Lemon <lemon@matthewlemon.com>2020-05-28 14:11:10 +0100
committerMatthew Lemon <lemon@matthewlemon.com>2020-05-28 14:11:10 +0100
commitd2d4f32ff1def1cb6ed519bfa4e2b2b8be3ced2c (patch)
treec2e1f07ad0f9f00c25455c890977c70b39ec0eee /ctrack/users/tests/test_functional.py
parentdf8f55519b2e2ed0db5e3175041c8d4321c830b8 (diff)
added a test to get h2 tags from stakeholder homepage
Diffstat (limited to '')
-rw-r--r--ctrack/users/tests/test_functional.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/ctrack/users/tests/test_functional.py b/ctrack/users/tests/test_functional.py
index da9d088..3449c9a 100644
--- a/ctrack/users/tests/test_functional.py
+++ b/ctrack/users/tests/test_functional.py
@@ -104,3 +104,27 @@ def test_stakeholder_user_with_permissions_can_view_page(
# Try to browser to Organisations list
browser.get(live_server + "/organisations")
assert "Organisations" in browser.title
+
+
+def test_stakeholder_user_can_see_requisite_subtitles_on_home_page(
+ browser, live_server, stakeholder
+):
+ user = User.objects.create_user(username="toss", password="knob")
+ user.stakeholder = stakeholder
+ user.save()
+ browser.get(live_server + "/accounts/login")
+ browser.find_element_by_id("id_login").send_keys("toss")
+ browser.find_element_by_id("id_password").send_keys("knob")
+ browser.find_element_by_id("sign_in_button").submit()
+ time.sleep(1)
+ current_url = browser.current_url
+ assert current_url == live_server + "/"
+
+ # On the other side, he sees some basic details about himself.
+ assert "ctrack - Department for Transport" in browser.title
+
+ h2 = browser.find_elements_by_tag_name("h2")
+ assert "Incident Reporting" in [x.text for x in h2]
+ assert "Audits and Inspections" in [x.text for x in h2]
+ assert "NIS systems" in [x.text for x in h2]
+ assert "DfT Engagement" in [x.text for x in h2]