How to reuse yielded value later in the test
问题 Context: I have an element with innerText in Page1 and another element with innerText on Page 2. And I need to compare these two values in Page 3. So I need to find a way to save these values in a variable globally so that they can be used later. Things I tried: Trial 1: Didn't work as page1value scope is limited to the cy.get() cy.get('#selector').invoke('text').then(text => { const page1value = text }) Trial 2: Didn't work as whenever I try to print the value outside, it comes as undefined