gorgeous-forest-81700
11/23/2022, 12:39 PMfresh-doctor-14925
11/23/2022, 12:46 PMnutritious-analyst-96582
11/23/2022, 12:46 PMfresh-doctor-14925
11/23/2022, 1:00 PMgorgeous-forest-81700
11/23/2022, 1:18 PMfresh-doctor-14925
11/23/2022, 1:21 PMgorgeous-forest-81700
11/23/2022, 1:28 PMfresh-doctor-14925
11/23/2022, 1:31 PMmodern-application-38224
11/23/2022, 4:36 PMfresh-doctor-14925
11/23/2022, 6:04 PMenough-fireman-4779
11/23/2022, 6:11 PMfresh-doctor-14925
11/23/2022, 6:11 PM--spec
argument on your run commandenough-fireman-4779
11/23/2022, 6:12 PM- name: Cypress run
uses: cypress-io/github-action@v4
with:
browser: chrome
here?fresh-doctor-14925
11/23/2022, 6:14 PMpackage.json
, but I'll be honest I haven't used the cypress-provided github actionenough-fireman-4779
11/23/2022, 6:22 PMmysterious-belgium-25713
11/23/2022, 6:33 PMyaml
- name: Cypress run
uses: cypress-io/github-action@v4
with:
spec: cypress/integration/spec1.js
or
yaml
- name: Cypress run
uses: cypress-io/github-action@v4
with:
spec: |
cypress/integration/spec-a.js
cypress/**/*-b.js
enough-fireman-4779
11/23/2022, 6:56 PMthousands-angle-35788
11/23/2022, 11:01 PMexport function postRequest() {
const endpoint = '/some/path';
const url = `http://example.com${endpoint}`;
const alias = 'postRequest';
const params = {
method: 'POST',
url: url,
body: createJsonBody(),
};
cy.intercept(url).as(alias);
cy.request(params);
cy.wait(`@${alias}`);
}
I would expect this variation to work, but it doesn't intercept this request
export function postRequest() {
const endpoint = '/some/path';
const url = `http://example.com${endpoint}`;
const alias = 'postRequest';
const params = {
method: 'POST',
url: url,
body: createJsonBody(),
};
cy.intercept({ method: 'POST', url: url }).as(alias);
cy.request(params);
cy.wait(`@${alias}`);
}
I have also tried these variations, they all do not intercept the request:
cy.intercept('POST', url).as(alias);
cy.intercept('POST', endpoint).as(alias);
cy.intercept('POST', `**${endpoint}`).as(alias);
cy.intercept({ method: 'POST', path: endpoint}).as(alias);
cy.intercept({ method: 'POST', path: url}).as(alias);
cy.intercept({ method: 'POST', path: `**${endpoint}`}).as(alias);
cy.intercept(url, (req) => {
if (req.method === 'POST') {
req.alias = alias;
}
});
Also tried with a lowercase alias, since I read somewhere that was a known issue.
This GET intercept works fine (but ofcourse only on the GET):
cy.intercept('GET', endpoint).as(alias);
miniature-animal-96670
11/23/2022, 11:26 PMgreat-oil-15113
11/24/2022, 12:26 AMbitter-fountain-36713
11/24/2022, 4:04 AMpowerful-journalist-49461
11/24/2022, 8:16 AMpowerful-journalist-49461
11/24/2022, 8:24 AMmodern-application-38224
11/24/2022, 8:27 AMmodern-application-38224
11/24/2022, 8:34 AMmodern-application-38224
11/24/2022, 9:00 AMbrash-scientist-28014
11/24/2022, 9:04 AMrough-petabyte-49242
11/24/2022, 9:40 AMfresh-doctor-14925
11/24/2022, 9:53 AMbrash-scientist-28014
11/24/2022, 10:00 AM