I am trying to set some variables based on the results of a cy.exec() command for use later in the script. For example:
cy.exec('some command').then((result) => { let json = JSON.parse(result.stdout) this.foo = json.foo }) How can I wait for this.foo to be defined before proceeding with the rest of the script? I tried:
cy.exec('some command').as('results') cy.wait('@results') However this.results is undefined after the cy.wait() command.