-
Notifications
You must be signed in to change notification settings - Fork 3.4k
feat: add back selector playground #33073
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
Conversation
| /* Apply outline-dark hover styles to purple-dark button */ | ||
| .playground-button-purple:hover { | ||
| border-color: rgba(255, 255, 255, 0.6) !important; /* hocus:border-white/60 */ | ||
| box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2) !important; /* hocus:shadow-white/20 */ | ||
| } | ||
| .playground-button-purple:focus { | ||
| border-color: rgba(255, 255, 255, 0.6) !important; /* hocus:border-white/60 */ | ||
| box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2) !important; /* hocus:shadow-white/20 */ | ||
| } |
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.
The purple-dark button variant in the design system doesn't have the hover/focus style that's in the Figma.
| const studioBetaAvailable = computed(() => { | ||
| return !!cloudStudioRequested.value | ||
| }) | ||
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.
This isn't used anywhere else in this component
| <SelectorPlaygroundTooltip | ||
| color="light" | ||
| placement="top" | ||
| :hover-text="t('runner.selectorPlayground.playgroundTooltip')" | ||
| class="flex h-full" | ||
| > | ||
| <button | ||
| class="border rounded-md flex h-full outline-solid outline-indigo-500 transition w-[40px] duration-150 items-center justify-center hover:bg-gray-800" | ||
| :aria-label="selectorPlaygroundStore.isEnabled ? 'click to interact with the application and build test cases' : 'click to exit interactive test building mode'" | ||
| data-cy="playground-toggle" | ||
| :class="{ 'bg-gray-800 border-gray-700': selectorPlaygroundStore.isEnabled, 'bg-gray-900 border-gray-800': !selectorPlaygroundStore.isEnabled }" | ||
| @click="toggleEnabled" | ||
| > | ||
| <i-cy-selector_x16 class="icon-dark-gray-300" /> | ||
| </button> | ||
| </SelectorPlaygroundTooltip> |
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.
We talked about removing this button as its redundant. The work wasn't done since the assumption was we were getting rid of it.
cypress
|
||||||||||||||||||||||||||||||||||||||||
| Project |
cypress
|
| Branch Review |
add-back-selector-playground
|
| Run status |
|
| Run duration | 19m 15s |
| Commit |
|
| Committer | Jennifer Shehane |
| View all properties for this run ↗︎ | |
| Test results | |
|---|---|
|
|
1
|
|
|
9
|
|
|
1098
|
|
|
4
|
|
|
26750
|
| View all changes introduced in this branch ↗︎ | |
Warning
Partial Report: The results for the Application Quality reports may be incomplete.
UI Coverage
45.18%
|
|
|---|---|
|
|
194
|
|
|
164
|
Accessibility
98%
|
|
|---|---|
|
|
4 critical
8 serious
2 moderate
2 minor
|
|
|
101
|
Tests for review
cypress/e2e/commands/files.cy.js • 1 failed test • 5x-driver-firefox
|
|
||
| it('triggers highlight on mouseover', () => { |
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.
just added some CT coverage that was never there
|
Need to implement how this works with Studio:
|
| }, | ||
|
|
||
| _shouldRecordEvent (event, $el) { | ||
| if (this._isRecordingDisabled) { |
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.
Just fyi, I don't think we're using this function anymore. The logic we use for studio to determine if should record an event is here in the useCommandRecorder hook
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.
Thank you! This was very not obvious to me. I'm going to remove a bunch of this unused code in a new PR also so this mistake doesn't occur again.
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.
Addressed here: 8ed399f
mabela416
left a comment
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.
I think we should also close the assertions menu when the selector playground is opened
Screen.Recording.2025-12-11.at.5.42.17.PM.mov
|
The disabled style is weird when the selector playground is open and then you go inside studio Screen.Recording.2025-12-12.at.9.27.49.AM.movI also think the disabled style should be more like the Record button. At first glance, it doesn't look like it's disabled until you hover over it and see the little icon
|
|
@mabela416 Addressed a couple comments
|
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.
The selector playground should also be disabled while tests are loading
Screen.Recording.2025-12-12.at.4.03.31.PM.mov
Other than that it looks great

Additional details
Related services change: https://github.com/cypress-io/cypress-services/pull/12320
Note
Restores the Selector Playground for all users in open mode with a new button/UI, automatic enablement/highlighting, Studio-aware behavior, refactored utilities, updated tests, and minor dependency bumps.
SpecRunnerHeaderOpenMode.vueusing@cypress-design/vue-button; disabled while tests are running/loading and shows active (purple) state.SelectorPlaygroundpanel whenselectorPlaygroundStore.showis true; input UX refined (prefix length calc, anti-autocomplete attributes).selector-playground/utils.tswithopenPlayground,closePlayground,togglePlayground,SELECTOR_METHODS, and prefix helpers; removes legacy toggle fromrunner/utils.ts.unifiedRunner.ts.StudioPanel.vuepassesisSelectorPlaygroundOpenandonCloseSelectorPlaygroundto Studio; Studio can close Playground when recording starts.utils.cy.ts).packages/appandpackages/reporter.Written by Cursor Bugbot for commit 58ae592. This will update automatically on new commits. Configure here.
Steps to test
How has the user experience changed?
Before
Selector Playground only available when Studio was not available (during CT tests)
After
Selector Playground always available in open mode
Screen.Recording.2025-12-05.at.4.33.04.PM.mov
Selector Playground + Studio state works together
Screen.Recording.2025-12-10.at.1.04.06.PM.mov
PR Tasks
cypress-documentation?type definitions?