Skip to content

Commit 38ae581

Browse files
committed
tmp
1 parent 21e3cf2 commit 38ae581

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

Plugins/PackageToJS/Templates/bin/test.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ Hint: This typically means that a continuation leak occurred.
9696
},
9797
browser: async ({ preludeScript }) => {
9898
const onPageLoad = (page) => {
99+
console.log("===> onPageLoad")
99100
page.exposeFunction("expectToBeTrue", () => {
100101
return true;
101102
});

Plugins/PackageToJS/Templates/test.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,16 @@ Please run the following command to install it:
100100
const context = await browser.newContext();
101101
const page = await context.newPage();
102102
// Allow the user to customize the page before it's loaded, for defining custom export functions
103-
if (options.playwright?.onPageLoad) { await options.playwright.onPageLoad(page); }
103+
if (options.playwright?.onPageLoad) {
104+
console.log("===> onPageLoad 2")
105+
await options.playwright.onPageLoad(page);
106+
}
104107

108+
// Forward console messages in the page to the Node.js console
109+
page.on("console", (message) => {
110+
console.log(message.text());
111+
});
112+
105113
const onExit = new Promise((resolve) => {
106114
page.exposeFunction("exitTest", resolve);
107115
});

0 commit comments

Comments
 (0)