From ebf786c9e4726e44e2ac7d66d4f7155a30da0d12 Mon Sep 17 00:00:00 2001 From: Shivam Pandey Date: Thu, 11 Apr 2024 15:03:05 +0530 Subject: [PATCH] failonstatuscode false --- cypress/e2e/irctc.cy.js | 16 +++++++--------- cypress/support/commands.js | 5 ----- 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/cypress/e2e/irctc.cy.js b/cypress/e2e/irctc.cy.js index 312e993..3de5ef9 100644 --- a/cypress/e2e/irctc.cy.js +++ b/cypress/e2e/irctc.cy.js @@ -3,21 +3,19 @@ let username = Cypress.env('USERNAME') let password = Cypress.env('PASSWORD') import { PASSENGER_DETAILS, SOURCE_STATION, DESTINATION_STATION, TRAIN_NO, TRAIN_COACH, TRAVEL_DATE, TATKAL, BOARDING_STATION, UPI_ID_CONFIG } from '../fixtures/passenger_data.json' + + + describe('IRCTC TATKAL BOOKING', () => { it('Tatkal Booking Begins......', () => { // Catching Load Event Exception.. - cy.on('fail', (err, runnable) => { - if (String(err).includes('Your page did not fire its `load` event')) { - return true - } - else { - return false - } + cy.viewport(1478, 1056) + cy.visit('https://www.irctc.co.in/nget/train-search', { + failOnStatusCode: false }) - cy.viewport(1478, 1056) - cy.visit('https://www.irctc.co.in/nget/train-search', { timeout: 48000 }) + cy.task("log", `Website Fetching completed.........`) const UPI_ID = Cypress.env().UPI_ID ? Cypress.env().UPI_ID : UPI_ID_CONFIG; const upiRegex = /^[a-zA-Z0-9]+@[a-zA-Z0-9.]+$/; diff --git a/cypress/support/commands.js b/cypress/support/commands.js index cbb4814..98f1312 100644 --- a/cypress/support/commands.js +++ b/cypress/support/commands.js @@ -3,11 +3,6 @@ import { formatDate, hasTatkalAlreadyOpened, tatkalOpenTimeForToday } from "../u const MANUAL_CAPTCHA = Cypress.env('MANUAL_CAPTCHA') -Cypress.on('uncaught:exception', (err, runnable) => { - // returning false here prevents Cypress from - // failing the test - return false -}) Cypress.Commands.add('submitCaptcha', () => {