You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 6, 2025. It is now read-only.
This is related to issue --> how to read table header and do assertion? #511
I have few other tables on the UI to verify the headers, all th rows data test id starts with cl-table-header-column , which means when i run my tests the test assertion will fail as it will locate multiple tables, which is why i want to filter by table name await this.screen.findAllByTestId('table-header-GroupCode') and verify the header. Please let me know if there is a way.
Can you please advise me if there is any other way to verify the headers of all the tables without erroring out? as cl-table-header-column is the start of the test id in all the tables.
Attached is the screenshot.
Code that is suggested in the ticket #511
This is for Group code table:
test('should handle the findAllBy* methods with test ID RegExp', async ({screen}) => {
const header = await screen.findAllByTestId(/cl-table-header-column.*/, undefined, {
timeout: 3000,
})
How the same can be achieved using playwright testing library with the tr[data-testid='table-header-GroupCode'] th span?
After finding using findByTestId--> [data-testid='table-header-GroupCode'] , Can we traverse to "th" or "span" element using playwright testing library? Can you please advise?