qe-fe-automation
Version:
FE test automation framework using cypress
50 lines (48 loc) • 1.58 kB
text/typescript
import {
buildPassengerInfo,
buildPaymentMethod,
Employee,
generateBookingId,
getFiveDaysAgoDate,
getOneMonthAheadDate,
getOneMonthAndHalfAheadDate
} from '@fixtures/navan_pro/reed_mackay_booking/common';
import { faker } from '@faker-js/faker';
export const buildCarForEmployee = (employee: Employee) => {
return {
bookingStatus: 'CONFIRMED',
bookingId: generateBookingId(),
employeeId: employee.uuid,
amount: faker.datatype.number({ max: 500, min: 20 }),
cancelable: faker.datatype.boolean(),
orderDateTime: getFiveDaysAgoDate(),
serviceFee: faker.datatype.number({ max: 50 }),
currency: 'GBP',
confirmationNumber: '32165498654',
rentalCompanyName: 'Europcar',
vehicleName: 'Fullsize (2/4 Door, Manual AWD transmission)',
carDescription: 'FCCC',
pickupTime: getOneMonthAheadDate(),
pickUpGeo: {
latitude: 51.1562493,
longitude: -0.1631684
},
departureAddress:
'LONDON GATWICK SOUTH TERMINAL, LONDON GATWICK AIRPORT, GATWICK, RH6 0NP, GB',
departureAddressDescription: 'Deliver to',
dropOffTime: getOneMonthAndHalfAheadDate(),
dropOffGeo: {
latitude: 51.4795582,
longitude: -0.4713525
},
arrivalAddress:
'NORTHERN PERIMETER ROAD WEST, HOUNSLOW, LONDON HEATHROW AIRPORT, TW6 2QE, GB',
arrivalAddressDescription: 'Drop-Off at',
automatic: faker.datatype.boolean(),
passengers: 1,
mileage: ' Kilometers',
personal: false,
passengerInfo: [buildPassengerInfo(employee)],
paymentMethod: buildPaymentMethod()
};
};