https://cypress.io logo
Hello everyone, I've been struggling with integrat...
# e2e-testing
a
Hello everyone, I've been struggling with integrating Cypress to Github Action for a full working day now, that's why I'm asking for your help, I'll try to be as clear as possible: We have currently tests for a local monitoring app which are working as expected. We also have production & staging environment, both of them are protected using (https://www.cloudflare.com/products/zero-trust/access/). For those two remote environments, we managed to create Service Token to bypass this protection by adding headers to http authorisation request. When running those tests against remote environment from our local laptops, they give a green light. But when running them in Github Actions, we have some unexpected behaviour, as it cannot send a request with needed headers for "unknown reason" (I'll dump logs about it). This is the piece of code having problems:
Copy code
javascript
    cy.session("admin", () => {
        const headers = {}
        headers[cfAccessCookieId] = cfAccessId; // CF-Access-Client-Id
        headers[cfAccessCookieSecret] = cfAccessSecret // CF-Access-Client-Secret

        cy.request({
            url: fromBaseUrl(),
            headers,
        }) // <- This request make everything crash
    },
    {
       validate() {
        cy.request('/').its('status').should('eq', 200)
      },
    })
Errors I had in logs are the following: -
TypeError: Invalid character in header content ["CF-Access-Client-Id"]
-
Error: socket hang up
I'm really out of ideas, I don't understand why the behaviour is different, node version is the same. cypress too...
2 Views