cy.xpath('some xpath').then(($btn)=>{const text = $btn.text()})
I am currently using like this but i can use the text only inside .then() so i have problem of calling it outside . Please tell me how to get the text and store in a variable. e.g. var text= cy.xpath('some xpath') like this so that i can use it anywhere in inside the code.