https://cypress.io logo
Cannot intercept two similar requests
# i-need-help
r
I'm not sure why, but routeMatcher is not working with this url (rest/orders/?filter{created_at.gte}=2023-02-21T04:00:00.000-08:00). I'm intercepting two routes that have different params:
Copy code
cy.intercept({
        pathname: '/rest/orders/',
        query: {
          'filter{created_at.gte}': `${end.minus({ days: 14 }).toISO()}`,
        },
      }, { fixture: 'transformed-orders-primary-reports' });

      cy.intercept({
        pathname: '/rest/orders/',
        query: {
          'filter{created_at.gte}': `${end.minus({ days: 28 }).toISO()}`,
        },
      } ,{ fixture: 'transformed-orders-secondary-reports' });
     });
Regex is also not working:
Copy code
cy.intercept('/rest\/orders\/\?filter{created_at.gte}=2023-02-19T/', { fixture: 'transformed-orders-primary-reports'});
      cy.intercept('/rest\/orders\/\?filter{created_at.gte}=2023-02-05T/', { fixture: 'transformed-orders-secondary-reports'});