https://cypress.io logo
Join Discord
Powered by
# help
  • f

    fresh-doctor-14925

    06/14/2022, 9:09 AM
    If it’s not being passed in as part of your run command, I would do a search on your repo to see where it’s being included
  • g

    gentle-accountant-4760

    06/14/2022, 9:17 AM
    But I guess the Cypress.env is still a thing?
  • g

    gentle-accountant-4760

    06/14/2022, 9:18 AM
    Ahhhh...
  • g

    gentle-accountant-4760

    06/14/2022, 9:19 AM
    its being read from .env but looks like the cypress doesn't read the .env anymore
  • f

    fresh-doctor-14925

    06/14/2022, 9:20 AM
    I use
    .env
    a lot. I map the commands like so in
    cypress/plugins/index.js
    Copy code
    config.env.BASIC_AUTH = process.env.BASIC_AUTH;
    That still works in v10
  • g

    gentle-accountant-4760

    06/14/2022, 9:20 AM
    what I have done is basically just created a file called .env and I believe that Cypress.env would read the file automatically
  • g

    gentle-accountant-4760

    06/14/2022, 9:20 AM
    Unless im wrong?
  • f

    fresh-doctor-14925

    06/14/2022, 9:22 AM
    I assumed so too when I started using
    .env
    , but it's not the case
    .env
    will provide variables to node, but not cypress. The snippet I shared above will solve your problem It's the same reason why you need to prepend
    CYPRESS_
    to any Cypress env vars in your run command. Otherwise they go to Node
  • g

    gentle-accountant-4760

    06/14/2022, 9:23 AM
    I see, but do I need to import something for "config"? As it cannot find the name of config
  • f

    fresh-doctor-14925

    06/14/2022, 9:24 AM
    nah. If you've got a
    .env
    and that snippet to map it to cypress.env(), you should be good
  • f

    fresh-doctor-14925

    06/14/2022, 9:25 AM
    config.env
    is just a way to access
    Cypress.config("env")
  • g

    gentle-accountant-4760

    06/14/2022, 9:25 AM
    I dont think I have a snippet to map it to the cypress.env 😦 or it doesnt seem like that
  • g

    gentle-accountant-4760

    06/14/2022, 9:25 AM
    I believe I used to use it as a node before which was fine
  • g

    gentle-accountant-4760

    06/14/2022, 9:26 AM
    but I want to change it of course to Cypress now πŸ˜„
  • g

    gentle-accountant-4760

    06/14/2022, 9:26 AM
    beacuse I have my .env in my top level folder so I assume I dont need to have it in the same folder as cypress/plugins?
  • f

    fresh-doctor-14925

    06/14/2022, 9:27 AM
    Hmm, in that case I'm not sure what to advise. This is how I did it in v9 too. Kinda hard to know exactly what's going on without any code in front of me Only other thing I'd suggest is trying to narrow down what's going on by going back to v9 and checking it works with that run command
  • r

    ripe-beard-71956

    06/14/2022, 9:27 AM
    Hello everyone, I am facing problem after migration to Cypress 10 with multiple environment variables, the old way till Cypress 9.7 was to create multiple env.json files for specific environments let's say production staging etc. And adress them in CLI with --env configFile='staging' to overwrite some properties, setup was done in plugins/index.ts file witch is now part of cypress.config.ts, previous solution was provided in Cypress docks, but now I can't find any information or solution about this topic are there any solutions that I missed or for now it's not functional. Thanks for help and have a good day.
  • g

    gentle-accountant-4760

    06/14/2022, 9:28 AM
    Basically I have a file called:
    Copy code
    .env
    which has value:
    Copy code
    BASIC_AUTH=Hello:world
    That was in my top level folder meaning in here
    f
    • 2
    • 46
  • g

    gentle-accountant-4760

    06/14/2022, 9:29 AM
    And then all I had to do before was to just call Cypress.env and per automatic it would read the Cypress.env without anything more added
  • g

    gentle-accountant-4760

    06/14/2022, 9:29 AM
    thats what I had it in 9.x
  • b

    brave-processor-66066

    06/14/2022, 9:57 AM
    I got it like this, it works, but maybe somehow I needed it differently?
  • b

    bumpy-library-92619

    06/14/2022, 1:12 PM
    Hi, i have this following issue. Does anyone know the issue or can help me? thanks!
  • a

    ancient-park-71356

    06/14/2022, 2:05 PM
    Hello, my issue with downloading cypress is solved but now I have a problem with cy.visit() when I have an address with "https://" I have an error "Error: Error establishing proxy connection. Response from server was: HTTP/1.1 400 Bad Request" but when I remove https then it visit a company proxy address not the page I want. Do you maybe know how to solve it? cy.visit() failed trying to load: https://www.google.pl/ We attempted to make an http request to this URL but the request failed without a response. We received this error at the network level: Error: Error establishing proxy connection. Response from server was: HTTP/1.1 400 Bad Request Server: nginx/1.12.2 Date: Tue, 14 Jun 2022 13:13:05 GMT Content-Type: text/html Content-Length: 173 Connection: close 400 Bad Request 400 Bad Request nginx/1.12.2 Common situations why this would fail: - you don't have internet access - you forgot to run / boot your web server - your web server isn't accessible - you have weird network configuration settings on your computer
  • b

    brash-tiger-52405

    06/14/2022, 2:58 PM
    hey everyone, do you know how to skip a authentication process? There is a activation-code which should be authenticated in another app, but i must skip that.
  • p

    polite-france-34211

    06/14/2022, 7:44 PM
    It looks like
    findByPlaceholderText("Password")
    is not finding anything. Password fields don't have placeholders. You'd probably want to do something like
    findByLabelText()
    ?
  • d

    dazzling-salesclerk-15570

    06/14/2022, 9:34 PM
    guys has anyone had __awaiter is not defined error inside cy.origin when using async commands?!
  • e

    echoing-painting-40909

    06/14/2022, 11:30 PM
    Hello, you need to setup a configuration for your proxy: https://docs.cypress.io/guides/references/proxy-configuration#Set-a-proxy-on-Linux-or-macOS
  • e

    echoing-painting-40909

    06/14/2022, 11:32 PM
    What's the target value in your tsconfig.json file?
  • d

    dazzling-salesclerk-15570

    06/15/2022, 12:30 AM
    "target": "es6"
  • d

    dazzling-salesclerk-15570

    06/15/2022, 12:30 AM
    it only happens within
    cy.origin
1...848586...252Latest