0 votes
in Programming by (400 points)

I have a table with multiple rows and columns, e.g.:

user1@gmail.com | sometext | link (button)
user2@gmail.com | sometext | link (button)

I want to find user2@gmail.com in the table and in that row I need to click the link.

I tried it this way:

  cy.get('table tbody > tr').contains('user2@gmail.com').each(($el, index, $list) => {

        $el.find('button');
        cy.wrap($el).click();

    });

The user is found in the table, that's ok, but it is trying to click that user and not the button, seems the $el.find('button') is ignored.

can you please help how to achieve this?

Please log in or register to answer this question.

...