New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Black Screen in video and trace on mobile #11812
Comments
It's reproducible it happens every time for every mobile test |
Does it happen only with WebKit or other browsers too? Can you also share full config? |
As far as I tested it seems like it happens only on WebKit Here is the config file: import { PlaywrightTestConfig, devices } from '@playwright/test';
const config: PlaywrightTestConfig = {
testDir: './src/tests',
globalSetup: './src/tests/setup/globalSetup.ts',
timeout: 240 * 1000,
expect: {
timeout: 5000
},
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 1 : 0,
reporter: [['html'], ['list'], ['./src/reporters/slack-PD-reporter.ts']],
use: {
launchOptions: {
// slowMo: 20
},
actionTimeout: 0,
trace: 'on-first-retry',
video: 'on-first-retry',
screenshot: 'only-on-failure'
},
projects: [
{
name: 'chromium',
use: {
...devices['Desktop Chrome']
}
},
{
name: 'Mobile Safari',
use: {
...devices['iPhone 13 Pro']
}
}
]
};
export default config; |
Would you be able to share a minimal repro? I tried with a few sites locally, but to no avail. |
It’s not happening locally (on my Mac) Only on bitbucket pipelines also it starts the black screen after few seconds (let’s say 10, so make sure you check it on long e2e tests (mines are average of 2 minutes for each test)) also there is a chance that it maybe related to the parallel run (I can check if it happens when I run only one test) |
I have a lot of problems when running iOS on bitbucket pipelines (Also a lot of the tests which usually work fine on chromium starts to be flaky |
Sorry accidentally closed the issue |
Also this issue that we talked about on the slack channel is happening there (I haven’t open a bug about is yet) |
Hi @yury-s, I have the same issue like @israelKusayev described above. Context:
Tests starts properly but after some time (about 20 s) it goes partially black on scrolling down to the element on page(you can see the result on screenshots). Later it turns totally black for some time and it backs to partially black. Funny thing is that when I start the same test on CI in headed mode everything works smoothly - video without black screen. |
I'm facing the same issue here. I'm using:
|
I'm also running into this issue. |
Same problem here. Running playwright locally on Linux or in a docker container. |
Similar issue here. Some more context: My test steps are: opening a home page, clicking on a I am testing mainly on iOS Safari/webkit. So, what I have observed is when ever I run the test inside docker (mcr.microsoft.com/playwright:v1.25.0-jammy), the new page opened will always be rendered with issue (sometimes the page is enlarged, sometimes it is minimized), and I am not able to locate any elements on the new page. But, the test always runs fine on my mac machine. Hope these context helps with your debugging. Thanks. |
I'm having a very similar issue when running mobile safari tests in the CI (linux distro). I can't recreate the issue locally when running on macOs 11.4. The issue seems to crop up when toasts or popovers are involved. I can share a couple of traces with videos included but prefer not to post it publicly on here. Playwright gets into a loop doing the following, but the video shows that the app seems to have a gone out of the bounds recording box. (very similar to what dz1dz1on has posted above)
Playwright 1.27.1 |
We also came across this problem recently with v1.32.1 using the provided docker image. projects: [
{
name: 'Mobile Safari',
use: {
userAgent: devices['iPhone 13 Pro'].userAgent,
viewport: devices['iPhone 13 Pro'].viewport,
deviceScaleFactor: devices['iPhone 13 Pro'].deviceScaleFactor,
isMobile: devices['iPhone 13 Pro'].isMobile,
hasTouch: devices['iPhone 13 Pro'].hasTouch,
defaultBrowserType: devices['iPhone 13 Pro'].defaultBrowserType,
},
},
] And this modification would resolve the issue: projects: [
{
name: 'Mobile Safari',
use: {
userAgent: devices['iPhone 13 Pro'].userAgent,
viewport: devices['iPhone 13 Pro'].viewport,
deviceScaleFactor: devices['iPhone 13 Pro'].deviceScaleFactor,
isMobile: false,
hasTouch: devices['iPhone 13 Pro'].hasTouch,
defaultBrowserType: devices['iPhone 13 Pro'].defaultBrowserType,
},
},
] Hopefully this info is of some use in helping to track down the issue and as a temporary workaround for folks encountering the issue. |
Playing around with another predefined device descriptor, I found another workaround:
The workaround from @gabriel-finch-kr (setting isMobile to false) did not work for me with the |
I get the same problem on Macbook M1, running following: docker run --rm --network host --platform=linux/aarch64 -v $(pwd):/work/ -w /work/ -it mcr.microsoft.com/playwright:v1.31.0-focal /bin/bash
npm install
npx playwright test --update-snapshots My playwright.config.ts (basically the one from the docs) with only one project left (the problem one): import { defineConfig, devices } from "@playwright/test";
/**
* See https://playwright.dev/docs/test-configuration.
*/
export default defineConfig({
testDir: "./tests",
/* Maximum time one test can run for. */
timeout: 30 * 1000,
expect: {
/**
* Maximum time expect() should wait for the condition to be met.
* For example in `await expect(locator).toHaveText();`
*/
timeout: 5000,
},
/* Run tests in files in parallel */
fullyParallel: true,
/* Fail the build on CI if you accidentally left test.only in the source code. */
forbidOnly: !!process.env.CI,
/* Retry on CI only */
retries: process.env.CI ? 2 : 0,
/* Opt out of parallel tests on CI. */
workers: process.env.CI ? 1 : undefined,
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
reporter: "html",
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
use: {
/* Maximum time each action such as `click()` can take. Defaults to 0 (no limit). */
actionTimeout: 0,
/* Base URL to use in actions like `await page.goto('/')`. */
baseURL: "http://localhost:3000/",
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
trace: "on-first-retry",
},
/* Configure projects for major browsers */
projects: [
{
name: "Mobile Safari",
use: { ...devices["iPhone 12"] },
},
],
}); My test: import { test, expect } from "@playwright/test";
test.describe("Main page", () => {
test("looks as expected", async ({ page }) => {
await page.goto('/');
await page.waitForLoadState("networkidle");
await expect(page).toHaveScreenshot({ fullPage: true });
});
}); As a result I get completely transaparent page as a screenshot. |
Context:
mcr.microsoft.com/playwright:v1.18.1-focal
When I run the tests inside bitbucket pipelines after a few seconds the video is turning to a black screen (sometimes it's totally black sometimes you can see parts of the screen)
It doesn't happen when on
Desktop Chrome
The text was updated successfully, but these errors were encountered: