在 Cypress.io 的测试中,在应用筛选器后检查表格中显示的“数据”时,它会抛出“CypressError:Timed out retrying:Cannot read property 'eq' of undefined”的错误。 请问有人可以建议如何修复以下测试中的问题吗? 表HTML图像如下所示。
describe('Filter Test', function() {
it.only('Check if the records are filtered successfully', function() {
cy.visit('http://www.seleniumeasy.com/test/table-search-filter-demo.html')
cy.get('button').contains('Filter').click()
cy.get('input[placeholder="Username"]').type('jacobs')
cy.get('table').should(($tr) => {
const $tds = $tr.find('td') // find all the tds
expect($tds.cells.eq(0)).to.contain('jacobs')
})
})
})
console.log($tds)
来查看它是否包含cells
对象吗? - DarknessZX