qe-fe-automation
Version:
FE test automation framework using cypress
39 lines (35 loc) • 1.4 kB
text/typescript
import { TripFeeValidation } from '@commerce-lib/tripfee/trip_fee_validation';
import { CommerceApiIntercepts } from '@commerce-shared-lib/api-intercepts';
import { stagingUsers } from '@fixtures/staging-users';
import { TrainBookings, TrainInterceptApis, TrainSearch } from '@train-lib/index';
const adminCredentials = Cypress.env('superAdmin').SUPER_ADMIN_PASSWORD;
const emeaFeesTagSet: Array<string> = [
'inventoryTypeRail',
'bookingOnline',
'serviceAreaIntl',
'tripOnline',
'booking1'
];
describe('Commerce: Verify Trip Fees', () => {
beforeEach(() => {
cy.loginWithAuthToken({
email: stagingUsers.superAdmin.email,
password: adminCredentials,
isSA: true
});
TripFeeValidation.getAndStoreFeeModelUUID('EMEA Fee Model-A-USD-n');
TripFeeValidation.getTripFeeUsingFeeModelUUID(emeaFeesTagSet);
CommerceApiIntercepts.interceptCommerceApis();
TrainInterceptApis.interceptTrainApis();
});
it(' Verify trip fees', { tags: ['@tier1'] }, () => {
TrainSearch.visitTrainSearch('Business');
TrainSearch.setOrigin('London Euston, GB');
TrainSearch.setDestination('New Beckenham, GB');
TrainSearch.selectFutureTrainDate();
TrainSearch.selectTripTileType('Roundtrip');
TrainSearch.searchTrain();
TrainBookings.processSearchRequest('SOUTH_EASTERN_RAILWAY', ' Base ');
TripFeeValidation.checkBookingFee();
});
});