Skip to content
Merged
3 changes: 2 additions & 1 deletion cli/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ _Released 10/7/2025 (PENDING)_
**Features:**

- Cypress Studio is now available by default. You no longer have to set the `experimentalStudio` flag. Addresses [#30997](https://github.com/cypress-io/cypress/issues/30997). Addressed in [#32571](https://github.com/cypress-io/cypress/pull/32571).
- An option is now available to 'Hide HTTP Requests' in the Cypress Command Log. This can be found in the new dropdown menu at the top of the Command Log. Addresses [#7362](https://github.com/cypress-io/cypress/issues/7362). Addressed in [#32658](https://github.com/cypress-io/cypress/pull/32658).
- Added the `--posix-exit-codes` flag for the `run` command. When this flag is passed, Cypress will exit with 1 if any tests fail, rather than the number of failed tests. Addresses [#32605](https://github.com/cypress-io/cypress/issues/32605) and [#24695](https://github.com/cypress-io/cypress/issues/24695). Addressed in [#32609](https://github.com/cypress-io/cypress/pull/32609).
- `cy.prompt` is now a reserved Cypress command, currently gated behind a feature flag that requires an invite from Cypress. This means any custom commands named 'prompt' will no longer work. Stay tuned for updates on when this feature will become more widely available. Addresses [#31826](https://github.com/cypress-io/cypress/issues/31826).

Expand All @@ -17,7 +18,7 @@ _Released 10/7/2025 (PENDING)_

**Misc:**

- Added a dropdown menu in the Command Log that includes actions like Open in IDE and Add New Test in Studio, along with test preferences such as Auto-Scroll. Addresses [#32556](https://github.com/cypress-io/cypress/issues/32556) and [#32558](https://github.com/cypress-io/cypress/issues/32558). Addressed in [#32611](https://github.com/cypress-io/cypress/pull/32611).
- Added a dropdown menu in the Command Log that includes actions like Open in IDE and Add New Test in Studio, along with test preferences such as Auto-Scroll and Hide HTTP Requests. Addresses [#32556](https://github.com/cypress-io/cypress/issues/32556) and [#32558](https://github.com/cypress-io/cypress/issues/32558). Addressed in [#32611](https://github.com/cypress-io/cypress/pull/32611).
- Updated the Studio test editing header to include a Back button. This change ensures the Specs button remains functional for expanding or collapsing the specs panel. Addresses [#32556](https://github.com/cypress-io/cypress/issues/32556) and [#32558](https://github.com/cypress-io/cypress/issues/32558). Addressed in [#32611](https://github.com/cypress-io/cypress/pull/32611).
- Fixed the Studio panel resizing when dragging. Addressed in [#32584](https://github.com/cypress-io/cypress/pull/32584).
- The Next button now maintains consistent visibility during stepping sessions when using `cy.pause`, staying visible but disabled when no immediate next command is available, providing clear visual feedback to users about stepping state. Addresses [#32476](https://github.com/cypress-io/cypress/issues/32476). Addressed in [#32536](https://github.com/cypress-io/cypress/pull/32536).
Expand Down
1 change: 1 addition & 0 deletions packages/app/src/navigation/SidebarNavigation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ fragment SidebarNavigation_Settings on Query {
isSideNavigationOpen
isSpecsListOpen
autoScrollingEnabled
showFetchRequests
reporterWidth
specListWidth
}
Expand Down
4 changes: 4 additions & 0 deletions packages/app/src/runner/SpecRunnerOpenMode.vue
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ fragment SpecRunner_Preferences on Query {
isSideNavigationOpen
isSpecsListOpen
autoScrollingEnabled
showFetchRequests
reporterWidth
specListWidth
studioWidth
Expand Down Expand Up @@ -355,6 +356,8 @@ onMounted(() => {

preferences.update('autoScrollingEnabled', props.gql.localSettings.preferences.autoScrollingEnabled ?? true)

preferences.update('showFetchRequests', props.gql.localSettings.preferences.showFetchRequests ?? true)

// if the CYPRESS_NO_COMMAND_LOG environment variable is set,
// don't use the widths or the open status of specs list from GraphQL
if (!hideCommandLog) {
Expand Down Expand Up @@ -437,6 +440,7 @@ onMounted(() => {
eventManager.on('save:app:state', (state) => {
preferences.update('isSpecsListOpen', state.isSpecsListOpen)
preferences.update('autoScrollingEnabled', state.autoScrollingEnabled)
preferences.update('showFetchRequests', state.showFetchRequests)
})
})

Expand Down
1 change: 1 addition & 0 deletions packages/app/src/runner/event-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -883,6 +883,7 @@ export class EventManager {
numPending: runState.pending,
autoScrollingEnabled: runState.autoScrollingEnabled,
isSpecsListOpen: runState.isSpecsListOpen,
showFetchRequests: runState.showFetchRequests,
scrollTop: runState.scrollTop,
studioActive: hasActiveStudio,
studioSingleTestActive,
Expand Down
1 change: 1 addition & 0 deletions packages/app/src/runner/reporter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ function renderReporter (
runner: eventManager.reporterBus,
autoScrollingEnabled: runnerUiStore.autoScrollingEnabled,
isSpecsListOpen: runnerUiStore.isSpecsListOpen,
showFetchRequests: runnerUiStore.showFetchRequests,
error: null,
resetStatsOnSpecChange: true,
// Studio can only be enabled for e2e testing
Expand Down
2 changes: 2 additions & 0 deletions packages/app/src/store/runner-ui-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export interface RunnerUiState {
showChooseExternalEditorModal: boolean
autoScrollingEnabled: boolean
isSpecsListOpen: boolean
showFetchRequests: boolean
specListWidth: number
reporterWidth: number
studioWidth: number
Expand All @@ -39,6 +40,7 @@ export const useRunnerUiStore = defineStore({
showChooseExternalEditorModal: false,
autoScrollingEnabled: true,
isSpecsListOpen: false,
showFetchRequests: true,
specListWidth: runnerConstants.defaultSpecListWidth,
reporterWidth: runnerConstants.defaultReporterWidth,
studioWidth: runnerConstants.defaultStudioWidth,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export const LocalSettingsPreferences = objectType({
t.boolean('autoScrollingEnabled')
t.string('preferredEditorBinary')
t.boolean('isSpecsListOpen')
t.boolean('showFetchRequests')
t.int('reporterWidth')
t.int('specListWidth')
t.int('studioWidth')
Expand Down
1 change: 1 addition & 0 deletions packages/data-context/schemas/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -1421,6 +1421,7 @@ type LocalSettingsPreferences {
Determine if the browser should launch when the browser flag is passed alone
"""
shouldLaunchBrowserFromOpenBrowser: Boolean
showFetchRequests: Boolean
specListWidth: Int
studioWidth: Int
wasBrowserSetInCLI: Boolean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ export function makeClientTestContext (): ClientTestContext {
__typename: 'LocalSettingsPreferences',
autoScrollingEnabled: true,
isSideNavigationOpen: false,
showFetchRequests: true,
desktopNotificationsEnabled: false,
dismissNotificationBannerUntil: null,
},
Expand Down
55 changes: 55 additions & 0 deletions packages/reporter/cypress/e2e/commands.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1087,4 +1087,59 @@ describe('commands', { viewportHeight: 1000 }, () => {
cy.percySnapshot()
})
})

context('show fetch requests', () => {
it('toggles visibility of fetch requests', () => {
addCommand(runner, {
name: 'visit',
renderProps: {
message: 'visit https://example.com',
},
})

// Add fetch/request commands (event: true means it's a network request)
Array.from({ length: 3 }).forEach((_, index) => {
addCommand(runner, {
name: 'request',
event: true,
renderProps: {
indicator: 'successful',
wentToOrigin: true,
message: `GET /api/data/${index + 1}`,
},
})
})

cy.get('.command-name-visit').should('have.length', 2)
cy.contains('visit https://example.com').should('be.visible')

cy.get('.command-name-request').should('have.length', 3)
cy.contains('GET /api/data/1').should('be.visible')

cy.window().its('state.showFetchRequests').should('be.true')

cy.get('[data-cy="runnable-options-button"]').click()
cy.get('[data-cy="more-options-runnable-popover"]').should('be.visible')

cy.window().its('state.showFetchRequests').should('be.true')

cy.get('[data-cy="show-http-requests-switch"]').click()

cy.window().its('state.showFetchRequests').should('be.false')

cy.get('.command-name-request').should('not.exist')

// This one has event = true, so it should be visible
cy.contains('(xhr stub)GET --- /posts')

cy.get('.command-name-visit').should('exist')

cy.get('[data-cy="show-http-requests-switch"]').click()

cy.window().its('state.showFetchRequests').should('be.true')

cy.get('.command-name-request').should('have.length', 3)
cy.contains('GET /api/data/1').should('be.visible')
})
})
})
22 changes: 22 additions & 0 deletions packages/reporter/cypress/e2e/header.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,28 @@ describe('header', () => {
cy.percySnapshot()
})

it('shows when show fetch requests is enabled and can disable it', () => {
const switchSelector = '[data-cy=show-http-requests-switch]'

cy.get('[data-cy="runnable-options-button"]').click()
cy.get('[data-cy="more-options-runnable-popover"]').should('be.visible')

cy.get(switchSelector).invoke('attr', 'aria-checked').should('eq', 'true')
cy.get(switchSelector).click()
cy.get(switchSelector).invoke('attr', 'aria-checked').should('eq', 'false')
})

it('the show fetch requests toggle emits save:state event when clicked', () => {
cy.spy(runner, 'emit')

cy.get('[data-cy="runnable-options-button"]').click()
cy.get('[data-cy="more-options-runnable-popover"]').should('be.visible')

cy.get('[data-cy=show-http-requests-switch]').click()
cy.wrap(runner.emit).should('be.calledWith', 'save:state')
cy.percySnapshot()
})

it('opens the open in IDE button', () => {
cy.spy(runner, 'emit')

Expand Down
9 changes: 9 additions & 0 deletions packages/reporter/cypress/e2e/unit/app_state.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,15 @@ describe('app state', () => {
})
})

context('#setShowFetchRequests', () => {
it('sets showFetchRequests', () => {
const instance = new AppState()

instance.setShowFetchRequests(true)
expect(instance.showFetchRequests).to.eq(true)
})
})

context('#reset', () => {
it('resets autoScrollingEnabled when it has not been toggled', () => {
const instance = new AppState()
Expand Down
2 changes: 2 additions & 0 deletions packages/reporter/cypress/e2e/unit/events.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -354,10 +354,12 @@ describe('events', () => {
it('emits save:state on save:state', () => {
appState.autoScrollingUserPref = false
appState.isSpecsListOpen = true
appState.showFetchRequests = false
events.emit('save:state')
expect(runner.emit).to.have.been.calledWith('save:state', {
autoScrollingEnabled: false,
isSpecsListOpen: true,
showFetchRequests: false,
})
})

Expand Down
4 changes: 4 additions & 0 deletions packages/reporter/src/commands/command.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,10 @@ const Command: React.FC<CommandProps> = observer(({ model, aliasesWithDuplicates
}
}

if (model.name === 'request' && model.event && !appState.showFetchRequests) {
return null
}
Copy link

Choose a reason for hiding this comment

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

Bug: Fetch Request Filtering Excludes Non-'Request' Commands

The command filtering intended to hide fetch requests only applies to commands named 'request'. This causes commands from cy.intercept(), which have different names, to remain visible even when fetch requests are hidden.

Fix in Cursor Fix in Web


return (
<>
<li className={cs('command', `command-name-${commandName}`)}>
Expand Down
10 changes: 10 additions & 0 deletions packages/reporter/src/lib/app-state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ class AppState {
pinnedSnapshotId = defaults.pinnedSnapshotId
studioActive = defaults.studioActive
studioSingleTestActive = defaults.studioSingleTestActive
showFetchRequests = true
isStopped = false
hasBeenPaused = defaults.hasBeenPaused
_resetAutoScrollingEnabledTo = true;
Expand All @@ -49,6 +50,7 @@ class AppState {
pinnedSnapshotId: observable,
studioActive: observable,
studioSingleTestActive: observable,
showFetchRequests: observable,
hasBeenPaused: observable,
})
}
Expand Down Expand Up @@ -132,6 +134,14 @@ class AppState {
this.studioSingleTestActive = studioSingleTestActive
}

toggleShowFetchRequests () {
this.showFetchRequests = !this.showFetchRequests
}

setShowFetchRequests (showFetchRequests: boolean) {
this.showFetchRequests = showFetchRequests
}

reset () {
_.each(defaults, (value: any, key: string) => {
this[key] = value
Expand Down
1 change: 1 addition & 0 deletions packages/reporter/src/lib/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ const events: Events = {
// the "autoScrollingEnabled" key in `savedState` stores to the preference value itself, it is not the same as the "autoScrollingEnabled" variable stored in application state, which can be temporarily deactivated
autoScrollingEnabled: appState.autoScrollingUserPref,
isSpecsListOpen: appState.isSpecsListOpen,
showFetchRequests: appState.showFetchRequests,
})
})

Expand Down
7 changes: 6 additions & 1 deletion packages/reporter/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export interface BaseReporterProps {
statsStore: StatsStore
autoScrollingEnabled?: boolean
isSpecsListOpen?: boolean
showFetchRequests?: boolean
events: Events
error?: RunnablesErrorModel
resetStatsOnSpecChange?: boolean
Expand All @@ -49,7 +50,7 @@ export interface SingleReporterProps extends BaseReporterProps {
}

// In React Class components (now deprecated), we used to use appState as a default prop. Now since defaultProps are not supported in functional components, we can use ES6 default params to accomplish the same thing
const Reporter: React.FC<SingleReporterProps> = observer(({ appState = appStateDefault, runner, className, error, runMode = 'single', studioEnabled, autoScrollingEnabled, isSpecsListOpen, resetStatsOnSpecChange, renderReporterHeader = (props: ReporterHeaderProps) => <Header {...props} />, runnerStore }) => {
const Reporter: React.FC<SingleReporterProps> = observer(({ appState = appStateDefault, runner, className, error, runMode = 'single', studioEnabled, autoScrollingEnabled, isSpecsListOpen, showFetchRequests, resetStatsOnSpecChange, renderReporterHeader = (props: ReporterHeaderProps) => <Header {...props} />, runnerStore }) => {
const previousSpecRunId = usePrevious(runnerStore.specRunId)
const [isMounted, setIsMounted] = useState(false)
const [isInitialized, setIsInitialized] = useState(false)
Expand Down Expand Up @@ -81,6 +82,10 @@ const Reporter: React.FC<SingleReporterProps> = observer(({ appState = appStateD
appState.setSpecsList(isSpecsListOpen ?? false)
})()

action('set:show:fetch:requests', () => {
appState.setShowFetchRequests(showFetchRequests ?? true)
})()

shortcuts.start()
runnablesStore.setRunningSpec(runnerStore.spec.relative)
// we need to know when the test is mounted for our reporter tests. see
Expand Down
17 changes: 8 additions & 9 deletions packages/reporter/src/runnables/runnable-popover-options.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,10 @@ export const RunnablePopoverOptions: React.FC<Props> = observer(({
events.emit('save:state')
}

// TODO: to be implemented
// const toggleShowHttpRequests = () => {}
const toggleShowFetchRequests = () => {
appState.toggleShowFetchRequests()
events.emit('save:state')
}

// Close popover when clicking outside
useEffect(() => {
Expand Down Expand Up @@ -135,20 +137,18 @@ export const RunnablePopoverOptions: React.FC<Props> = observer(({
<div className="runnable-popover-section">
<div className="runnable-popover-section-title">Testing preferences</div>

{/* // TODO: to be implemented */}
{/* <div className="runnable-popover-item-with-toggle">
<div className="runnable-popover-item-with-toggle">
<div className="runnable-popover-item-with-toggle-content">
<div className="runnable-popover-item-text">
<span className="runnable-popover-item-label">Show HTTP requests</span>
</div>
<Switch
data-cy="show-http-requests-switch"
value={false}

onUpdate={action('toggle:show:http:requests', toggleShowHttpRequests)}
value={appState.showFetchRequests}
onUpdate={action('toggle:show:http:requests', toggleShowFetchRequests)}
/>
</div>
</div> */}
</div>

<div className="runnable-popover-item-with-toggle">
<div className="runnable-popover-item-with-toggle-content">
Expand All @@ -158,7 +158,6 @@ export const RunnablePopoverOptions: React.FC<Props> = observer(({
<Switch
data-cy="auto-scroll-switch"
value={appState.autoScrollingUserPref}

onUpdate={action('toggle:auto:scrolling', toggleAutoScrollingUserPref)}
/>
</div>
Expand Down
1 change: 1 addition & 0 deletions packages/types/src/driver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ interface MochaRunnerState {

export type RunState = MochaRunnerState & ReporterRunState & {
isSpecsListOpen?: boolean
showFetchRequests?: boolean
}

export interface Emissions {
Expand Down
3 changes: 3 additions & 0 deletions packages/types/src/preferences.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export type NotifyWhenRunCompletes = typeof NotifyCompletionStatuses[number]
export const defaultPreferences: AllowedState = {
autoScrollingEnabled: true,
isSpecsListOpen: false,
showFetchRequests: true,
isSideNavigationOpen: true,
desktopNotificationsEnabled: null,
notifyWhenRunStarts: false,
Expand Down Expand Up @@ -35,6 +36,7 @@ export const allowedKeys: Readonly<Array<keyof AllowedState>> = [
'showedStudioModal',
'preferredOpener',
'isSpecsListOpen',
'showFetchRequests',
'firstOpened',
'lastOpened',
'lastProjectId',
Expand Down Expand Up @@ -62,6 +64,7 @@ export type AllowedState = Partial<{
appX: Maybe<number>
appY: Maybe<number>
isSpecsListOpen: Maybe<boolean>
showFetchRequests: Maybe<boolean>
autoScrollingEnabled: Maybe<boolean>
banners: Maybe<BannersState>
browserWidth: Maybe<number>
Expand Down
1 change: 1 addition & 0 deletions packages/types/src/reporter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ export interface ReporterStartInfo extends StatsStoreStartInfo {
scrollTop: number
studioActive: boolean
studioSingleTestActive: boolean
showFetchRequests: boolean
}
Loading