-
Notifications
You must be signed in to change notification settings - Fork 120
Open
Description
Hey, seems I can't find these for the preprocessor, might be me who can't search properly.
Basically I would like to be able to do some tracability for my tests when they are running against the backend, where I would like to attach the feature name and scenario name in the headers of cy.request (the BeforeStep is mostly for completeness).
So I'd like to be able to do:
let featureName: string = ""
let scenarioName: string = ""
BeforeFeature((event, callback) => {
featureName = event.getPayloadItem('feature')
})
// similar for Scenario
Cypress.Commands.overwrite('request', function(originalFn, ...restParameters) {
if (restParameters.length === 1) {
restParameters[0].headers['x-correlation-id'] = `accept-test-${featureName}-${scenarioName}`
}
return originalFn.apply(this, restParameters)
})Metadata
Metadata
Assignees
Labels
No labels