Cypress: pluginsFile config does not respect path, forces a prefixed CWD

Created on 31 May 2018  路  4Comments  路  Source: cypress-io/cypress

Is this a Feature or Bug?

Bug

Current behavior:


We have an internal framework that our other apps use for general things, where Cypress is one of them.
Our config is placed in this framework so that the consuming apps only need to write specs.
I noticed that the pluginsFile config does not behave like the other path based configs.

In the image below, the supportFile correctly points to /frameworkpath/../support/command.js, however the pluginsFile, written in the exact same manner, points to /consumingAppPath/frameworkPath/../support/command.js which does not exist. It seems like the path is prefixed with process.cwd() no matter what.

image

Desired behavior:

supportsFile config should be configurable to point to a supportsFile without forcing a process.cwd() prefix, making it impossible to have general plugin config when using a shared framework for frontend applications.

Steps to reproduce:

See above image

Versions

3.0.1

pkserver bug

Most helpful comment

Thanks for the info. I've verified this as a bug. Any absolute path won't work for the pluginsFile because, as you pointed out, it's prefixed with the project root path.

Should be a simple fix we can get out in the next patch release.

All 4 comments

Can you describe how you're using the posted code to configure Cypress? Does it write a cypress.json with those values or does it use ENV variables?

@chrisbreiding it's used in this manner:

cypress.open({
    config: cypressFolderConfig(testDirectory),
  })

where testDirectory is an absolute path to a ./test/ folder in the consuming application and the above code is called in the consuming apps package.json

Neither a cypress.json or .env files are used, this is exposed as a CLI.

example in package.json.scripts:

"cypress:open": "zeus-cypress open",

Thanks for the info. I've verified this as a bug. Any absolute path won't work for the pluginsFile because, as you pointed out, it's prefixed with the project root path.

Should be a simple fix we can get out in the next patch release.

Released in 3.0.2.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

carloscheddar picture carloscheddar  路  3Comments

Francismb picture Francismb  路  3Comments

igorpavlov picture igorpavlov  路  3Comments

tahayk picture tahayk  路  3Comments

egucciar picture egucciar  路  3Comments