@@ -18,7 +18,13 @@ def test_adding_breast_augmentation(self):
1818 self .when_i_click_on_add_breast_augmentation ()
1919 self .then_i_see_the_add_breast_augmentation_form ()
2020
21+ self .when_i_click_save_without_entering_details ()
22+ self .then_i_see_validation_errors_for_missing_benign_lump_details ()
23+
2124 self .when_i_select_procedures ()
25+ self .and_i_enter_the_procedure_year ()
26+ self .and_i_enter_the_removal_year ()
27+ self .and_i_enter_additional_details ()
2228 self .and_i_click_save_augmentation ()
2329 self .then_i_am_back_on_the_medical_information_page ()
2430 self .and_the_augmentation_is_listed ()
@@ -59,6 +65,18 @@ def then_i_see_the_add_breast_augmentation_form(self):
5965 "Add details of breast implants or augmentation"
6066 )
6167
68+ def then_i_see_validation_errors_for_missing_benign_lump_details (self ):
69+ self .expect_validation_error (
70+ error_text = "Select procedures for the right breast" ,
71+ fieldset_legend = "Right breast" ,
72+ field_label = "Breast implants (silicone or saline)" ,
73+ )
74+ self .expect_validation_error (
75+ error_text = "Select procedures for the left breast" ,
76+ fieldset_legend = "Left breast" ,
77+ field_label = "Breast implants (silicone or saline)" ,
78+ )
79+
6280 def when_i_select_procedures (self ):
6381 self .page .get_by_role ("group" , name = "Right breast" ).get_by_label (
6482 "Breast implants (silicone or saline)" , exact = True
@@ -67,6 +85,21 @@ def when_i_select_procedures(self):
6785 "Other augmentation" , exact = True
6886 ).click ()
6987
88+ def and_i_enter_the_procedure_year (self ):
89+ self .page .get_by_label ("Year of procedure (optional)" , exact = True ).fill ("2000" )
90+
91+ def and_i_enter_the_removal_year (self ):
92+ self .page .get_by_text ("Implants have been removed" ).click ()
93+ self .page .get_by_label ("Year removed (if available)" , exact = True ).fill ("2025" )
94+
95+ def and_i_enter_additional_details (self ):
96+ self .page .get_by_label ("Additional details (optional)" , exact = True ).fill (
97+ "additional details for test of breast augmentation history"
98+ )
99+
100+ def when_i_click_save_without_entering_details (self ):
101+ self .and_i_click_save_augmentation ()
102+
70103 def and_i_click_save_augmentation (self ):
71104 self .page .get_by_text ("Save" ).click ()
72105
@@ -82,7 +115,12 @@ def and_the_augmentation_is_listed(self):
82115 expect (row ).to_contain_text (
83116 "Right breast: Breast implants (silicone or saline)"
84117 )
85- expect (row ).to_contain_text ("Other augmentation" )
118+ expect (row ).to_contain_text ("Left breast: Other augmentation" )
119+ expect (row ).to_contain_text ("2000" )
120+ expect (row ).to_contain_text ("Yes (2025)" )
121+ expect (row ).to_contain_text (
122+ "additional details for test of breast augmentation history"
123+ )
86124
87125 def and_the_message_says_augmentation_added (self ):
88126 alert = self .page .get_by_role ("alert" )
0 commit comments