Test HTML Tables Using cy.table Query Command

1 · Gleb Bahmutov · Jan. 21, 2023, 4:37 p.m.
Imagine you have a table like this one:How would you confirm in your Cypress tests the table is showing the right values? Let's start with the column headings. Can you confirm the columns in order show the names, the dates, and the ages?cypress/e2e/table.cy.js123456789101112beforeEach(() => { cy.visit('app/table.html')})it('confirms the headings (plain cy)', () => { // can you confirm the table has the following headings? const headings = ['Name', 'Date (YYYY-MM-DD)', 'Age'] cy.get('table th...