Skip to content
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

Add ability to initialize cypress directory programmatically #2668

Closed
drewbrend opened this issue Oct 26, 2018 · 1 comment
Closed

Add ability to initialize cypress directory programmatically #2668

drewbrend opened this issue Oct 26, 2018 · 1 comment
Labels
type: duplicate This issue or pull request already exists

Comments

@drewbrend
Copy link

Current behavior:

To populate the /cypress/ directory you must open cypress GUI after it is installed

Desired behavior:

Be able to run a command from the CLI to populate the /cypress/ directory, something like cypress init.

Reasoning for this:

My company has an internal npm package we have created that contains additional commands, plugins, fixtures, etc for our application. npm install finishes with a postinstall script will "plug" this into files in the /cypress/ directory. Example: adding an import statement to the support/index.js file, and adding a call to our shared package's plugins/index.js file from the application's plugins/index.js file.

In a new project, the setup workflow for us is:

  1. npm install --save-dev cypress
  2. ./node_module/.bin/cypress open <= solely to populate the /cypress/ directory
  3. npm install --save-dev @ourcompany/shared-cypress

If the user has not opened cypress and does not have the /cypress/ directory, we spew out a bunch of errors and tell them they need to open cypress and reinstall our package

If cypress has a command like cypress init, we could run that in a preinstall script and not have to worry about this case.

Versions

Cypress 3.1.0

@jennifer-shehane
Copy link
Member

Duplicate of #619 Thanks for detailing your use case!

@jennifer-shehane jennifer-shehane added the type: duplicate This issue or pull request already exists label Oct 31, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants