@@ -36,7 +36,7 @@ test.afterAll(async () => {
3636import { CancelPage } from 'tests/utils/CancelPage' ;
3737import { BaseInPersonFlow } from 'tests/utils/in-person/BaseInPersonFlow' ;
3838import { 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' ;
4040import { FillingInfo as InPersonFillingInfo } from '../../utils/in-person/FillingInfo' ;
4141import { PrebookInPersonFlow } from '../../utils/in-person/PrebookInPersonFlow' ;
4242import { Locators } from '../../utils/locators' ;
@@ -362,60 +362,64 @@ test.describe.parallel('In-Person: Create test patients and appointments', () =>
362362} ) ;
363363
364364test . 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 ( ) => {
0 commit comments