Skip to content

Commit

Permalink
logging
Browse files Browse the repository at this point in the history
  • Loading branch information
shivamguys committed Apr 9, 2024
1 parent 3e8e228 commit eea5550
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cypress/e2e/irctc.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
4 changes: 4 additions & 0 deletions cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')) {

Expand Down

0 comments on commit eea5550

Please sign in to comment.