Is there a simple way to test API calls and test the response of that calls? For now we do stuck at a simple xml response from within the reponse itself. We like to use xpath (cypress plugin) to crawl the xml like:
cy.request(`${DOCUMENT_FACADE}`).then((response) => {
//response is a valid JSON and its body property holds a string (xml)
cy.get(response.body).xpath("//*[name() = 'myName']") //this fails by "Not a DOM Object"
//Then we tried to give it a DOM object
var parser = new DOMParser(),
doc = parser.parseFromString(response.body, 'text/xml');
cy.get(doc).xpath("//*[name() = 'myName']").should('have.length', 1) //fails with "expected undefined to have a length of 1 but got 0
});
Maybe we totally got something wrong about this quite important part of testing I assume.