Closed
Description
Current behavior:
When cypress is runned using cypress open --config-file ~/config.json
a folder is created under the project tree with the path path/to/home/config.json
instead of looking into the existing file at home folder.
Desired behavior:
The desired behavior would be for the cypress to find the config file at the home folder and use it.
Test code to reproduce
Steps:
1 - Setup a sample project with cypress;
2 - Create a config file at home named for example cypress.json;
3 - Create a npm script to run the command with `cypress open --config-file ~/cypress.json;
4 - Run the script;
5 - A new folder should be created under the project folder with a empty cypress.json configuration inside it;
Versions
cypress: 3.8.1
npm: 6.13.4
OS: Ubuntu 18.04.3 LTS
Activity
jennifer-shehane commentedon Jan 13, 2020
I can confirm this behavior. This should not be happening.
Steps to reproduce
flotwig commentedon Jan 13, 2020
Seems like
--config-file
isn't respecting absolute paths. When you pass--config-file ~/foo
, your shell expands it to/Users/username/foo
, which Cypress is incorrectly appending to the project root. Looks like_pathToFile
here needs to be fixed:cypress/packages/server/lib/util/settings.js
Lines 60 to 62 in c9b392a
[-]Error running cypress with `--config-file` set to file at home[/-][+]Error running cypress with `--config-file` set to an absolute path[/+]drptbl commentedon Sep 13, 2020
Having same issue. You can't use absolute path with
--config-file
.Using this:
cypress run --config-file /Users/xxx/something/project/cypress.json
will throw following error:
^ @flotwig already linked proper place in code where the issue is.
Fixes cypress-io#6136 - Combines project root with file path only if …
cypress-bot commentedon Jun 1, 2021
The code for this is done in cypress-io/cypress#16746, but has yet to be released.
We'll update this issue and reference the changelog when it's released.
cypress-bot commentedon Jun 7, 2021
Released in
7.5.0
.This comment thread has been locked. If you are still experiencing this issue after upgrading to
Cypress v7.5.0, please open a new issue.