To find the row that has "Covid" in the second column, use td:nth-child(2):contains("Covid")
.
To illustrate, here's a similar test on the Material Angular examples page.
it('get last column of a row with particular value in Name column', () => {
cy.visit('https://material.angular.io/components/table/examples');
cy.get('table-basic-example').within(() => {
cy.get('tr:has( td:nth-child(2):contains("Lithium") )')
.find('td:last')
.should('have.text', ' Li ')
})
})
You have more than one Category with "Covid", so I recommend adding :first
as well,
cy.get('tr:has( td:nth-child(2):contains("Covid"):first )')
.find('td:last')
.click()