I am struggling to figure out how to extract a specific portion of a key from both the URL and the xhr response. I initially attempted using the URI method but couldn't specify to save only part of the value.
.url().then(($url) => {
const moveKey = $url.text(/someString.+?(?=\/)/);
cy.log(moveKey);
})
Another approach I tried involved using cy.route
along with cy.wait
, but unfortunately, the wait consistently times out.
cy.server()
.route('/overview').as('getMove')
.wait('@getMove').then((xhr) => {
const moveKey = xhr.move.key;
})
URL: