Complete the code to assert the request method is GET.
cy.intercept('/api/data').as('getData'); cy.wait('@getData').its('request.method').should('[1]', 'GET');
The should('eq', 'GET') assertion checks that the request method equals 'GET'.
Complete the code to assert the response status code is 200.
cy.intercept('/api/data').as('getData'); cy.wait('@getData').its('response.statusCode').should('[1]', 200);
The should('eq', 200) assertion checks that the response status code equals 200.
Fix the error in the code to assert the request URL includes '/api/data'.
cy.intercept('/api/data').as('getData'); cy.wait('@getData').its('request.url').should('[1]', '/api/data');
The correct Cypress assertion to check if a string includes a substring is should('include', substring).
Fill both blanks to assert the request headers contain 'content-type' and its value is 'application/json'.
cy.intercept('/api/data').as('getData'); cy.wait('@getData').its('request.headers.[1]').should('[2]', 'application/json');
The header key is 'content-type' and the assertion to check equality is should('eq', value).
Fill all three blanks to assert the response body has a property 'success' that is true.
cy.intercept('/api/data').as('getData'); cy.wait('@getData').its('response.body.[1]').should('[2]', [3]);
We check the 'success' property with should('be', true) to assert it is true.