Skip to content

Commit

Permalink
--headed enabled and Sorry Please Try Again Thrown by irctc added
Browse files Browse the repository at this point in the history
  • Loading branch information
shivamguys committed Apr 21, 2024
1 parent 4595dab commit df0ece7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/irctc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: '20.12.2'

- name: Installing Cypress & Running IRCTC Cypress Automation
run: |
npm install cypress
npx cypress run --record --key a15b31a6-b9ee-4678-b9ac-f45a190851fe --env UPI_ID=${{ inputs.UPI_ID || '' }},USERNAME=${{ inputs.USERNAME || secrets.USERNAME }},PASSWORD=${{ inputs.PASSWORD || secrets.PASSWORD }}
npx cypress run --browser chrome --headed --record --key a15b31a6-b9ee-4678-b9ac-f45a190851fe --env UPI_ID=${{ inputs.UPI_ID || '' }},USERNAME=${{ inputs.USERNAME || secrets.USERNAME }},PASSWORD=${{ inputs.PASSWORD || secrets.PASSWORD }}
# - name: Running IRCTC Cypress Script
# uses: cypress-io/github-action@v6
Expand Down
2 changes: 1 addition & 1 deletion cypress/fixtures/passenger_data.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"FOOD": "No Food"
},
{
"NAME": "Random name",
"NAME": "Shivam Dubey",
"AGE": 26,
"GENDER": "Female",
"SEAT": "No Preference",
Expand Down
4 changes: 4 additions & 0 deletions cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,10 @@ function solveCaptcha() {

}

if (el[0].innerText.includes('Sorry!!! Please Try again!!')) {
throw new Error('Sorry!!! Please Try again!! <<< Thrown By IRCTC');
}

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

cy.task("log", "CAPTCHA .... SOLVED")
Expand Down

0 comments on commit df0ece7

Please sign in to comment.