Skip to content

Commit 4bc62e2

Browse files
changed function calls, extract login to func
1 parent 532ebcf commit 4bc62e2

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

manage_breast_screening/tests/system/clinical/test_clinic_show_page.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,13 @@ def test_accessibility(self):
6565
self.then_the_accessibility_baseline_is_met()
6666

6767
def test_status_attribution_display(self):
68-
user_in_progress = UserFactory(first_name="Alice", last_name="User")
69-
self.login_as_role(Role.CLINICAL, user_in_progress)
68+
self.given_i_am_logged_in_as_a_user_with_appointment_in_progress()
7069
self.and_a_clinic_exists_that_is_run_by_my_provider()
7170
self.and_there_are_appointments_in_various_states_with_attributed_users()
7271
self.and_i_am_on_the_clinic_show_page()
7372
self.when_i_click_on_all()
7473
self.then_i_can_see_status_attribution_for_relevant_appointments()
74+
self.then_i_can_see_you_in_status_attribution()
7575

7676
def and_a_clinic_exists_that_is_run_by_my_provider(self):
7777
user_assignment = self.current_user.assignments.first()
@@ -326,3 +326,15 @@ def then_i_can_see_status_attribution_for_relevant_appointments(self):
326326

327327
cancelled_row = self.page.locator("tr").filter(has_text="Participant Cancelled")
328328
expect(cancelled_row).to_contain_text("by C. User")
329+
330+
def given_i_am_logged_in_as_a_user_with_appointment_in_progress(self):
331+
# Create and log in the user who will be attributed with the IN_PROGRESS status
332+
user_in_progress = UserFactory(first_name="Alice", last_name="User")
333+
self.login_as_role(Role.CLINICAL, user_in_progress)
334+
335+
def then_i_can_see_you_in_status_attribution(self):
336+
# Check that the "(you)" indicator is present for the in-progress attribution
337+
in_progress_row = self.page.locator("tr").filter(
338+
has_text="Participant InProgress"
339+
)
340+
expect(in_progress_row).to_contain_text("(you)")

0 commit comments

Comments
 (0)