Skip to content

Conversation

@jennifer-shehane
Copy link
Member

@jennifer-shehane jennifer-shehane commented Dec 5, 2025

Additional details

Related services change: https://github.com/cypress-io/cypress-services/pull/12320

  • Add back Selector Playground for all users in open mode
  • Selector Playground button should be disabled while tests are running.
  • The 'hand' button removed to toggle Selector Playground on/off (redundant - now opening/closing Selector Playground is the way to enable/disable)
  • When active, button now displays with purple background.
  • Turn off recording any actions in Studio (and show recording as off) when the Selector Playground is open with Studio panel open. Switch back to Studio recording when they close the Selector Playground panel.
  • Turning on recording in Studio with the Selector Playground open will close selector playground. (They shouldn't be able to both be on at the same time).
  • Opening the Selector Playground will close any Assertion dropdowns that are currently open.

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.

  • UI/Runner – Selector Playground
    • Re-adds the Playground toggle in SpecRunnerHeaderOpenMode.vue using @cypress-design/vue-button; disabled while tests are running/loading and shows active (purple) state.
    • Renders SelectorPlayground panel when selectorPlaygroundStore.show is true; input UX refined (prefix length calc, anti-autocomplete attributes).
  • Selector Playground core utilities
    • Introduces selector-playground/utils.ts with openPlayground, closePlayground, togglePlayground, SELECTOR_METHODS, and prefix helpers; removes legacy toggle from runner/utils.ts.
    • Ensures opening enables interactive mode and highlighting; closing turns them off; closes assertions menu when Studio is active.
    • Closes Playground on spec change via unifiedRunner.ts.
  • Studio integration
    • StudioPanel.vue passes isSelectorPlaygroundOpen and onCloseSelectorPlayground to Studio; Studio can close Playground when recording starts.
    • Header always shows Playground activator; Studio button visibility unchanged by Playground.
  • Tests
    • Adds/updates component tests for header behavior and Selector Playground lifecycle, highlighting, method switching, input attrs, and utils (utils.cy.ts).
  • Changelog
    • Notes feature: Playground available for all users in open mode; auto-enables interactive mode.
  • Dependencies
    • Bumps design system button packages in packages/app and packages/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

Screenshot 2025-12-05 at 4 32 58 PM
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

@jennifer-shehane jennifer-shehane self-assigned this Dec 5, 2025
Comment on lines 275 to 284
/* 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 */
}
Copy link
Member Author

@jennifer-shehane jennifer-shehane Dec 5, 2025

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.

Comment on lines -333 to -336
const studioBetaAvailable = computed(() => {
return !!cloudStudioRequested.value
})
Copy link
Member Author

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

Comment on lines -6 to -21
<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>
Copy link
Member Author

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

cypress bot commented Dec 5, 2025

cypress    Run #68005

Run Properties:  status check failed Failed #68005  •  git commit 58ae592c5f: update to use design-system purple-dark-mode button
Project cypress
Branch Review add-back-selector-playground
Run status status check failed Failed #68005
Run duration 19m 15s
Commit git commit 58ae592c5f: update to use design-system purple-dark-mode button
Committer Jennifer Shehane
View all properties for this run ↗︎

Test results
Tests that failed  Failures 1
Tests that were flaky  Flaky 9
Tests that did not run due to a developer annotating a test with .skip  Pending 1098
Tests that did not run due to a failure in a mocha hook  Skipped 4
Tests that passed  Passing 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%
  Untested elements 194  
  Tested elements 164  
Accessibility  98%
  Failed rules  4 critical   8 serious   2 moderate   2 minor
  Failed elements 101  

Tests for review

Failed  cypress/e2e/commands/files.cy.js • 1 failed test • 5x-driver-firefox

View Output

Test Artifacts
src/cy/commands/files > #readFile > retries to read when ENOENT
    </td>
  </tr></table>
Flakiness  issues/28527.cy.ts • 1 flaky test • 5x-driver-electron

View Output

Test Artifacts
issue 28527 > fails and then retries and verifies about:blank is not displayed Test Replay Screenshots
Flakiness  e2e/origin/config_env.cy.ts • 1 flaky test • 5x-driver-inject-document-domain-chrome

View Output

Test Artifacts
cy.origin- Cypress.config() > serializable > overwrites different values in secondary if one exists in the primary Test Replay
Flakiness  commands/net_stubbing.cy.ts • 1 flaky test • 5x-driver-firefox

View Output

Test Artifacts
... > stops waiting when an xhr request is canceled
    </td>
  </tr></table>
Flakiness  e2e/origin/cookie_misc.cy.ts • 1 flaky test • 5x-driver-firefox

View Output

Test Artifacts
misc cookie tests > cookies are not set for XHR sync requests
    </td>
  </tr></table>
Flakiness  issues/28527.cy.ts • 1 flaky test • 5x-driver-firefox

View Output

Test Artifacts
issue 28527 > fails and then retries and verifies about:blank is not displayed Screenshots

The first 5 flaky specs are shown, see all 9 specs in Cypress Cloud.

Comment on lines +197 to +198

it('triggers highlight on mouseover', () => {
Copy link
Member Author

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

@jennifer-shehane
Copy link
Member Author

jennifer-shehane commented Dec 8, 2025

Need to implement how this works with Studio:

  • Disable the recording button and disable recording any actions in Studio when the Selector Playground is open with Studio panel open. Switch back to Studio recording when they close the Selector Playground panel.
  • Possibly handle the Selector Playground button on a test is showing the default 'cy' background (like an errored test file + new Studio test).

@jennifer-shehane jennifer-shehane marked this pull request as draft December 8, 2025 20:48
@jennifer-shehane jennifer-shehane marked this pull request as ready for review December 8, 2025 22:04
},

_shouldRecordEvent (event, $el) {
if (this._isRecordingDisabled) {
Copy link
Contributor

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

Copy link
Member Author

@jennifer-shehane jennifer-shehane Dec 12, 2025

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.

Copy link
Member Author

Choose a reason for hiding this comment

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

Addressed here: 8ed399f

Copy link
Contributor

@mabela416 mabela416 left a 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

@mabela416
Copy link
Contributor

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.mov

I 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

image

@jennifer-shehane
Copy link
Member Author

@mabela416 Addressed a couple comments

Copy link
Contributor

@mabela416 mabela416 left a 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

@jennifer-shehane jennifer-shehane merged commit 9d4e9cf into develop Dec 15, 2025
87 of 93 checks passed
@jennifer-shehane jennifer-shehane deleted the add-back-selector-playground branch December 15, 2025 19:22
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.

Selector playground - would like this same functionality in 15.4.0+

3 participants