Configuration file errors when using cypress run
, no issue with cypress open
#25770
Unanswered
jhulme
asked this question in
Questions and Help
Replies: 1 comment 1 reply
-
I've had some time to take another look into this and it looks likely I am falling foul of an existing bug. I have adjusted my code to move the communications with vault into the
For now I will have to return to managing my credentials via environment variables rather than pulling them from a vault instance until this is resolved. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have been adding functionality to one of our projects, in order to read in secrets stored in a Hashicorp vault instance. I am taking advantage of the node-vault package. We have a number of environment specific configuration files, each retrieving the appropriate values from vault. For example a rough outline of the file
cypress/config/cypress.qa.config.js
is belowThe issue appears to be that when I launch using
cypress open --config-file cypress/config/cypress.qa.config.js
the data from vault is extracted and the code withinsetupNodeEvents()
sets the values ofconfig.env.username
andconfig.env.password
successfully.I can then see that these values have been set correctly when viewing the Resolved Configuration within the Project Settings.
However if I repeat the process using the headless
cypress run --config-file cypress/config/cypress.qa.config.js
I receive the following error:Which appears to indicate that
vaultdata.username
has no value set.I assume there is something wrong with how I have structured my code, but I would appreciate any advice on resolving the issue as I have hit a bit of a blocker here and I can't seem to find a method of resolving the problem. Checking the documentation indicates that the
setupNodeEvents()
function can return a Promise rather than just a synchronous value, but I have been unable to find a working approach using this structure so far.Beta Was this translation helpful? Give feedback.
All reactions