我在每个之前添加了一个夹具,现在我需要获取我在测试脚本中添加的相同夹具文件的更新结果。这在赛普拉斯可能吗?如果赛普拉斯可能出现这种情况,谁能告诉我如何正确地做到这一点?
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');
});
});
});
在上面的场景中,首先我在每个之前添加了(“style_file_sub_task_status.json”)fixture,现在我需要获得在测试脚本中添加的相同路由和相同 fixture(“style_file_sub_task_status_already_approved.json”)的更新结果