I added one fixture in before each and now I need to get the updated results of the same fixture file which I added in the test script. Is this possible in Cypress? Could anyone tell me that how to do it properly If this kind of scenario is possible in Cypress?
context('Style File', () => {
describe('Style File - Account Manager', () => {
beforeEach(() => {
cy.intercept("GET", "**/api/inquiries/*/style_file_sub_task_status", {
fixture: "style_file_sub_task_status.json"
}).as('getStyleFileSubTaskStatus');
});
it('Sub task Un-Approving', function () {
cy.intercept("GET", "**/api/inquiries/*/style_file_sub_task_status", {
fixture: "style_file_sub_task_status_already_approved.json"
}).as('getStyleFileSubTaskStatus');
cy.xpath('(//span[normalize-space()=\'Approved tech pack\'])[1]')
.click();
cy.get('#status').click();
cy.findByText("Approved tech pack sub task status updated successfully")
.should('be.visible');
});
});
});
In the above scenario first I added ("style_file_sub_task_status.json") fixture in the before each and now I need to get an updated result of the same route and same fixture ("style_file_sub_task_status_already_approved.json") added in the test script