bahmutov / cypress-extends

Cypress plugin that adds "extends" support to the configuration file

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Variables from custom config files are not visible in test runners Settings > Configuration

mareru opened this issue · comments

When using this plugin as described, after opening test runner Settings tab > Configuration section, then I am able to see that config will be marked for properties that are set from custom config file qa.json, but on the other hand property baseUrl is null and not displaying the value from that file nor marking it in blue as filled from config (instead it says it is default).
Note that while running the test I can see that it is targeting baseUrl defined in qa.json. It is just not visible here in test runner.
I am not sure if this is cypress issue rather then this plugin issue.

image

Here is the repo:
https://github.com/mareru/cypress-demo-issue
I noticed now that it doesn't even populates baseUrl while running test.
Maybe I am doing something wrong after all with the usage of the package ... I don't know

You accidentally put baseUrl into the env object, but it should be the top-level option, see https://github.com/bahmutov/cypress-extends#common-problems

@bahmutov thanks for your reply but this didn't solve the problem
baseUrl is still null for some reason even when I put it on the top-level. I updated my code and pushed it.
When I run npm run smoke2 and test runner opens it is still as before baseUrl is null ...
Can you please help? :D

@bahmutov
Sorry, qa.json in the root of the project was legacy from some previous attempts.
The real one is in cypress/config/env https://github.com/mareru/cypress-demo-issue/blob/main/cypress/config/env/qa.json
It has the extends and it is still not working :(
Sorry once again for the confusion.

But you are not loading cypress/config/env/qa.json. You are loading qa.json from the current folder when running npm run smoke2

"smoke2": "cypress open --config-file qa.json ..."

@bahmutov Thanks! That was the issue. Love you man :*