Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 19 additions & 2 deletions packages/driver/src/cy/commands/prompt/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,14 @@ const initializeCloudCyPrompt = async (Cypress: Cypress.Cypress, cy: Cypress.Cyp
if (!Cypress.isCrossOriginSpecBridge) {
Cypress.primaryOriginCommunicator.removeAllListeners('prompt:more-info-needed')
Cypress.primaryOriginCommunicator.on('prompt:more-info-needed', ({ testId, logId, onSave, onCancel }: CyPromptMoreInfoNeededOptions) => {
window.getEventManager!().ws.emit('prompt:more-info-needed', { testId, logId, onSave, onCancel })
window.getEventManager!().localBus.emit('prompt:more-info-needed', { testId, logId, onSave, onCancel })
})

Cypress.primaryOriginCommunicator.removeAllListeners('get:source:details:for:line')
Cypress.primaryOriginCommunicator.on('get:source:details:for:line', ({ line, projectRoot }, { origin, responseEvent }) => {
const sourceDetails = $stackUtils.getSourceDetailsForFirstLine(line, projectRoot)

Cypress.primaryOriginCommunicator.toSpecBridge(origin, responseEvent, sourceDetails)
})
}

Expand All @@ -109,7 +116,17 @@ const initializeCloudCyPrompt = async (Cypress: Cypress.Cypress, cy: Cypress.Cyp
extendErrorMessages: $errUtils.extendErrorMessages,
throwErrByPath: $errUtils.throwErrByPath,
},
getSourceDetailsForFirstLine: $stackUtils.getSourceDetailsForFirstLine,
getSourceDetailsForFirstLine: (line, projectRoot) => {
if (Cypress.isCrossOriginSpecBridge) {
return Cypress.specBridgeCommunicator.toPrimaryPromise({
event: 'get:source:details:for:line',
data: { line, projectRoot },
timeout: Cypress.config().defaultCommandTimeout,
})
}

return $stackUtils.getSourceDetailsForFirstLine(line, projectRoot)
},
onMoreInfoNeeded: ({ testId, logId, onSave, onCancel }: CyPromptMoreInfoNeededOptions) => {
if (Cypress.isCrossOriginSpecBridge) {
Cypress.specBridgeCommunicator.toPrimary('prompt:more-info-needed', { testId, logId, onSave, onCancel })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export interface CyPromptOptions {
getSourceDetailsForFirstLine: (
stack: string,
projectRoot?: string
) => CyPromptStackLineDetail | undefined
) => CyPromptStackLineDetail | Promise<CyPromptStackLineDetail | undefined> | undefined
onMoreInfoNeeded: (options: CyPromptMoreInfoNeededOptions) => void
}

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
The experimentalPromptCommand experiment is currently only supported for End to End Testing and must be configured as an e2e testing type property: e2e.experimentalPromptCommand.
Copy link
Collaborator Author

@ryanthemanuel ryanthemanuel Sep 30, 2025

Choose a reason for hiding this comment

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

This is unrelated but fixing it due to another rough develop merge in feat/cy-prompt.


{
 e2e: {
 experimentalPromptCommand: true
 },
}