Is there a much nicer way to do this in PlayWright please? So far my two options appear to be:
await Expect(Page.Locator("li")).ToContainTextAsync("Invalid login attempt"); await Expect(Page.GetByText("Invalid login attempt")).ToContainTextAsync("Invalid login attempt");
Can we combine the GetByText somehow with the assertion? Thanks ๐
This thread is trying to answer question "Is there a more elegant way to get an element by its text and assert by the same text in Playwright?"
Rayrun is a community for QA engineers. I am constantly looking for new ways to add value to people learning Playwright and other browser automation frameworks. If you have feedback, email [email protected].