最佳答案
比这更容易。
您可以使用 <tr>
找到正确的行( <td>
不是 .contains()
) .
然后找到 <a>
在该行内
cy.contains('tr', 'Joei Smithi') // whichever bit of text id's them,
// but specify 'tr' as the element
// Checks all the row children, but returns the row
.find('a') // Now find() looks only in that row, and any depth
.click() // hit it
关于cypress - 如何在表格网格中查找按钮元素,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69444828/