0

For automated testing, I'm attempting to incorporate Playwright into my electron-vue project. I run the test, and Page.title() returns "". Here is the code:

test("renders the screen splash", async () => {
  let page: Page;
  page = await electronApp.firstWindow();
  console.log("Title: ", await page.title());
  const title = await page.title()
  expect(title).toBe('Splash')
});
Nikhil
  • 181
  • 1
  • 15

1 Answers1

1

Could you try if it helps?

    test("renders the screen splash", async () => {
      let page: Page;
      page = await electronApp.firstWindow();
      // add the following line
      await page.waitForLoadState();
      console.log("Title: ", await page.title());
      const title = await page.title()
      expect(title).toBe('Splash')
    });
Alice
  • 26
  • 2
  • Thanks for the answer. Could you also look at: https://stackoverflow.com/questions/74733550/playwright-electron-is-it-possible-to-get-browserwindow-from-page – Nikhil Dec 08 '22 at 16:47