File tree Expand file tree Collapse file tree 1 file changed +22
-3
lines changed
pages/screening_subject_search Expand file tree Collapse file tree 1 file changed +22
-3
lines changed Original file line number Diff line number Diff line change 1- from playwright .sync_api import Page , expect
1+ from playwright .sync_api import Page , expect , Locator
22from pages .base_page import BasePage
33from enum import StrEnum
44
@@ -18,9 +18,28 @@ def __init__(self, page: Page):
1818 )
1919 self .save_button = self .page .get_by_role ("button" , name = "Save" )
2020
21+ def get_test_outcome_locator (self , outcome_name : str ) -> Locator :
22+ """
23+ Get the locator for the test outcome dynamically.
24+
25+ Args:
26+ outcome_name (str): The accessible name or visible text of the test outcome cell.
27+
28+ Returns:
29+ Locator: A Playwright Locator object for the specified test outcome cell.
30+ """
31+ return self .page .get_by_role ("cell" , name = outcome_name ).nth (1 )
32+
2133 def verify_diagnostic_test_outcome (self , outcome_name : str ) -> None :
22- """Verify that the diagnostic test outcome is visible."""
23- expect (self .test_outcome_result ).to_be_visible ()
34+ """
35+ Verify that the diagnostic test outcome is visible.
36+
37+ Args:
38+ outcome_name (str): The accessible name or visible text of the test outcome cell to verify.
39+ """
40+
41+ test_outcome_locator = self .get_test_outcome_locator (outcome_name )
42+ expect (test_outcome_locator ).to_be_visible ()
2443
2544 def select_test_outcome_option (self , option : str ) -> None :
2645 """Select an option from the Outcome of Diagnostic Test dropdown."""
You can’t perform that action at this time.
0 commit comments