diff --git a/.gitignore b/.gitignore index ab8eaba..e040bc9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ node_modules/ -cypress.env.json .idea cypress/videos/ cypress/screenshots/ diff --git a/cypress.env.json b/cypress.env.json new file mode 100644 index 0000000..453bbc7 --- /dev/null +++ b/cypress.env.json @@ -0,0 +1,5 @@ +{ + "username": "yourusername", + "password": "yourpassword", + "MANUAL_CAPTCHA": false +} \ No newline at end of file diff --git a/cypress/e2e/irctc.cy.js b/cypress/e2e/irctc.cy.js index b2ca0f3..f843e26 100644 --- a/cypress/e2e/irctc.cy.js +++ b/cypress/e2e/irctc.cy.js @@ -100,20 +100,6 @@ describe('IRCTC TATKAL BOOKING', () => { } - /* - OLD FILLING NAME CODE, CHECKING IF BELOW NEW ONE IS STABLE OR NOT............WOULD BE REMOVED LATER IF BELOW ONE WORKS - cy.get('.ui-autocomplete >').each((inputDiv, index) => { - - cy.wrap(inputDiv).click() - cy.wrap(inputDiv).focused().clear() - let PASSENGER = PASSENGER_DETAILS[index] - cy.wrap(inputDiv).invoke('val', PASSENGER['NAME']).trigger('input') - - - - }) - */ - // FOR NAME cy.get('.ui-autocomplete input').each((inputField, index) => { @@ -124,6 +110,7 @@ describe('IRCTC TATKAL BOOKING', () => { // Check if the passenger object contains 'NAME' property if (PASSENGER && PASSENGER['NAME']) { + cy.task("log", 'Passenger Filing STARTED......') // Clear the input field and set its value to the passenger's name cy.wrap(inputField).clear().type(PASSENGER['NAME']); } else { @@ -144,6 +131,7 @@ describe('IRCTC TATKAL BOOKING', () => { let PASSENGER = PASSENGER_DETAILS[index] cy.wrap(inputDiv).invoke('val', PASSENGER['AGE']).trigger('input') + cy.task("log", 'Age Filing STARTED......') }) diff --git a/cypress/fixtures/passenger_data.json b/cypress/fixtures/passenger_data.json index 951ba4d..614f50b 100644 --- a/cypress/fixtures/passenger_data.json +++ b/cypress/fixtures/passenger_data.json @@ -1,10 +1,10 @@ { - "TRAIN_NO": "12310", - "TRAIN_COACH": "3A", - "TRAVEL_DATE": "16/06/2024", - "SOURCE_STATION": "NDLS", + "TRAIN_NO": "11072", + "TRAIN_COACH": "2A", + "TRAVEL_DATE": "11/04/2024", + "SOURCE_STATION": "BSB", "BOARDING_STATION": null, - "DESTINATION_STATION": "PNBE", + "DESTINATION_STATION": "LTT", "TATKAL": false, "UPI_ID": "", "PASSENGER_DETAILS": [