diff --git a/.github/workflows/irctc.yml b/.github/workflows/irctc.yml index 8e28948..126cde0 100644 --- a/.github/workflows/irctc.yml +++ b/.github/workflows/irctc.yml @@ -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 diff --git a/cypress/fixtures/passenger_data.json b/cypress/fixtures/passenger_data.json index 4d75419..b18a7aa 100644 --- a/cypress/fixtures/passenger_data.json +++ b/cypress/fixtures/passenger_data.json @@ -17,7 +17,7 @@ "FOOD": "No Food" }, { - "NAME": "Random name", + "NAME": "Shivam Dubey", "AGE": 26, "GENDER": "Female", "SEAT": "No Preference", diff --git a/cypress/support/commands.js b/cypress/support/commands.js index 1f08df9..6212c17 100644 --- a/cypress/support/commands.js +++ b/cypress/support/commands.js @@ -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")