Skip to content

Commit

Permalink
Fixed Filling stations with delays to act as human Fixed Breaking Of …
Browse files Browse the repository at this point in the history
…Captcha On Too Fast
  • Loading branch information
shivamguys committed Apr 10, 2024
1 parent d91fc9d commit 4aa245d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cypress/e2e/irctc.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ describe('IRCTC TATKAL BOOKING', () => {


// from station
cy.get('.ui-autocomplete > .ng-tns-c57-8').should('be.visible').type(SOURCE_STATION)
cy.get('.ui-autocomplete > .ng-tns-c57-8').should('be.visible').type(SOURCE_STATION, { delay: 200 })
// cy.wait(600)
cy.get('#p-highlighted-option').should('be.visible').click()

// to station
cy.get('.ui-autocomplete > .ng-tns-c57-9').should('be.visible').type(DESTINATION_STATION)
cy.get('.ui-autocomplete > .ng-tns-c57-9').should('be.visible').type(DESTINATION_STATION, { delay: 200 })
// cy.wait(600)
cy.get('#p-highlighted-option').should('be.visible').click()

Expand Down
7 changes: 7 additions & 0 deletions cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,13 @@ function solveCaptcha() {
})
} else {

if (el[0].innerText.includes('Payment Methods')) {

cy.task("log", "CAPTCHA .... SOLVED")
solveCaptcha()

}

// get captcha value base64 starts---------
cy.get('.captcha-img').invoke('attr', 'src').then((value) => {
// api call to retrieve captcha value
Expand Down

0 comments on commit 4aa245d

Please sign in to comment.