qe-fe-automation
Version:
FE test automation framework using cypress
75 lines (72 loc) • 2.54 kB
text/typescript
import { stagingUsers } from '@fixtures/staging-users';
import { Invoice } from '@commerce-lib/invoice/invoice';
import { FlightsInvoiceValidation } from '@commerce-lib/flights/invoice_validation';
import { localizationData } from '@fixtures/commerce/localization_data';
const userCreds = Cypress.env('newUser').NEW_USER_PASSWORD;
const { us_domestic_sabre_user } = stagingUsers;
const indiaTDS = localizationData.india_Tds;
const english = localizationData.english;
const flightVoid = localizationData.flight.flight_void;
const flightRefund = localizationData.flight.flight_refund;
const ticketNumber = flightRefund.ticketNumber;
const providerType = flightVoid.providerType.sabre;
const inventoryType = flightVoid.inventoryType.flight;
const bookingUuid = flightRefund.bookingUuID;
const tripUrl = flightRefund.tripURL;
const bookingID = flightRefund.bookingID;
const baseAmount = english.baseAmount;
const totalAmount = english.totalAmount;
const totalTaxAmount = english.totalTaxAmount;
const ticketType = english.ticket;
const refundTicketType = indiaTDS.transactionType.refund;
const coupons = flightVoid.sabre_us_coupons;
describe('Commerce: FLIGHT | Refund | Invoice | Validations', () => {
it('C210172: Flight Refund Invoice Validation', { tags: ['@tier2'] }, () => {
cy.clearAllByBookingUuid(bookingUuid);
cy.archiveByBookingUUID(bookingUuid);
cy.insertBookingDataInLedger(
bookingUuid,
bookingID,
totalAmount,
baseAmount,
totalTaxAmount,
ticketType,
ticketNumber,
providerType,
inventoryType,
null,
null,
coupons
);
cy.forceSyncAPI(bookingUuid);
cy.forcePDFSyncAPI(bookingUuid);
cy.insertBookingDataInLedger(
bookingUuid,
bookingID,
totalAmount,
baseAmount,
totalTaxAmount,
refundTicketType,
ticketNumber,
providerType,
inventoryType,
null,
null,
coupons
);
cy.forceSyncAPI(bookingUuid);
cy.forcePDFSyncAPI(bookingUuid);
cy.getLedgerData(bookingUuid);
cy.loginWithAuthToken({
email: us_domestic_sabre_user.email,
password: userCreds,
isSA: true
});
FlightsInvoiceValidation.visitItineraryPage(tripUrl);
FlightsInvoiceValidation.visitViewTripFeePage();
Invoice.retrieveDownloadInvoiceFileWithBookingID(bookingID);
Invoice.retrieveAndConvertPDFInvoiceDetailsToHTML();
FlightsInvoiceValidation.validateFlightRefundInvoiceDetails();
Invoice.deleteFileFromFolderByBookingId(bookingID);
});
});