@@ -93,7 +93,7 @@ def define_supplementary_letter(
9393 priority_id : str = "12016" ,
9494 signatory : str = "signatory" ,
9595 job_title : str = "job title" ,
96- paragraph_text : str = "body text"
96+ paragraph_text : str = "body text" ,
9797 ) -> None :
9898 """
9999 Fills out the form to define a supplementary letter and confirms save via modal.
@@ -118,3 +118,50 @@ def define_supplementary_letter(
118118 self .page .get_by_role ("button" , name = "Save" ).click ()
119119
120120
121+ class LetterDefinitionDetailPage (BasePage ):
122+ """Page object for the Letter Definition detail view"""
123+
124+ def __init__ (self , page : Page ):
125+ super ().__init__ (page )
126+ self .page = page
127+
128+ # Locators for each letter definition setting
129+ self .definition_table = self .page .locator ("table#displayRS" )
130+ self .current_version_label = self .page .get_by_text (
131+ "Current Version" , exact = True
132+ )
133+
134+ def assert_definition_setting (self , field_name : str , expected_value : str ) -> None :
135+ """
136+ Asserts that a specific letter setting matches the expected value.
137+
138+ Args:
139+ field_name (str): The label text (e.g., "Description")
140+ expected_value (str): The expected value shown beside the label
141+ """
142+ label_cell = self .page .locator (f"td.screenTableLabelCell" , has_text = field_name )
143+ assert (
144+ label_cell .count () > 0
145+ ), f"[ASSERTION FAILED] Field label '{ field_name } ' not found"
146+
147+ # The label is always followed by its corresponding input/value cell
148+ value_cell = label_cell .nth (0 ).locator ("xpath=following-sibling::td[1]" )
149+ actual_value = value_cell .inner_text ().strip ()
150+
151+ assert (
152+ actual_value == expected_value
153+ ), f"[ASSERTION FAILED] For field '{ field_name } ', expected '{ expected_value } ', got '{ actual_value } '"
154+
155+ def has_current_version (self ) -> bool :
156+ """
157+ Checks whether a version row exists with 'Current' as the type.
158+
159+ Returns:
160+ bool: True if a current version row is present, False otherwise
161+ """
162+ version_table = self .page .locator ("table#displayRS" )
163+ current_row = version_table .locator ("tr" ).filter (
164+ has = self .page .locator ("td" , has_text = "Current" )
165+ ).first
166+
167+ return current_row .count () > 0
0 commit comments