I have just started using Cypress for API test automation. There are some environment variables I'll like to access in my test files using Cypress.env. The cypress documentation lists the config file (cypress.json) as the obvious place to store environment variables.
I need to test numerous endpoints from over 40 data services companies. The business logic varies across all 40 services.
Hence, the objects in the "env" within cypress.json are numerous, so not manageable within one file.
My thought process to resolving this, is to create an environment variable file within Fixtures, storing the "env" objects for each of the data services. However I'm not sure if that's possible.
Also, is it possible to have more than one cypress.json file in one project?
Any advice will be most appreciated.
Here's a sample of my "env" variable for one data service provider.
{
"env": {
"dataService": "XXDataService",
"companyRegNo": "XX4457ZZ",
"language": "EN",
"countryCode": "UK",
"companyType": "Ltd",
"companySearchName": "",
"searchParams": "",
"reportParams": "",
"username": "",
"password": "",
}
}