This thread is trying to answer question "How can I modify the default `page.goto()` method to automatically append query parameters to all calls to `page.goto()` in my tests?"
@skorp32 can you please elaborate?
I've tried the following:
const test = base.extend({
page: async ({ page }, use) => {
const goto = page.goto;
async function modifiedGoto(url, options) {
url += "?test";
return goto(url, options);
}
page.goto = modifiedGoto;
await use(page);
},
});
but it is returning the following error:
TypeError: Cannot read properties of undefined (reading '_mainFrame')
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].