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
Cannot take fullPage
screenshot using puppeteer
#6921
Comments
I was able to reproduce the issue. It looks like its cause is in the My research showed that the issue can be in the hasCustomActionForBrowser method, which is not overridden in the provider. I tried to modify my code locally and it works. It's better to create an issue in the |
@AlexKamaev, thanks for your reply! |
@pfryga async hasCustomActionForBrowser (/* browserId */) {
return {
hasCloseBrowser: this.hasOwnProperty('closeBrowser'),
hasResizeWindow: this.hasOwnProperty('resizeWindow'),
hasTakeScreenshot: this.hasOwnProperty('takeScreenshot'),
hasGetVideoFrameData: this.hasOwnProperty('getVideoFrameData'),
hasCanResizeWindowToDimensions: this.hasOwnProperty('canResizeWindowToDimensions'),
hasMaximizeWindow: this.hasOwnProperty('maximizeWindow'),
hasChromelessScreenshots: true, // this property makes effect
};
}, |
Ok, thanks @AlexKamaev, it works! |
What is your Scenario?
I'm trying to take screenshot of full page using
takeScreenshot
function with propertyfullPage: true
(doc).Unfortunately when I'm using puppeteer (with custom browser provider) it doesn't work. Screenshots still contain only visible in viewport part of page.
What is the Current behavior?
I'm running single test in Testcafe, which takes screenshot of entire page. I'm using custom browser provider which handles
takeScreenshot
method - testcafe-browser-provider-puppeteer.Unfortunately it doesn't matter if I use in test
t.takeScreenshot({ fullPage:true })
or-s fullPage=true
option runningtestcafe
, in both cases created screenshot contains only part of page.However, I have noticed puppeteer creates screenshot correctly (as full page). After that, Testcafe replaces created screenshot with new one (non full page).
What is the Expected behavior?
Expected behaviour would be TestCafe not replaces created with puppeteer screenshot.
What is your public website URL? (or attach your complete example)
I prepared repository, where you can reproduce my scenario. Repository contains simple test with custom browser provider - testcafe-browser-provider-puppeteer. Please read section
Steps to Reproduce
below.What is your TestCafe test code?
Your complete configuration file
No response
Your complete test report
Running tests in:
Visual regression tests for breakpoint 320 x 640
✓ Create screenshot for preset: normal (screenshots: /screenshots/visual-regression/puppeteer/default/en-US/normal.png)
1 passed (19s)
Screenshots
No response
Steps to Reproduce
git clone git@github.com:pfryga/testcafe-issue-poc.git
npm ci
npm run visual-regression
please open /Users/[...]/testcafe-issue-poc/screenshots/default/normal.png screenshot. For next 10 seconds created screenshot contains full page (proper behavior)
, open created screenshot. As you can see screenshot contains entire page.10000ms
- for this time correct screenshot is created by puppeteer.10000ms
Testcafe replaces created screenshot with corrupted one (non full page) - undesirable stepTestCafe version
1.18.1
Node.js version
16.13.1
Command-line arguments
testcafe --app-init-delay 10000 "puppeteer:no_sandbox" --screenshots "./screenshots" "./vr-test.js"
Browser name(s) and version(s)
Chrome 100.0.4889.0
Platform(s) and version(s)
macOS 10.15.7
Other
No response
The text was updated successfully, but these errors were encountered: