Skip to content

Commit 3e294e9

Browse files
committed
Squashed commit of the following:
commit 898fbc1 Merge: 00a488f 096b756 Author: mabela416 <mabel@cypress.io> Date: Mon Oct 20 13:48:47 2025 -0400 Merge branch 'develop' into mabel/issue-12026-handle-snapshots-in-studio commit 00a488f Author: Matthew Schile <mschile@cypress.io> Date: Mon Oct 20 11:02:51 2025 -0600 update changelog commit eb13900 Merge: 5b31a06 93375b7 Author: mabela416 <mabel@cypress.io> Date: Mon Oct 20 09:02:03 2025 -0400 Merge branch 'develop' into mabel/issue-12026-handle-snapshots-in-studio commit 5b31a06 Merge: 3b61635 a810356 Author: Mabel Amaya <mabel@cypress.io> Date: Fri Oct 17 14:53:51 2025 -0400 Merge remote-tracking branch 'refs/remotes/origin/mabel/issue-12026-handle-snapshots-in-studio' into mabel/issue-12026-handle-snapshots-in-studio commit 3b61635 Merge: fe5e574 5f756c4 Author: Mabel Amaya <mabel@cypress.io> Date: Fri Oct 17 14:52:46 2025 -0400 Merge remote-tracking branch 'origin/develop' into mabel/issue-12026-handle-snapshots-in-studio commit fe5e574 Author: Mabel Amaya <mabel@cypress.io> Date: Fri Oct 17 12:20:14 2025 -0400 fix changelog link to the ticket commit 25a20d5 Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Date: Fri Oct 17 11:27:13 2025 -0400 chore(deps): update dependency @antfu/utils to ^0.7.10 (#32744) * chore(deps): update dependency @antfu/utils to ^0.7.10 * empty commit --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Jennifer Shehane <shehane.jennifer@gmail.com> commit bda29e2 Author: Cacie Prins <cacieprins@users.noreply.github.com> Date: Fri Oct 17 11:24:34 2025 -0400 chore: Update Chrome (stable) to 141.0.7390.107 and Chrome (beta) to 142.0.7444.34 (#32743) Co-authored-by: cypress-bot[bot] <41898282+cypress-bot[bot]@users.noreply.github.com> Co-authored-by: Jennifer Shehane <jennifer@cypress.io> commit 02050ae Author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri Oct 17 11:23:38 2025 -0400 chore: updating v8 snapshot cache (#32751) Co-authored-by: cypress-bot[bot] <+cypress-bot[bot]@users.noreply.github.com> commit 836988b Author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri Oct 17 11:23:31 2025 -0400 chore: updating v8 snapshot cache (#32750) Co-authored-by: cypress-bot[bot] <+cypress-bot[bot]@users.noreply.github.com> commit 77d3d85 Author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri Oct 17 11:23:23 2025 -0400 chore: updating v8 snapshot cache (#32749) Co-authored-by: cypress-bot[bot] <+cypress-bot[bot]@users.noreply.github.com> commit 367a454 Author: Jennifer Shehane <jennifer@cypress.io> Date: Thu Oct 16 18:27:02 2025 -0400 chore: test against Node.js 25 (#32737) * chore: test against Node.js 25 * also use Node 24 current * and 22 latest * revert the other image updates to just test Node 25 * and binary node versions commit 86e811e Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Date: Thu Oct 16 16:11:04 2025 -0400 chore(deps): update dependency devtools-protocol to v0.0.1528500 (#32729) * chore(deps): update dependency devtools-protocol to v0.0.1528500 * empty commit * circle cache --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Jennifer Shehane <shehane.jennifer@gmail.com> Co-authored-by: Jennifer Shehane <jennifer@cypress.io> commit 541f689 Author: Jennifer Shehane <jennifer@cypress.io> Date: Thu Oct 16 15:36:11 2025 -0400 chore: try blobless checkout method (#32738) * chore: try blobless checkout method * update pipeline checkout commit a810356 Author: Mabel Amaya <mabel@cypress.io> Date: Fri Oct 17 12:20:14 2025 -0400 fix changelog link to the ticket commit 832784b Merge: 74fb176 682a11e Author: Mabel Amaya <mabel@cypress.io> Date: Fri Oct 17 12:16:52 2025 -0400 Merge remote-tracking branch 'refs/remotes/origin/mabel/issue-12026-handle-snapshots-in-studio' into mabel/issue-12026-handle-snapshots-in-studio commit 74fb176 Author: Mabel Amaya <mabel@cypress.io> Date: Fri Oct 17 12:16:16 2025 -0400 update changelog commit 682a11e Merge: ab821a5 3f45167 Author: mabela416 <mabel@cypress.io> Date: Fri Oct 17 12:12:27 2025 -0400 Merge branch 'develop' into mabel/issue-12026-handle-snapshots-in-studio commit ab821a5 Author: Mabel Amaya <mabel@cypress.io> Date: Fri Oct 17 12:11:04 2025 -0400 update logic to disable pinning commit 4d17909 Author: Mabel Amaya <mabel@cypress.io> Date: Fri Oct 17 09:36:24 2025 -0400 add tests commit 8414a9a Author: Mabel Amaya <mabel@cypress.io> Date: Thu Oct 16 17:07:03 2025 -0400 update snapshots not available in studio message commit d7426cb Author: Mabel Amaya <mabel@cypress.io> Date: Thu Oct 16 17:06:46 2025 -0400 disable snapshot pinning in studio mode
1 parent aad5c5e commit 3e294e9

File tree

5 files changed

+104
-43
lines changed

5 files changed

+104
-43
lines changed

cli/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ _Released 10/20/2025 (PENDING)_
1010
**Misc:**
1111

1212
- Add top padding for command log labels. Addressed in [#32774](https://github.com/cypress-io/cypress/pull/32774).
13+
- Disable pinning commands within Studio mode and update snapshot message. Addresses [#31273](https://github.com/cypress-io/cypress/issues/31273). Addressed in [#32753](https://github.com/cypress-io/cypress/pull/32753).
1314

1415
## 15.5.0
1516

packages/app/src/runner/SnapshotControls.cy.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,4 +110,14 @@ describe('SnapshotControls', { viewportHeight: 200, viewportWidth: 500 }, () =>
110110
.findByText('The snapshot is missing. Displaying current state of the DOM.')
111111
.should('be.visible')
112112
})
113+
114+
it('shows studio active error', () => {
115+
mountSnapshotControls()
116+
const snapshotStore = useSnapshotStore()
117+
118+
snapshotStore.setMessage(defaultMessages.runner.snapshot.studioActiveError)
119+
cy.get('body')
120+
.findByText('Command snapshots are not available while in Studio')
121+
.should('be.visible')
122+
})
113123
})

packages/frontend-shared/src/locales/en-US.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -962,7 +962,7 @@
962962
"snapshotMissingError": "The snapshot is missing. Displaying current state of the DOM.",
963963
"defaultTitle": "DOM snapshot",
964964
"pinnedTitle": "Pinned",
965-
"studioActiveError": "Cannot show snapshot while creating commands in Studio"
965+
"studioActiveError": "Command snapshots are not available while in Studio"
966966
},
967967
"selectorPlayground": {
968968
"matches": "No matches | {n} match | {n} matches",

packages/reporter/src/commands/command.cy.tsx

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import Command from './command'
33
import CommandModel from './command-model'
44
import type { SessionStatus } from '../sessions/utils'
55
import type { TestState } from '@packages/types'
6+
import appState from '../lib/app-state'
67

78
describe('commands', () => {
89
describe('test states', () => {
@@ -232,4 +233,50 @@ describe('commands', () => {
232233
cy.get('.command-prompt-get-code-indicator').should('not.exist')
233234
})
234235
})
236+
237+
describe('studio active state', () => {
238+
beforeEach(() => {
239+
appState.reset()
240+
241+
cy.mount(
242+
<div>
243+
<Command
244+
model={
245+
new CommandModel({
246+
name: 'get',
247+
message: '.foo',
248+
state: 'passed',
249+
hasConsoleProps: true,
250+
number: 1,
251+
type: 'parent',
252+
hookId: '1',
253+
testId: '1',
254+
id: 1,
255+
numElements: 1,
256+
})
257+
}
258+
scrollIntoView={() => {}}
259+
aliasesWithDuplicates={[]}
260+
/>
261+
</div>,
262+
)
263+
})
264+
265+
it('allows pinning command when studio is not active', () => {
266+
appState.studioActive = false
267+
cy.get('.command-pin-target').should('exist')
268+
269+
cy.get('.command-pin-target').click()
270+
271+
cy.contains('Printed output to your console').should('be.visible')
272+
})
273+
274+
it('does not allow pinning when studio is active', () => {
275+
appState.studioActive = true
276+
277+
cy.get('.command-pin-target').should('not.exist')
278+
279+
cy.get('.command-wrapper-container').should('exist')
280+
})
281+
})
235282
})

packages/reporter/src/commands/command.tsx

Lines changed: 45 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -495,6 +495,48 @@ const Command: React.FC<CommandProps> = observer(({ model, aliasesWithDuplicates
495495
return null
496496
}
497497

498+
const commandContent = (<div className='command-wrapper-container'>
499+
<div
500+
className={cs('command-wrapper-text', {
501+
'command-wrapper-text-group': model.hasChildren && groupId,
502+
'command-wrapper-text-group-parent': model.hasChildren && !groupId,
503+
})}
504+
onMouseEnter={() => _snapshot(true)}
505+
onMouseLeave={() => _snapshot(false)}
506+
>
507+
{groupPlaceholder}
508+
509+
{model.hasChildren && groupId && (
510+
<div className={cs('command-expander-column-group', { 'nested-group-expander': model.groupLevel })} onClick={(e) => {
511+
e.stopPropagation()
512+
model.toggleOpen()
513+
}}>
514+
<ChevronIcon className={cs('command-expander', { 'command-expander-is-open': model.hasChildren && !!model.isOpen })} />
515+
</div>
516+
)}
517+
<CommandDetails model={model} groupId={groupId} aliasesWithDuplicates={aliasesWithDuplicates} />
518+
<CommandControls model={model} commandName={commandName} />
519+
</div>
520+
{model.isCyPrompt && model.state === 'passed' && (
521+
<Button
522+
variant="indigo-dark-mode"
523+
size="20"
524+
onClick={(e) => {
525+
e.stopPropagation()
526+
events.emit('prompt:get-code', { testId: model.testId, logId: model.id })
527+
}}
528+
className="command-prompt-get-code mr-1 whitespace-nowrap"
529+
>
530+
<IconTechnologyAngleBrackets
531+
className='command-prompt-get-code-indicator pr-1'
532+
size='16'
533+
strokeColor='white'
534+
/>
535+
<span>Code</span>
536+
</Button>
537+
)}
538+
</div>)
539+
498540
return (
499541
<>
500542
<li className={cs('command', `command-name-${commandName}`)}>
@@ -511,54 +553,15 @@ const Command: React.FC<CommandProps> = observer(({ model, aliasesWithDuplicates
511553
)}
512554
>
513555
<NavColumns model={model} isPinned={_isPinned()} toggleColumnPin={_toggleColumnPin} />
514-
<FlashOnClick
556+
{appState.studioActive ? commandContent : <FlashOnClick
515557
message='Printed output to your console'
516558
onClick={_toggleColumnPin}
517559
shouldShowMessage={_shouldShowClickMessage}
518560
wrapperClassName={cs('command-pin-target', { 'command-group': !!groupId, 'command-group-no-children': !model.hasChildren && model.group })}
519561
>
520-
<div className='command-wrapper-container'>
521-
<div
522-
className={cs('command-wrapper-text', {
523-
'command-wrapper-text-group': model.hasChildren && groupId,
524-
'command-wrapper-text-group-parent': model.hasChildren && !groupId,
525-
})}
526-
onMouseEnter={() => _snapshot(true)}
527-
onMouseLeave={() => _snapshot(false)}
528-
>
529-
{groupPlaceholder}
530-
531-
{model.hasChildren && groupId && (
532-
<div className={cs('command-expander-column-group', { 'nested-group-expander': model.groupLevel })} onClick={(e) => {
533-
e.stopPropagation()
534-
model.toggleOpen()
535-
}}>
536-
<ChevronIcon className={cs('command-expander', { 'command-expander-is-open': model.hasChildren && !!model.isOpen })} />
537-
</div>
538-
)}
539-
<CommandDetails model={model} groupId={groupId} aliasesWithDuplicates={aliasesWithDuplicates} />
540-
<CommandControls model={model} commandName={commandName} />
541-
</div>
542-
{model.isCyPrompt && model.state === 'passed' && (
543-
<Button
544-
variant="indigo-dark-mode"
545-
size="20"
546-
onClick={(e) => {
547-
e.stopPropagation()
548-
events.emit('prompt:get-code', { testId: model.testId, logId: model.id })
549-
}}
550-
className="command-prompt-get-code mr-1 whitespace-nowrap"
551-
>
552-
<IconTechnologyAngleBrackets
553-
className='command-prompt-get-code-indicator pr-1'
554-
size='16'
555-
strokeColor='white'
556-
/>
557-
<span>Code</span>
558-
</Button>
559-
)}
560-
</div>
562+
{commandContent}
561563
</FlashOnClick>
564+
}
562565
</div>
563566
<Progress model={model} />
564567
{model.hasChildren && model.isOpen && (

0 commit comments

Comments
 (0)