Skip to content
Discussion options

You must be logged in to vote

In order to use the this keyword, you'll have to use function() {...} callbacks. The docs explain more about it.

describe("tests", () => {
    beforeEach("beforeach", () => {
        cy.visit("https://www.google.com/");
        cy.wrap("one").as("miNumero");
    });

    it("test 1", function() {
        expect(this.miNumero).to.equal("one");
    });
});

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@jgonzalezalbisu
Comment options

Answer selected by jgonzalezalbisu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants