-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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: swap the #__cy_root id selector to become data-cy-root for component mounting #20951
feat: swap the #__cy_root id selector to become data-cy-root for component mounting #20951
Conversation
Thanks for taking the time to open a PR!
|
Test summaryRun details
View run in Cypress Dashboard ➡️ Flakiness
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 |
…root-id-for-data-attribute
…cypress-io/cypress into feat/swap-cy-root-id-for-data-attribute
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some tests are skipped for known reasons
- vuecli5vue3: blocked by https://cypress-io.atlassian.net/browse/UNIFY-1565
- vue 2 tests: blocked by feat: Add vue2 package from npm/vue/v2 branch #21026
Fine with this for now, let's ship it.
system-tests/projects/vue3-vite-ts-configured/src/components/HelloWorld.cy.ts
Outdated
Show resolved
Hide resolved
…cypress-io/cypress into feat/swap-cy-root-id-for-data-attribute
…cypress-io/cypress into feat/swap-cy-root-id-for-data-attribute * 'feat/swap-cy-root-id-for-data-attribute' of github.com:cypress-io/cypress: fixing nuxt issue w sys tests fix: Doc changes around vue2 (#21066)
…o/cypress into tgriesser/fix/UNIFY-1206-cloud * 'tgriesser/fix/UNIFY-1206-cloud' of github.com:cypress-io/cypress: feat: swap the #__cy_root id selector to become data-cy-root for component mounting (#20951) fix: Doc changes around vue2 (#21066) feat: Add vue2 package from npm/vue/v2 branch (#21026) fix: add possible frameworks to object API config (#21056)
* 10.0-release: (25 commits) fix: stop running spec when switching specs (#21038) fix: remove asset size warnings and enable nuxt e2e tests (#21074) feat: swap the #__cy_root id selector to become data-cy-root for component mounting (#20951) fix: Doc changes around vue2 (#21066) feat: Add vue2 package from npm/vue/v2 branch (#21026) skip failing test fix: add possible frameworks to object API config (#21056) fix snapshot spacing fix system test fix snapshot update snapshots rename spec files rename files update snapshots release 9.5.4 [skip ci] fix(regression): cy.pause() should not be ignored with `cypress run --headed --no-exit` (#20877) fix: add missing Cypress.Commands.addAll() types (#20894) chore: Don't store video and screenshot artifacts for runs (#20979) chore: Update Chrome (beta) to 101.0.4951.26 (#20957) chore: remove parallelism from test-binary-against-repo jobs (#21004) ...
User facing changelog
For component tests, we're changing the default selector for where the component should attach onto.
Currently: using an ID for the mounting point
The html scaffolded for component testing requires a mounting point. This is currently a
ROOT_ID
. The downside to having anid
is that there can only be one. For users whose stylesheets use a root node with id to segment their global app styles, this means that you'll need to create an inner-div or other DOM fixture so that the stylesheet rules apply.After: using a
data-*
attribute for the mounting pointNow, we expose a
ROOT_SELECTOR
which is adata-*
attribute and so now the user can assign anid
instead of refactoring their stylesheets.