@@ -158,7 +158,27 @@ test.describe.serial('Start now In person visit - Paperwork submission flow with
158158 await expect ( locator . flowHeading ) . toHaveText ( 'Photo ID' ) ;
159159 } ) ;
160160 test ( 'SNPRF-8 Skip photo ID and complete consent forms' , async ( ) => {
161- await paperwork . skipPhotoID ( ) ;
161+ const photoIdFrontRequired = QuestionnaireHelper . inPersonIsPhotoIdFrontRequired ( ) ;
162+ const photoIdBackRequired = QuestionnaireHelper . inPersonIsPhotoIdBackRequired ( ) ;
163+
164+ if ( ! photoIdFrontRequired && ! photoIdBackRequired ) {
165+ // Photo ID is optional, skip it
166+ await paperwork . skipPhotoID ( ) ;
167+ } else {
168+ // Photo ID is required, upload photos
169+ if ( photoIdFrontRequired ) {
170+ await paperwork . uploadPhoto . fillPhotoFrontID ( ) ;
171+ }
172+ if ( photoIdBackRequired ) {
173+ await paperwork . uploadPhoto . fillPhotoBackID ( ) ;
174+ }
175+ // Wait for files to be uploaded before continuing
176+ const expectedFileCount = ( photoIdFrontRequired ? 1 : 0 ) + ( photoIdBackRequired ? 1 : 0 ) ;
177+ if ( expectedFileCount > 0 ) {
178+ await expect ( page . getByTestId ( 'file-card-clear-button' ) ) . toHaveCount ( expectedFileCount , { timeout : 60000 } ) ;
179+ }
180+ await commonLocatorsHelper . clickContinue ( ) ;
181+ }
162182 await paperwork . fillConsentForms ( ) ;
163183 await commonLocatorsHelper . clickContinue ( ) ;
164184 await commonLocatorsHelper . clickContinue ( ) ;
0 commit comments