Skip to content

[BUG] Full page screenshots​ doesn't work on Electron application #11041

Closed

Description

Context:

  • Playwright Version: 1.17.0
  • Operating System: Windows, Linux and Mac
  • Node.js version: 14.18.1
  • Browser: Chromium (Electron)
  • Extra: N/A

Code Snippet

import test from "../fixtures/common";
import { expect } from "@playwright/test";
import { OnboardingPage } from "../models/OnboardingPage";

test("Onboarding", async ({ page }) => {
  const onboardingPage = new OnboardingPage(page);

  await test.step("Get started", async () => {
    expect(await onboardingPage.getStartedButton).toBeVisible();
    expect(await page.screenshot({ fullPage: true })).toMatchSnapshot(`getstarted.png`);
  });
})

Describe the bug
On Electron application, I unfortunately can't take a screenshot of the full page.
https://playwright.dev/docs/screenshots#full-page-screenshots

Activity

  1. yury-s commented on Dec 21, 2021

    @yury-s
    Member

    Can you share minimal repro? I've tried with the attached app and it works just fine
    test.zip

    Also which Electon version are you using?

  2. nabil-brn commented on Dec 23, 2021

    @nabil-brn
    Author

    Hello Yury Semikhatsky (@yury-s),

    We're using electron version 13.5.2, it could come from our app, I guess?

  3. aslushnikov commented on Dec 27, 2021

    @aslushnikov
    Contributor

    Nabil Bourenane (@nabil-brn) this is unfortunately not actionable without a repro that we can run & debug locally. Please feel free to resubmit once there's a repro!

  4. davej commented on Nov 11, 2022

    @davej

    Just FYI in case anybody comes across this, the problem with the original is that there was no window selected to screenshot. I made the same mistake.

    -    expect(await page.screenshot({ fullPage: true })).toMatchSnapshot(`getstarted.png`);
    +    expect(await onboardingPage.screenshot({ fullPage: true })).toMatchSnapshot(`getstarted.png`);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions