-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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] Element is not opened in fullscreen mode ( chrome / chromium ) #27598
Comments
Hi, I believe the issue might be related to the screenshot being taken too quickly, which is why the full-screen mode isn't visible. I made some slight changes to your script, and it works fine for me. test.describe.only(`Fullscreen tests`, () => {
test(`#1 Should open Fullscreen`, async ({ page }) => {
const title = "Fullscreen page";
await page.goto(`https://pktestblog1.blogspot.com/p/fullscreen-page.html`);
await expect(page.getByText(title)).toBeVisible();
await page.locator("#openFullscreen").click();
// for checking
await page.waitForTimeout(500);
await page.screenshot({ path: "full-screen.png" });
});
}); Of course it's a bad practise to wait for a timeout. So you can add some hidden element that will appear/diappear in the full-screen mode and wait for it. |
Hi @viraxslot |
Hey @viraxslot, thanks for the comment but I was checking with time outs also before I created an issue but they don't help for chromium in anyway. |
The test will pass in headed if you move waitForTimeout to line 17: |
The element does not get into full screen mode in headless browser today. I headed it should be working fine if yo wait long enough. See also #1086 |
Filed upstream bug: https://bugs.chromium.org/p/chromium/issues/detail?id=1493760 Meanwhile you can run with import { test, expect } from '@playwright/test';
test.use({
launchOptions: {
args: ['--headless=new']
}
})
test(`simple test`, async ({ page }) => {
await page.setContent(`
<script>
function openFullscreen(event) {
event.target.requestFullscreen();
}
</script>
<div style="width: 500; height: 500; background-color: green" onclick='openFullscreen(event)'></div>
`);
await page.locator('div').click();
await page.waitForTimeout(1000);
await page.screenshot({ path: "full-screen.png" });
}); |
Thanks @yury-s, |
The upstream issue was fixed and the fix should make it to Playwright in 1.41. |
@yury-s can you confirm that it is part of Playwright 1.41? |
Yup, I'm looking forward for this fix because |
Was this fix removed from 1.41 version ? :/ |
I'm seeing the same problem on 1.42, would love an update. I can provide a repro. |
System info
Source code / Test code
HTML code for simple FS page is in .pdf in attachments
Config file
playwright.config.ts
Expected
Element should be opened in FS mode, works for firefox / webkit :
![FS in firefox](https://private-user-images.githubusercontent.com/115999141/274914122-533474e6-9403-46c4-a3d3-a54cba1e6912.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjMwODE4MjYsIm5iZiI6MTcyMzA4MTUyNiwicGF0aCI6Ii8xMTU5OTkxNDEvMjc0OTE0MTIyLTUzMzQ3NGU2LTk0MDMtNDZjNC1hM2QzLWE1NGNiYTFlNjkxMi5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwODA4JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDgwOFQwMTQ1MjZaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT02MDFjYmNmZjlhMDEyYWViOTc1NGNkM2IwNWJlYWE3MjM3Y2QwNzJkZDEzN2NkYWY1ZmZlMGVhZTkyZDI2MTJiJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.o8z4IyRE6tcc1E2k8s4c496MZ6HBDDTzIeDWIp1uMhw)
Actual
Button is found and clicked but element is not opened in fullscreen mode
![no FS in chrome](https://private-user-images.githubusercontent.com/115999141/274913951-f7bad05c-931c-4263-be52-54b675c5aa3b.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjMwODE4MjYsIm5iZiI6MTcyMzA4MTUyNiwicGF0aCI6Ii8xMTU5OTkxNDEvMjc0OTEzOTUxLWY3YmFkMDVjLTkzMWMtNDI2My1iZTUyLTU0YjY3NWM1YWEzYi5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwODA4JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDgwOFQwMTQ1MjZaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1kOTZhMGY4MTkxYjM4YWQ2ZGM3YTk3MTUzNWMxOGYyYWY3MDUzYmNhZjUxMzg1ZTk3Zjg2NzU3ODJjMDkyMTcyJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.aBmkLAKaxVxOfgJ3gU63o-QmaRZgJk2pwRzvCPC-th8)
Note
Fullscreen functionality for web element is crucial for our product and in our tests, thanks in advance.
fullscreen page.pdf
The text was updated successfully, but these errors were encountered: