Skip to content

Commit a7b4733

Browse files
Updated test to validate response handler in interceptApi command
1 parent 85ee9c4 commit a7b4733

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

cypress/e2e/ui/validate-intercept-api-command.cy.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,15 @@ describe('Validate intercept command', () => {
88
cy.menu('Settings', 'Application Settings');
99
});
1010

11-
it('Should register the alias, intercept & wait when API fired', () => {
11+
it('Should register the alias, intercept, wait & validate response status code when an API is fired', () => {
1212
cy.accordion('Diagnostics');
1313
cy.interceptApi({
1414
alias: 'treeSelectApi',
1515
urlPattern: /\/ops\/tree_select\?id=.*&text=.*/,
1616
triggerFn: () => cy.selectAccordionItem([/^ManageIQ Region:/, /^Zone:/]),
17+
onApiResponse: (interception) => {
18+
expect(interception.response.statusCode).to.equal(200);
19+
},
1720
}).then(() => {
1821
// verifies that the alias is set and the request is intercepted & awaited
1922
cy.getInterceptedApiAliases().then((interceptedAliasesObject) => {

0 commit comments

Comments
 (0)