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
This is related to #517
First of all, thank you for your explanation in the tickets and it helps us to understand better.
and I totally understand that the playwright testing library is not supposed to be using anything like css selector and the intention of library is closely to mimic how user interacts.
All I am trying now is to achieve the below scenario using playwright testing library
would like to filter by table name test id like below, then search text - LINEHOLDER, and once text is found, click the corresponding checkbox in the same row, Can you please advise how to achieve that? will be much helpful.
I have gone thru the documentation, am unable to find anything closer. I would really to like to use testing library in my framework, Can you please help me with the example code to achieve this scenario that helps me to better understand and follow the documentation better?
test('should access checkbox in the same row', async ({screen}) => {
const table = await screen.findByTestId('editable-nested-table-GroupCode')
const lineholderText = within(table).getByText(/LINEHOLDER*/). ---> this is going to return only LINEHOLDER - td, but how to traverse through the - td element (checkbox) in the same row - tr where LINEHOLDER text is found?
after lineholder test if found, how to access the checkbox please?
const checkbox = ???.getByRole(checkbox)
checkbox.click();
})
Can you please provide me the example to achieve this? would be really helpful and would love to use testing library across all our projects, as it the first time trying to use this for this specific scenario, your example will be much more helpful.
Again to be clear, I am not asking anything like CSS selector, I am only interested to achieve this scenario using testing library. i have to search text and perform click the same row, in other 6 tables. Your example will be so much beneficial. Thank you for all the help and guidance!
The text was updated successfully, but these errors were encountered:
This is related to #517
First of all, thank you for your explanation in the tickets and it helps us to understand better.
and I totally understand that the playwright testing library is not supposed to be using anything like css selector and the intention of library is closely to mimic how user interacts.
All I am trying now is to achieve the below scenario using playwright testing library
would like to filter by table name test id like below, then search text - LINEHOLDER, and once text is found, click the corresponding checkbox in the same row, Can you please advise how to achieve that? will be much helpful.
I have gone thru the documentation, am unable to find anything closer. I would really to like to use testing library in my framework, Can you please help me with the example code to achieve this scenario that helps me to better understand and follow the documentation better?
test('should access checkbox in the same row', async ({screen}) => {
const table = await screen.findByTestId('editable-nested-table-GroupCode')
const lineholderText = within(table).getByText(/LINEHOLDER*/). ---> this is going to return only LINEHOLDER - td, but how to traverse through the - td element (checkbox) in the same row - tr where LINEHOLDER text is found?
after lineholder test if found, how to access the checkbox please?
const checkbox = ???.getByRole(checkbox)
checkbox.click();
})
Can you please provide me the example to achieve this? would be really helpful and would love to use testing library across all our projects, as it the first time trying to use this for this specific scenario, your example will be much more helpful.
Again to be clear, I am not asking anything like CSS selector, I am only interested to achieve this scenario using testing library. i have to search text and perform click the same row, in other 6 tables. Your example will be so much beneficial. Thank you for all the help and guidance!
The text was updated successfully, but these errors were encountered: