-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sometimes config.env.key returns incorrect value if use it in plugin/index.js #2824
Comments
Hi @viraxslot ! const pathToConfigFile = path.resolve('.\\cypress\\config', `${file}.json`); and const pathToConfigFile = path.resolve('cypress', 'config', `${file}.json`); Thanks. |
@christophechevalier You also could check it in node.js documentation |
@viraxslot It doesn't look like you're ever mutating the The If this isn't the case you'll need to provide a reproducible repo that shows the problem. |
Unfortunately we'll have to close this issue if no reproducible example is provided. Can anyone provide a way to reproduce this? |
Unfortunately we have to close this issue as there is not enough information to reproduce the problem. This does not mean that your issue is not happening - it just means that we do not have a path to move forward. Please comment in this issue with a reproducible example and we will reopen the issue. 🙏 |
What I want to do:
plugin/index.js
cy.task()
in my test and everything works fine, but not always (see below)Code in plugin/index.js:
Steps to reproduce / Current behavior:
I open cypress using command
When I run tests, which use task "getRedisValueByToken" in browser almost always first run fails and code
console.log(redis.options.host);
prints:If rerun test cases - nothing changes.
But if add
console.log(123);
afterconsole.log(redis.options.host);
and save plugin/index.js then tests passes and log looks like:After that test cases always passes.
Desired behavior:
I want to understand is it correct to pass config object to a function "redisValue" in this way?
If not then how to use environment variables in tasks?
Versions
Cypress package version: 3.1.2
Windows 10
Run with Chrome 70 / Electron 59
Thank you.
The text was updated successfully, but these errors were encountered: