Unable to pass CYPRESS_RECORD_KEY as env variable from cypress.env.json #27735
itkhanz
started this conversation in
Cypress Cloud
Replies: 3 comments 2 replies
-
I have the same problem today. Anyone know the solution? |
Beta Was this translation helpful? Give feedback.
1 reply
-
@itkhanz Does test recording succeed or fail if you pass it in as a parameter in your run script? |
Beta Was this translation helpful? Give feedback.
0 replies
-
It succeeds if I pass it in as a parameter in my run script. I just never
got it work using the explanation:
You can also set the key as an environment variable with the name:
CYPRESS_RECORD_KEY
…On Thu, Feb 22, 2024 at 3:06 PM Sam E. Lawrence ***@***.***> wrote:
@itkhanz <https://github.com/itkhanz> Does test recording succeed or fail
if you pass it in as a parameter in your run script?
—
Reply to this email directly, view it on GitHub
<#27735 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AYQNQMHLJEEQENBIWSSOAE3YU7FQ5AVCNFSM6AAAAAA4JON5AKVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4DKNRSGU2DE>
.
You are receiving this because you commented.Message ID:
***@***.***>
--
Richard Lyman
|
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
-
Hi,
I am running locally cypress version 13.0 and trying to pass the
CYPRESS_RECORD_KEY
as environment variable stored in externalcypress.env.json
file in the root directoy of the project.In my cypress.env.json, i have defined the projectId and cypress record key as follows:
when I run tests from command line via
npx cypress run --record
, I get the errorI read the documentation and it states that the CYPRESS_RECORD_KEY can also be passed as environment variable, so I used cypress.env.json to pass it as environment variable. I even checked from cypress test runner app and I can see this environment variable there but running the tests give me above error.
https://docs.cypress.io/guides/cloud/getting-started
https://docs.cypress.io/guides/guides/environment-variables#Option-2-cypressenvjson
https://docs.cypress.io/guides/references/error-messages#You-passed-the---record-flag-but-did-not-provide-us-your-Record-Key
There is also a stack overflow issue created for similar issue, but there is no working solution:
https://stackoverflow.com/questions/74129938/add-cypress-dashboard-record-key-in-cypress-config-file
Could you please look into this issue, and help me pass the record key locally as environment variable from cypress.env.json file?
Beta Was this translation helpful? Give feedback.
All reactions