Im generating ids and then using id to cy.visit them , I wanna assert the generated id using cy.url().split('/') but I can not , Split works only for strings and cy.url() returns Chainable<string> , any other ways to do that ?
Im generating ids and then using id to cy.visit them , I wanna assert the generated id using cy.url().split('/') but I can not , Split works only for strings and cy.url() returns Chainable<string> , any other ways to do that ?
This should work. Swap out 0 for whatever index you need.
cy.url().then(url => {
cy.log(url.split('/')[0])
});