Skip to content

Commit d00df32

Browse files
authored
Merge pull request #5626 from masslight/fix-setup
skip telemed prebook when config says so
2 parents d58f30d + 2a6756a commit d00df32

File tree

3 files changed

+66
-53
lines changed

3 files changed

+66
-53
lines changed

apps/intake/tests/specs/0_paperworkSetup/setup.spec.ts

Lines changed: 55 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ test.afterAll(async () => {
3636
import { CancelPage } from 'tests/utils/CancelPage';
3737
import { BaseInPersonFlow } from 'tests/utils/in-person/BaseInPersonFlow';
3838
import { ResourceHandler } from 'tests/utils/resource-handler';
39-
import { chooseJson, CreateAppointmentResponse, GetSlotDetailsResponse, PROJECT_NAME } from 'utils';
39+
import { BOOKING_CONFIG, chooseJson, CreateAppointmentResponse, GetSlotDetailsResponse, PROJECT_NAME } from 'utils';
4040
import { FillingInfo as InPersonFillingInfo } from '../../utils/in-person/FillingInfo';
4141
import { PrebookInPersonFlow } from '../../utils/in-person/PrebookInPersonFlow';
4242
import { Locators } from '../../utils/locators';
@@ -362,60 +362,64 @@ test.describe.parallel('In-Person: Create test patients and appointments', () =>
362362
});
363363

364364
test.describe.parallel('Telemed: Create test patients and appointments', () => {
365-
test('Create patient with responsible party with insurance payment prebook appointment', async ({ page }) => {
366-
const { prebookFlowClass, paperwork } = await test.step('Set up playwright', async () => {
367-
addAppointmentToIdsAndAddMetaTag(page, processId);
368-
const prebookFlowClass = new PrebookTelemedFlow(page);
369-
const paperwork = new Paperwork(page);
370-
return { prebookFlowClass, paperwork };
371-
});
365+
const TMPrebookDependentTest = BOOKING_CONFIG.homepageOptions.includes('schedule-virtual-visit') ? test : test.skip;
366+
TMPrebookDependentTest(
367+
'Create patient with responsible party with insurance payment prebook appointment',
368+
async ({ page }) => {
369+
const { prebookFlowClass, paperwork } = await test.step('Set up playwright', async () => {
370+
addAppointmentToIdsAndAddMetaTag(page, processId);
371+
const prebookFlowClass = new PrebookTelemedFlow(page);
372+
const paperwork = new Paperwork(page);
373+
return { prebookFlowClass, paperwork };
374+
});
372375

373-
const { bookingData, filledPaperwork } = await test.step('Book first appointment', async () => {
374-
await prebookFlowClass.selectVisitAndContinue();
375-
const bookingData = await prebookFlowClass.startVisitWithoutPaperwork();
376-
await paperwork.clickProceedToPaperwork();
377-
const filledPaperwork = await prebookFlowClass.fillPaperwork({
378-
payment: 'insurance',
379-
responsibleParty: 'not-self',
380-
patientBasicInfo: bookingData.patientBasicInfo,
376+
const { bookingData, filledPaperwork } = await test.step('Book first appointment', async () => {
377+
await prebookFlowClass.selectVisitAndContinue();
378+
const bookingData = await prebookFlowClass.startVisitWithoutPaperwork();
379+
await paperwork.clickProceedToPaperwork();
380+
const filledPaperwork = await prebookFlowClass.fillPaperwork({
381+
payment: 'insurance',
382+
responsibleParty: 'not-self',
383+
patientBasicInfo: bookingData.patientBasicInfo,
384+
});
385+
await prebookFlowClass.completeBooking();
386+
await prebookFlowClass.cancelAppointment();
387+
return { bookingData, filledPaperwork };
381388
});
382-
await prebookFlowClass.completeBooking();
383-
await prebookFlowClass.cancelAppointment();
384-
return { bookingData, filledPaperwork };
385-
});
386389

387-
await test.step('Book second appointment without filling paperwork', async () => {
388-
await prebookFlowClass.selectVisitAndContinue();
389-
await prebookFlowClass.startVisitWithoutPaperwork(bookingData.patientBasicInfo);
390-
});
390+
await test.step('Book second appointment without filling paperwork', async () => {
391+
await prebookFlowClass.selectVisitAndContinue();
392+
await prebookFlowClass.startVisitWithoutPaperwork(bookingData.patientBasicInfo);
393+
});
391394

392-
await test.step('Write test data to file', async () => {
393-
const prebookTelemedPatient: TelemedPrebookPatientTestData = {
394-
firstName: bookingData.patientBasicInfo.firstName,
395-
lastName: bookingData.patientBasicInfo.lastName,
396-
email: bookingData.patientBasicInfo.email,
397-
birthSex: bookingData.patientBasicInfo.birthSex,
398-
dateOfBirth: bookingData.patientBasicInfo.dob,
399-
appointmentId: getLastAppointmentId(page),
400-
state: filledPaperwork.stateValue,
401-
// todo because i'm not great at type conditional types apparently
402-
patientDetailsData: filledPaperwork.patientDetailsData as PatientDetailsData,
403-
// todo because i'm not great at type conditional types apparently
404-
pcpData: filledPaperwork.pcpData as PrimaryCarePhysicianData,
405-
insuranceData: filledPaperwork.insuranceData,
406-
secondaryInsuranceData: filledPaperwork.secondaryInsuranceData,
407-
responsiblePartyData: filledPaperwork.responsiblePartyData,
408-
medicationData: filledPaperwork.medicationData,
409-
allergiesData: filledPaperwork.allergiesData,
410-
medicalHistoryData: filledPaperwork.medicalHistoryData,
411-
surgicalHistoryData: filledPaperwork.surgicalHistoryData,
412-
flags: filledPaperwork.flags!,
413-
uploadedPhotoCondition: filledPaperwork.uploadedPhotoCondition,
414-
};
415-
console.log('prebookTelemedPatient', JSON.stringify(prebookTelemedPatient));
416-
writeTestData('prebookTelemedPatient.json', prebookTelemedPatient);
417-
});
418-
});
395+
await test.step('Write test data to file', async () => {
396+
const prebookTelemedPatient: TelemedPrebookPatientTestData = {
397+
firstName: bookingData.patientBasicInfo.firstName,
398+
lastName: bookingData.patientBasicInfo.lastName,
399+
email: bookingData.patientBasicInfo.email,
400+
birthSex: bookingData.patientBasicInfo.birthSex,
401+
dateOfBirth: bookingData.patientBasicInfo.dob,
402+
appointmentId: getLastAppointmentId(page),
403+
state: filledPaperwork.stateValue,
404+
// todo because i'm not great at type conditional types apparently
405+
patientDetailsData: filledPaperwork.patientDetailsData as PatientDetailsData,
406+
// todo because i'm not great at type conditional types apparently
407+
pcpData: filledPaperwork.pcpData as PrimaryCarePhysicianData,
408+
insuranceData: filledPaperwork.insuranceData,
409+
secondaryInsuranceData: filledPaperwork.secondaryInsuranceData,
410+
responsiblePartyData: filledPaperwork.responsiblePartyData,
411+
medicationData: filledPaperwork.medicationData,
412+
allergiesData: filledPaperwork.allergiesData,
413+
medicalHistoryData: filledPaperwork.medicalHistoryData,
414+
surgicalHistoryData: filledPaperwork.surgicalHistoryData,
415+
flags: filledPaperwork.flags!,
416+
uploadedPhotoCondition: filledPaperwork.uploadedPhotoCondition,
417+
};
418+
console.log('prebookTelemedPatient', JSON.stringify(prebookTelemedPatient));
419+
writeTestData('prebookTelemedPatient.json', prebookTelemedPatient);
420+
});
421+
}
422+
);
419423

420424
test('Create patient without responsible party and card payment walk-in appointment', async ({ page }) => {
421425
const walkInFlowClass = await test.step('Set up playwright', async () => {

apps/intake/tests/specs/telemed/PaperworkTelemedExistingPatient.spec.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import { BrowserContext, expect, Page, test } from '@playwright/test';
33
import * as fs from 'fs';
44
import * as path from 'path';
5+
import { BOOKING_CONFIG } from 'utils';
56
import { Locators } from '../../utils/locators';
67
import { Paperwork, PATIENT_ADDRESS, PATIENT_ADDRESS_LINE_2, PATIENT_CITY, PATIENT_ZIP } from '../../utils/Paperwork';
78
import { TelemedPrebookPatientTestData } from '../0_paperworkSetup/types';
@@ -26,7 +27,11 @@ test.afterAll(async () => {
2627
await context.close();
2728
});
2829

29-
test.describe.parallel('Telemed - Prefilled Paperwork, Responsible Party: not self, Payment: Insurance', () => {
30+
const VirtualPrebookDependentTests = BOOKING_CONFIG.homepageOptions?.includes('schedule-virtual-visit')
31+
? test.describe.parallel
32+
: test.describe.skip;
33+
34+
VirtualPrebookDependentTests('Telemed - Prefilled Paperwork, Responsible Party: not self, Payment: Insurance', () => {
3035
test('VVPP-1. Contact information', async () => {
3136
await test.step('VVPP-1.1. Open Contact information page directly', async () => {
3237
await page.goto(`paperwork/${patient.appointmentId}/contact-information`);

apps/intake/tests/specs/telemed/homepage.spec.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,11 @@ test.describe.parallel('THP. Telemed Homepage', () => {
3333
}
3434
}
3535

36-
await expect(page.getByRole('heading', { name: 'Book a visit', level: 2 })).toBeVisible({
36+
await expect(
37+
page.getByRole('tablist', {
38+
name: 'Appointment tabs for switching between appointments slots for today and tomorrow',
39+
})
40+
).toBeVisible({
3741
timeout: 15000,
3842
});
3943
});

0 commit comments

Comments
 (0)