2

I have my cypress.config.ts like this

import { defineConfig } from "cypress";

export default defineConfig({
  pageLoadTimeout: 360000,
  defaultCommandTimeout: 60000,
  env: {
    EMAIL: "random@mail.com",
    PASSWORD: "password"
  }
});

And when I try to use this cy.get("#emailField").type(Cypress.env('EMAIL')); in my test is always returns undefined. I tried moving the env into JSON file cypress.env.json but that didn't help. I also tried switching to javascript but the result was the same. What am I doing wrong?

Gandalf The Gray
  • 108
  • 2
  • 10

1 Answers1

0

there is little information about the problem but did you try cy.log(Cypress.env('EMAIL')) to see if env variable its working fine, becasue there can be problem with selector.

Miho
  • 1
  • 2