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

feat: allow cypress.config.js to be a default config file #18221

Merged
merged 39 commits into from
Sep 29, 2021

Conversation

elevatebart
Copy link
Contributor

@elevatebart elevatebart commented Sep 23, 2021

User facing changelog

Now one can use cypress.config.js as a default config file instead of cypress.json

Additional details

  • When this file is present, no cypress.json will be created

  • If both files (json and js) are present cypress should error

  • Desktop gui was adapted as well like so

Screen Shot 2021-09-23 at 3 39 52 PM

PR Tasks

  • Have tests been added/updated?

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Sep 23, 2021

Thanks for taking the time to open a PR!

@cypress
Copy link

cypress bot commented Sep 23, 2021



Test summary

18532 0 214 7Flakiness 0


Run details

Project cypress
Status Passed
Commit 22cfcc9
Started Sep 28, 2021 6:40 PM
Ended Sep 28, 2021 6:51 PM
Duration 10:47 💡
OS Linux Debian - 10.9
Browser Multiple

View run in Cypress Dashboard ➡️


This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard

@elevatebart elevatebart changed the title feat: allow cypress.config.js to be a config file feat: allow cypress.config.js to be a default config file Sep 23, 2021
@elevatebart elevatebart marked this pull request as ready for review September 23, 2021 20:41
@elevatebart elevatebart requested a review from a team as a code owner September 23, 2021 20:41
@elevatebart elevatebart requested review from flotwig and removed request for a team September 23, 2021 20:41
@lmiller1990
Copy link
Contributor

If I have both cypress.json and cypress.config.js, I am not seeing the expected error. Instead, I just get "stack trace".

image

@elevatebart
Copy link
Contributor Author

I think I forgot to add the conflict error.
Thank you for checking.

Copy link
Member

@jennifer-shehane jennifer-shehane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. When using cypress.config.js and setting up a project, the projectId is not being written to the the cypress.config.js file, it's instead creating a new cypress.json file and writing the projectId into that file. This means if they directly go to run the record run command - they'll get an error about 2 config files. This critical path has to be fixed.

    The same bug occurs if you pass a custom --config-file, it creates a new cypress.json and adds the projectId there instead.

  2. If this is a JS file, the preview should show as module.exports = { projectId: ...}

    Screen Shot 2021-09-24 at 11 31 40 AM
  3. Is the nodeVersion being used to read in their cypress.config.js also? Does that need to be noted here?

    Screen Shot 2021-09-24 at 11 33 17 AM
  4. The percy snapshots are not working, not showing the correct config file in the desktop-gui screenshots.

packages/server/lib/errors.js Outdated Show resolved Hide resolved
Copy link
Member

@jennifer-shehane jennifer-shehane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When you go to copy to clipboard the projectId preview when it's a JS file, including the module.exports, it only copies the JSON portion. This experience is odd. I'd expect it to copy the text that it is showing me.

A couple minor text fixes.

packages/desktop-gui/src/settings/node-version.jsx Outdated Show resolved Hide resolved
packages/server/lib/open_project.ts Outdated Show resolved Hide resolved
elevatebart and others added 3 commits September 28, 2021 13:23
Co-authored-by: Jennifer Shehane <jennifer@cypress.io>
Co-authored-by: Jennifer Shehane <jennifer@cypress.io>
@elevatebart
Copy link
Contributor Author

@jennifer-shehane copy to clipboard has been fixed in 22cfcc9

Copy link
Member

@jennifer-shehane jennifer-shehane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed the copy to clipboard is now working.

@elevatebart elevatebart merged commit 07d4340 into develop Sep 29, 2021
flotwig pushed a commit that referenced this pull request Sep 30, 2021
Co-authored-by: Jennifer Shehane <jennifer@cypress.io>
@elevatebart elevatebart deleted the feat/multiple-defaults branch March 24, 2022 18:19
mjhenkes pushed a commit that referenced this pull request Jul 27, 2022
Co-authored-by: Jennifer Shehane <jennifer@cypress.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants