-
Notifications
You must be signed in to change notification settings - Fork 607
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
Puppeteer dev branch! #704
Comments
Hello to all potential puppet players! Here is a little road map for all who want to try it out or even contribute. In general, for me it works much more reliable and it is also faster.
Take it for a spin an let me know what you think 🚀 |
Just bumped to 3.2.0 and pushed to NPM @beta! TESTERS & COMMENTS! 🙏
|
Works for me :) NOTE: the engine needs to be This also fixed the issue of a white screenshot I was having when running against a local (.local or .dev) domain #706 . |
I use the reference urls for our test suite with the following command:
And it looks like that the test suite hangs up when an error occurs. In the console i get
After this, it just stops running. But doesn't terminate the terminal process. If no error occurs, everything is running fine! |
@matthiaskomarek do you get a different behavior using Chromy in the stable branch? Not sure if it has something to do with Puppeteer.. |
Hey @krisdigital , thanks a lot for doing this! I'm testing it out and I saw that when I set EDIT: I also see no difference between |
@krisdigital thanks a lot again, and yeah I agree I didn't find the |
Hey @krisdigital i have tried the same with the current |
@matthiaskomarek Thank's for checking, I will look into it! |
anyone has any problems with running captures in parallel (say, 5 at a time)? I have random errors (puppeteer that can't find an element, for example) for scenarios with onReady scripts that run just fine when doing one capture at a time. I'm still not sure if this is something wrong with my setup/scripts, but just wanted to bring it up in case someone encountered the same issue. At the moment I can rely on the results only if i don't do parallel capturing, which really is a shame :( |
@krisdigital this issue will probably be addressed by the work happening in #712. |
@AkA84 we are still working on the migration— once all of our feature tests pass we’ll be looking at why some parallel cases seem to work fine but others have issues. This could be a performance issue in backstop— but it could also be on the network, the server or something else in the environment. |
Hey @krisdigital We're super excited for puppeteer. I'm currently trying to get it to run in Docker with the latest changes from https://github.com/garris/BackstopJS/tree/puppeteer. One thing I noticed is that we seem to create a new browser instance for each test case. We're currently experimenting with just having one browser instance and creating only new page objects (tabs) for each test. Let me know what you think. My repo is at: https://github.com/iain17/BackstopJS/tree/puppeteer |
This will increase the speed exponentially. having browser opened and keep
using same instance
…On Tue, Mar 27, 2018, 9:45 PM Iain Munro ***@***.***> wrote:
Hey @krisdigital <https://github.com/krisdigital> We're super excited for
puppeteer. I'm currently trying to get it to run in Docker with the latest
changes from https://github.com/garris/BackstopJS/tree/puppeteer.
One thing I noticed is that we seem to create a new browser instance for
each test case. We're currently experimenting with just having one browser
instance and creating only new page objects (tabs) for each test. Let me
know what you think.
My repo is at: https://github.com/iain17/BackstopJS/tree/puppeteer
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#704 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AQUrI1R8a6oVu4fYTqyOwiE05fU7IR0rks5tifwvgaJpZM4SuC7d>
.
|
@iain17 The current behaviour with new browser instances mirrors the behaviour of Chromy. Opening a tab is probably more ressource friendly, see this discussion: puppeteer/puppeteer#85 |
@garris @matthiaskomarek Just made a pull request that should handle that problem #718 |
📣 Puppeteer branch is merged to master and pushed to npm @canary! 🎆
|
🎉🍾🍻 |
Just trying puppeteer out in v3.2.3 on a docker setup and got an error:
Anyone experiencing the same? |
@cactusa see the link in the error: https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md, especially the sandbox section, also this PR #722 |
@krisdigital Just pulled the latest commit to try out the PR you linked above, but it didn't work for me, absolutely no change at all. I still get that same error. And I rebuild the docker image as well and followed the documentation from the readme. FYI @VesterDe |
@krisdigital or @here Anybody know how to handle CSP issues with puppeteer? I am getting errors like...
|
@cactusa Hey, did you also include the engineOptions to your config file? Specifically, this line:
That solved your exact problem for me. I'm not sure how to help if that doesn't change the error, at least... |
@VesterDe unfortunately no. same exact behavior. 😢 This is weird -- I didn't have this problem with the Chromy engine. 🤔 |
@garris This seems to be a known issue puppeteer/puppeteer#1814 ... |
@VesterDe Yes I did indeed include that exact line in my config. 😞 |
Thanks guys! Fixed by adding this onBefore script 👉 67801c2 |
I am hoping this will be a much better fix in the near future! puppeteer/puppeteer#2324 |
Cool. The second and bigger issue us that for most scenarios the captured test image is just grey, nothing else on it. Naturally it detects close to 100% difference. So far I have tried adding a delay to each scenario also tried with 'asyncCaptureLimit': 1 |
I can confirm that I get both of those errors intermittently as well, even if running Are your test images gray or empty? Mine are actually just WIDTHxHEIGHT of empty pixels, maybe the gray is just the css on the diffing tool? Do any of your reference images appear empty as well? I also get empty references sometimes... Although, as far as I can tell, this never happens if there are no selectors present for the run. So, if I'm just capturing the entire website in one image. In that case, it's never empty... |
Not sure, but I think it's just grey image of the same size as the reference. I have spotted some of the tests images are half captured and half grey. I have one example where the test capture is of an area slightly above the intended selector... I am also getting this error at the very start:
And this error on a couple scenarios where the test image is completely missing:
I guess am not switching to puppeteer just yet. I was really hoping this to work because it doesn't randomly hang executions as chromy does and is faster 😢 |
Ok, I've found a bit of a curve ball here... I'd be really grateful if someone can confirm this for me. I've isolated the failing cases on one of my projects, and it seems that the screenshot will be empty if any of the numbers pertaining to the bounding box of the selected element have decimals. So, if I log the bounding boxes these values produce a screenshot:
And these produce an empty file:
This is... unusual... But seems consistent on my machine. What also happens is that as soon as one selector in an array fails because of this reason, all the remaining selector in the scenario fail. It does provide an insight into the randomness we've been seeing, because while width and height are constant, X and Y are relative to the current viewport, and may have different values on different runs. I've tested this out on a standalone puppeteer run and it seems to happen as well. If someone could reproduce these findings we can make an issue with the puppeteer team. Edit: Perhaps this issue will lead to a good outcome. Edit2: Indeed, as per the above issue, Puppeteer@1.1.1 doesn't have this problem, it seems to start with 1.2.0. |
@VesterDe Great debugging! Maybe the Puppeteer version should be locked to 1.1.1 until the bug is fixed then.. |
@VesterDe Thank you for taking time to investigate this! |
@garris is it OK to move puppeteer to 1.1.1 as it is more stable? I can test and make a pull request. |
Looks like puppeteer is at 1.4.0. Yes, we definitely want to bump this. |
@garris Sadly version 1.4.0 still exhibits the same bug. Some test images are blank some are partially captured. Will try with 1.1.1 next Update: Weirdly v1.1.1 has the exact same problem. Maybe puppeteer is not the problem here 😭 |
I am also experiencing this issue with the latest BackstopJS and Puppeteer. Sometimes the images will be blank, sometimes they will be cropped incorrectly and sometimes they will display part of the content and white for the rest of it. Have not been able to find a workaround, yet (tried delays, etc). |
Is this fixable by adding a Math.floor() to our capture flow? |
@garris could you point me to the file I need to the change in and I'll try to tests this as soon as I have some spare time. |
Here is where selector screenshots are called by backstop... https://github.com/garris/BackstopJS/blob/master/core/util/runPuppet.js#L365 You could look into changing this to a different puppeteer call where you specify the screen coordinates explicitly using rounded boundingBox values. |
@VesterDe I have been doing some debugging of my own and I managed to reproduce the same results as you, but in my case I get the empty screenshots even for entries that do not have the decimals in their boundingBox object. I think the issue is caused by something else. @garris I am testing a bug fix for this and will be making a pull request shortly. I have basically done what you suggested, but without rounding the numbers and it worked. |
My pull request #808 |
Cool, can't wait to test it out. Edit: At first glance, your pull request seems to fix it for me! Great job @cactusa :) |
This is happening!
This branch...
https://github.com/garris/BackstopJS/tree/puppeteer
is tracking this branch...
https://github.com/krisdigital/BackstopJS
Interested in contributing? ...please coordinate with @krisdigital.
What you need to know...
The text was updated successfully, but these errors were encountered: