Const
test("Search for query", async ({ page, state }) => {
const googlePOM = new GooglePOM(page);
state.searchQuery = {name: "searchQuery", value: "Cute cat memes" };
await page.goto("https://google.com");
await googlePOM.searchFor(state.searchQuery.value);
await expect(googlePOM.searchBox).toContainText(state.searchQuery.value);
});
A Playwright test fixture that includes a Rewright stateful object.
When implementing Rewright into your Playwright project, you should use this fixture as your base fixture and build off of it.