0

We run our E2E tests against Chrome 70 on windows machine in headed mode using command npm install && cypress run --browser chrome --headed "--config" "baseUrl=http:serveraddress:8080" "--env" "Host=serveraddress". The tests connect to a server url hosted on a Linux machine (hosted on our network). We recently upgraded our cypress version from 7.7.0 to 11.2.0 and the tests started failing where the tests fail at visit step as shown in the img uploaded. We tried to debug, logged into these machines from the profile and manually ran them from command prompt and they seem to work fine. But when we kick off our Jenkins build, they start failing.

enter image description here enter image description here

We did add the command set CYPRESS_RUN_BINARY=C:\Users\Administrator\AppData\Local\Cypress\Cache\11.2.0\Cypress\Cypress.exe before run the cypress cases in the jenkins job. But that did not fix the error. The Jenkins build goes fine for the machines where the tests connect to localhost url. We are using cy.visit("/") in our beforeAll block to visit the page and here is our jenkins script below:

env.cypressFFBaseUrl=cypressFFBaseUrl.trim()
     env.FFHost=FFHost.trim()
     bat  script: """
                                 setlocal
                                 set ERRORLEVEL=0
                                 set PATH=C:\\Program Files (x86)\\OpenJDK\\jdk-8.0.262.10-hotspot\\bin;$PATH
                                 set CYPRESS_BASE_URL=${cypressFFBaseUrl};
                                 set Host=${FFHost};
                                 set CYPRESS_RUN_BINARY=C:\\Users\\Admin\\AppData\\Local\\Cypress\\Cache\\11.2.0\\Cypress\\Cypress.exe
                                 cd $WORKSPACE/ui/e2e
                                 npm run cy:run-firefox-headed -- --config baseUrl=${cypressFFBaseUrl} --env Host=${FFHost}  >> e2e_err.log
     """

Please help!

NG576
  • 21
  • 2

0 Answers0