Skip to content

Commit f136aed

Browse files
authored
Merge pull request #6020 from masslight/downstream-test-fix
photo id walkin test fix
2 parents 52cc0d9 + e09c835 commit f136aed

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

apps/intake/tests/specs/in-person/PaperworkWalkIn.spec.ts

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)