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: create-cypress-tests auto-inject config #9116

Conversation

dmtrKovalenko
Copy link
Contributor

This PR is a continuation of #8857 and introduces the automatic injection of config into the user cypress plugin for component testing.

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Nov 6, 2020

Thanks for taking the time to open a PR!

@cypress
Copy link

cypress bot commented Nov 6, 2020



Test summary

8661 0 124 3Flakiness 2


Run details

Project cypress
Status Passed
Commit 1c2e236
Started Nov 9, 2020 3:06 PM
Ended Nov 9, 2020 3:18 PM
Duration 11:23 💡
OS Linux Debian - 10.2
Browser Multiple

View run in Cypress Dashboard ➡️


Flakiness

commands/net_stubbing_spec.ts Flakiness
1 network stubbing > stubbing with static responses > still works after a cy.visit
retries.ui.spec.js Flakiness
1 runner/cypress retries.ui.spec > opens attempt on each attempt failure for the screenshot, and closes after test passes

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
Copy link
Contributor

Given the usage of NuxtJs, it could be useful to have an integration about it.

Let's do it in another PR.

@elevatebart
Copy link
Contributor

Since create-cypress-tests will be published to npm, can you add a Readme.md file to quickly describe what it does?

@elevatebart
Copy link
Contributor

I believe we can still optimize by batching the installation of dependencies.

And there are still some issues with the English used in the prompts and the names of the tests.

I will make a few small PRs in the future.

Since the tests for now are fileSystem almost e2e tests, they will take forever. I hope they will only be run if something changes in the wizard.

Did you check that CI will only be run when necessary?

@dmtrKovalenko
Copy link
Contributor Author

@elevatebart All the tests are running for 8 seconds on CI. https://app.circleci.com/pipelines/github/cypress-io/cypress/14602/workflows/a80f9c9a-2829-47bd-b43e-a69ca90025c8/jobs/507154/parallel-runs/0/steps/0-103 (only a few tests are e2e fs based)

Moreover I am not sure that this feature with dependent-only CI builds is ready... cc @panzarino

@elevatebart
Copy link
Contributor

Thank you @dmtrKovalenko I am reassured.
When I saw yarn add in npm/create-cypress-tests/src/utils.ts the installDependency function, I thought that we were running the yarn installations in tests.

Thank you.

@dmtrKovalenko
Copy link
Contributor Author

Since Bart and Jess reviewed this I am merging this PR into the original one and will work on code review points. It will be easier to no split changes, as we already reviewed this.

@dmtrKovalenko dmtrKovalenko merged commit 8f34fae into feature/cross-platform-wizard Nov 19, 2020
@dmtrKovalenko dmtrKovalenko deleted the feature/create-cypress-tests-inject-code branch November 19, 2020 12:12
dmtrKovalenko added a commit that referenced this pull request Mar 5, 2021
* Remove unused stuff

* Fix eslint errors

* Use local cypress running script

* Fix dependency resolution

* Revert "Fix dependency resolution"

This reverts commit 01a70be.

* Add @cypress/react CI

* Properly resolve @types pacakges

* Run tests with mocha

* Fix cypress tests

* Fix or skip some specs

* Add retries to the card-spec.js

* Remove jest mocks

* Run e2e examples on CI

* Fix yarn cache key

* Fix e2e examples jobs

* Rename cypress-react-unit-test with @cypress/react

* Fix circleci.yml

* Revert "Fix e2e examples jobs"

This reverts commit efcc7c4.

* Revert " Rename cypress-react-unit-test with @cypress/react"

This reverts commit 4febfcc.

* Replce cypress-react-unit-test with @cypress/react

* Persist build artifacts

* Fix working directory paths circle.yml

* Fix more CI

* adding yarn.lock files

* Make package.json for  folder

* Remove .npmrc

* Update circle.yml

* Remove unused files

* Copy plugins files to the "dist" folder

* Fix links to the github repos

* Move init wizard from npm/react/init to npm/wizard

* Move init wizard from npm/react/init to npm/wizard

* Implement initial vue template

* Run wizard tests on CI

* Refactor continue: bool to success: bool for better code readability

* Fix circleci.yml

* Use only absolute paths for tests

* Stub process.exit calls

* Remove useless comments

* Add installation cypress to the wizard logic

* More improvements

* Include packages/examples/cypress into git

* Commit new files

* Use packages/example as SST for generated files

* Last improvements for wizard

* Update packages/server/lib/scaffold.js

* Rename wizard to create-cypress-tests

* Fix circleci config

* Fix snapshot tests

* Run all create-cypress-tests on ci

* Do not install plugins and scaffold files from kitchensink

* Ignore integration/examples folder for packages/example

* Run create-cypress-tests-tests on CI

* Add copy example cross-platform script

* Use copy example script in tests

* feat: create-cypress-tests auto-inject config (#9116)

* Implement the basic babel code transformation for configs

* Add more tests for edge-cases

* Add snapshot tests for autogenerated code for each template

* Add git status guard

* Add git status guard

* Fix last test

* Fix tests

* Revert changes for packages/example

* Revert changes for packages/example/tsconfig.json

* Prepeare package for the release

* Fix inquirer name

* v0.0.125

* v0.0.127

* v0.0.128

* v0.0.130

* v0.0.131

* Add more UX features

* Add vue-cli template

* Make src as default folder for vue-cli template

* Revert dev-time changes

* Run appveyour windows build

* Run full appveyour build

* Fix circle.yml

* Update plugins

* Join paths for windows

* Revert example/lib changes

* Fix tests

* Revert unnecessary changes

* Implement dev-server dependency installation

* Update npm/create-cypress-tests/README.md

* Include webpack-options template in dist

Co-authored-by: Jessica Sachs <jess@jessicasachs.io>
dmtrKovalenko added a commit that referenced this pull request Mar 5, 2021
…dlers (#15337)

* Remove unused stuff

* Fix eslint errors

* Use local cypress running script

* Fix dependency resolution

* Revert "Fix dependency resolution"

This reverts commit 01a70be.

* Add @cypress/react CI

* Properly resolve @types pacakges

* Run tests with mocha

* Fix cypress tests

* Fix or skip some specs

* Add retries to the card-spec.js

* Remove jest mocks

* Run e2e examples on CI

* Fix yarn cache key

* Fix e2e examples jobs

* Rename cypress-react-unit-test with @cypress/react

* Fix circleci.yml

* Revert "Fix e2e examples jobs"

This reverts commit efcc7c4.

* Revert " Rename cypress-react-unit-test with @cypress/react"

This reverts commit 4febfcc.

* Replce cypress-react-unit-test with @cypress/react

* Persist build artifacts

* Fix working directory paths circle.yml

* Fix more CI

* adding yarn.lock files

* Make package.json for  folder

* Remove .npmrc

* Update circle.yml

* Remove unused files

* Copy plugins files to the "dist" folder

* Fix links to the github repos

* Move init wizard from npm/react/init to npm/wizard

* Move init wizard from npm/react/init to npm/wizard

* Implement initial vue template

* Run wizard tests on CI

* Refactor continue: bool to success: bool for better code readability

* Fix circleci.yml

* Use only absolute paths for tests

* Stub process.exit calls

* Remove useless comments

* Add installation cypress to the wizard logic

* More improvements

* Include packages/examples/cypress into git

* Commit new files

* Use packages/example as SST for generated files

* Last improvements for wizard

* Update packages/server/lib/scaffold.js

* Rename wizard to create-cypress-tests

* Fix circleci config

* Fix snapshot tests

* Run all create-cypress-tests on ci

* Do not install plugins and scaffold files from kitchensink

* Ignore integration/examples folder for packages/example

* Run create-cypress-tests-tests on CI

* Add copy example cross-platform script

* Use copy example script in tests

* feat: create-cypress-tests auto-inject config (#9116)

* Implement the basic babel code transformation for configs

* Add more tests for edge-cases

* Add snapshot tests for autogenerated code for each template

* Add git status guard

* Add git status guard

* Fix last test

* Fix tests

* Revert changes for packages/example

* Revert changes for packages/example/tsconfig.json

* Prepeare package for the release

* Fix inquirer name

* v0.0.125

* v0.0.127

* v0.0.128

* v0.0.130

* v0.0.131

* Add more UX features

* Add vue-cli template

* Make src as default folder for vue-cli template

* Revert dev-time changes

* Run appveyour windows build

* Run full appveyour build

* Fix circle.yml

* Update plugins

* Join paths for windows

* Revert example/lib changes

* Fix tests

* Revert unnecessary changes

* Implement dev-server dependency installation

* Update npm/create-cypress-tests/README.md

* Properly exit process if react tests failed

* Fix circleci reporter not found

* Update nextjs plugin

* react-scripts plugin for dev-server

* Implement webpack-file plugin support

* v0.0.502

* v0.0.503

* Implement rollup support

* Implement babel plugin

* Update webpack options

* Fix nextjs plugin

* Unmount components in beforeEach to prevent side-effects

* Rename preprocessor to injectDevServer

* Fix next.js example

* Fix webpack-options exampel

* Reproduce rollup problem

* Update create-cypress-tests snapshots

* Do not run examples/rollup

* Uncomment test

* Change paralllelism

* Remove useless checks

* Update snapshots

Co-authored-by: Jessica Sachs <jess@jessicasachs.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.

2 participants