From eea5550c3e0008205aaaf857aa793d2f289e1c09 Mon Sep 17 00:00:00 2001 From: Shivam Pandey Date: Tue, 9 Apr 2024 13:13:46 +0530 Subject: [PATCH] logging --- cypress/e2e/irctc.cy.js | 2 +- cypress/support/commands.js | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/cypress/e2e/irctc.cy.js b/cypress/e2e/irctc.cy.js index 4a0190d..b2ca0f3 100644 --- a/cypress/e2e/irctc.cy.js +++ b/cypress/e2e/irctc.cy.js @@ -7,7 +7,7 @@ describe('IRCTC TATKAL BOOKING', () => { it('Tatkal Booking Begins......', () => { cy.viewport(1478, 1056) cy.visit('https://www.irctc.co.in/nget/train-search') - cy.task("log", `Website Fetching completed......... ${username + '@'} ${username} and ${password}`) + cy.task("log", `Website Fetching completed.........`) const UPI_ID = Cypress.env().UPI_ID ? Cypress.env().UPI_ID : UPI_ID_CONFIG; cy.get('.h_head1 > .search_btn').click() cy.get(':nth-child(1) > .form-control').invoke('val', username).trigger('input') diff --git a/cypress/support/commands.js b/cypress/support/commands.js index ed7ebc3..34e03f5 100644 --- a/cypress/support/commands.js +++ b/cypress/support/commands.js @@ -61,9 +61,13 @@ function performLogin(LOGGED_IN) { // get captcha value base64 starts--------- cy.get('.captcha-img').invoke('attr', 'src').then((value) => { // api call to retrieve captcha value + cy.task("log", `python3 irctc-captcha-solver/app.py "${value}"`) + cy.exec(`python3 irctc-captcha-solver/app.py "${value}"`).then((result) => { cy.get('#captcha').type(result.stdout).type('{enter}'); // cy.contains('SIGN IN').click() + cy.task("log", `stdout-> "${result.stdout}"`) + cy.get('body').then((el) => { if (el[0].innerText.includes('Invalid Captcha')) {