Skip to content

Commit 57e9c78

Browse files
authored
fix: close selector playground on restart (#14784)
1 parent 67715f5 commit 57e9c78

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

packages/runner/cypress/integration/runner.ui.spec.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,28 @@ describe('src/cypress/runner', () => {
321321
cy.percySnapshot()
322322
})
323323
})
324+
325+
context('selector playground', () => {
326+
it('shows on click', () => {
327+
runIsolatedCypress({})
328+
329+
cy.get('.selector-playground').should('not.be.visible')
330+
cy.get('.selector-playground-toggle').click()
331+
cy.get('.selector-playground').should('be.visible')
332+
333+
cy.percySnapshot()
334+
})
335+
336+
it('closes on restart', () => {
337+
runIsolatedCypress({})
338+
339+
cy.get('.selector-playground-toggle').click()
340+
cy.get('.selector-playground').should('be.visible')
341+
342+
cy.get('.restart').click()
343+
cy.get('.selector-playground').should('not.be.visible')
344+
})
345+
})
324346
})
325347

326348
describe('reporter interaction', () => {

packages/runner/src/lib/event-manager.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { client, circularParser } from '@packages/socket/lib/browser'
88
import automation from './automation'
99
import logger from './logger'
1010
import studioRecorder from '../studio/studio-recorder'
11+
import selectorPlaygroundModel from '../selector-playground/selector-playground-model'
1112

1213
import $Cypress, { $ } from '@packages/driver'
1314

@@ -509,6 +510,7 @@ const eventManager = {
509510
Cypress.stop()
510511

511512
studioRecorder.setInactive()
513+
selectorPlaygroundModel.setOpen(false)
512514

513515
return this._restart()
514516
.then(() => {

0 commit comments

Comments
 (0)