I'm looking for a way to store global constants in a file that could be used across all my spec files. Can anyone help?
Use the cypress.json
file that is in your project root like this:
{
"env": {
"your_var": "your_value"
}
}
https://docs.cypress.io/guides/references/configuration.html
Once you set some env variables, you can reference them from your specs like this: Cypress.env('your_var');