File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change 33/**
44 * Custom command to get the intercepted API aliases stored in Cypress environment variables.
55 * This command returns the object containing all registered API interception aliases.
6- *
6+ *
77 * @returns {Object } An object where keys are in format method-alias(e.g. post-myApiAlias) and values are typically the same alias names
88 * @example
99 * cy.getInterceptedApiAliases().then((aliases) => {
@@ -127,14 +127,12 @@ Cypress.Commands.add(
127127 /* ======================================================= */
128128
129129 // Check if this request is already registered
130- cy . getInterceptedApiAliases ( ) . then ( ( interceptedAliasesMap ) => {
130+ return cy . getInterceptedApiAliases ( ) . then ( ( interceptedAliasesMap ) => {
131131 const aliasObjectKey = `${ method . toLowerCase ( ) } -${ alias } ` ;
132132 // Check if this request is already registered
133133 const isAlreadyRegistered = ! ! interceptedAliasesMap [ aliasObjectKey ] ;
134134 // Setting wasRequestIntercepted flag to false initially
135- if ( waitOnlyIfRequestIntercepted ) {
136- setRequestIntercepted ( false ) ;
137- }
135+ setRequestIntercepted ( false ) ;
138136 // Register the intercept if not already done
139137 if ( ! isAlreadyRegistered ) {
140138 cy . intercept ( method , urlPattern , ( req ) => {
You can’t perform that action at this time.
0 commit comments