await screen.findByTestId('Edit Group Codes').click();;
TypeError: screen.findByTestId(...).click is not a function
await screen.findByTestId('Edit Group Codes').click();;
Since we now use the locator API, Can you please advise why click() function is still not resolved?
We expect playwright testing library to behave something like how playwright behaves. click() function after locator is found like below.
-----> await page.locator('input#password').click()
Code that worked - Only increases no of lines in the test and assigning to a variable before performing click() action does not let a user to interact like how playwright allows as above, so the code would be less maintainable and not user friendly.
const form = await screen.findByTestId('Edit Group Codes');
await form.click();
Do you have any plan to let findByTestId behave the same way like how playwright official library behaves to perform click action in a single line like this await page.locator('input#password').click() ?
Example: Cypress example using playwright testing library, We expected something like this.
cy.findByTestId('menu-option-dashboard-link').click().wait(1000);