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: cypress init command #6249

Closed
wants to merge 51 commits into from
Closed

Conversation

sainthkh
Copy link
Contributor

@sainthkh sainthkh commented Jan 27, 2020

User facing changelog

Scaffold Cypress with cypress init.

Additional details

Options

Screenshot from 2020-04-15 15-04-34

Questions

Peek 2020-04-15 15-08

Why was this change necessary?

Many developers wanted to control how Cypress is scaffolded.

What is affected by this change?

You can control how Cypress is scaffolded.

Any implementation details to explain?

  • I only wrote unit tests because AFAIK, console input cannot be e2e-tested. If there is a way to do that, please help.
  • I used prompts rather than inquirer because it's small.

How has the user experience changed?

Check above.

It doesn't change anything. It just adds cypress init command.

PR Tasks

  • Have tests been added/updated?
  • Has the original issue been tagged with a release in ZenHub?
  • Has a PR for user-facing changes been opened in cypress-documentation?
  • [N/A] Have API changes been updated in the type definitions?
  • [N/A] Have new configuration options been added to the cypress.schema.json?

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Jan 27, 2020

Thanks for the contribution! Below are some guidelines Cypress uses when doing PR reviews.

  • Please write [WIP] in the title of your Pull Request if your PR is not ready for review - someone will review your PR as soon as the [WIP] is removed.
  • Please familiarize yourself with the PR Review Checklist and feel free to make updates on your PR based on these guidelines.

PR Review Checklist

If any of the following requirements can't be met, leave a comment in the review selecting 'Request changes', otherwise 'Approve'.

User Experience

  • The feature/bugfix is self-documenting from within the product.
  • The change provides the end user with a way to fix their problem (no dead ends).

Functionality

  • The code works and performs its intended function with the correct logic.
  • Performance has been factored in (for example, the code cleans up after itself to not cause memory leaks).
  • The code guards against edge cases and invalid input and has tests to cover it.

Maintainability

  • The code is readable (too many nested 'if's are a bad sign).
  • Names used for variables, methods, etc, clearly describe their function.
  • The code is easy to understood and there are relevant comments explaining.
  • New algorithms are documented in the code with link(s) to external docs (flowcharts, w3c, chrome, firefox).
  • There are comments containing link(s) to the addressed issue (in tests and code).

Quality

  • The change does not reimplement code.
  • There's not a module from the ecosystem that should be used instead.
  • There is no redundant or duplicate code.
  • There are no irrelevant comments left in the code.
  • Tests are testing the code’s intended functionality in the best way possible.

Internal

  • The original issue has been tagged with a release in ZenHub.

@sainthkh sainthkh force-pushed the issue-619 branch 2 times, most recently from 6c3b99b to 8ca8239 Compare March 17, 2020 07:57
@sainthkh sainthkh mentioned this pull request Mar 26, 2020
4 tasks
@sainthkh sainthkh force-pushed the issue-619 branch 2 times, most recently from b6d3771 to 6d9f5c0 Compare April 8, 2020 08:34
@sainthkh sainthkh force-pushed the issue-619 branch 2 times, most recently from 431aeca to 22e277b Compare April 14, 2020 07:58
@sainthkh sainthkh marked this pull request as ready for review April 15, 2020 06:15
@sainthkh sainthkh changed the title [WIP] cypress init command cypress init command Apr 15, 2020
@sainthkh sainthkh requested a review from bahmutov April 15, 2020 06:15
@sainthkh
Copy link
Contributor Author

flaky test.

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.

I would prefer the flag options match the naming convention of the configuration. So having --fixtures-folder accept false or a path as opposed to having 2 flags of --no-fixtures and --fixtures-path, what happens if they set both to contradicting values for example?

The Questions prompts are a really good start to the experience of what I was expecting for cypress init. This will require much more extensive review from the team over the user experience and design decisions.

@sainthkh
Copy link
Contributor Author

  • I was thinking about the case of the folder name, false. Maybe, I went too much.
  • When no-fixtures=true and fixtures-path is given, it throws an error. The lines below do that job.

if (fixtures === false && fixturesPath) {
throw new Error('Conflicting Arguments: no-fixtures and fixtures-path cannot be defined together.')
}
if (support === false && supportPath) {
throw new Error('Conflicting Arguments: no-support and support-path cannot be defined together.')
}
if (plugins === false && pluginsPath) {
throw new Error('Conflicting Arguments: no-plugins and plugins-path cannot be defined together.')
}

@jennifer-shehane
Copy link
Member

We're going to have to dedicate some time to reviewing this implementation. At the moment we've decided to postpone a full review until a later sprint.

@sainthkh
Copy link
Contributor Author

It's fine. I can wait.

@sainthkh
Copy link
Contributor Author

sainthkh commented Apr 8, 2021

It seems that create-cypress-tests replaces this PR. Close it.

@sainthkh sainthkh closed this Apr 8, 2021
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.

Add cypress init command to seed / scaffold test files on current directory
2 participants