-
Notifications
You must be signed in to change notification settings - Fork 358
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
Wraith consistently hangs on final URL #508
Comments
@pcraig3 How did you resolve this? Also how do you pass options to clear cache from phantomjs? Id appreciate any info thanks!! |
Hey! Thanks for the interest. > How did you resolve this?Unfortunately, I haven’t had any success getting this to work reliably on our project, although I have noticed that there seem to be specific conditions under which it fails. Running Wraith against a couple of other projects we work on or against our live site seems to work much more reliably than the local version of the project I linked to — I think this means that it’s not getting something back that it expects in the response from the makeshift server we’re running in this project, but since filing this I’ve been working on other things and I haven’t had much more time to look into it. > Also how do you pass options to clear cache from phantomjs?Setting default parameters for phantomjs seems to be something you can do with the JavaScript files you run before opening each page (this one is a good example ), so the way that I added this line to my JS file to be run before the thing.
Which I found in this stack overflow answer. Didn’t actually help solve my particular problem though, so it might not be what you’re looking for. |
Thanks for responding! So Ive done a couple of things which I found here and on the internet to help me resolve some of our issues. The first is for when it hangs (I am running on sets of 10k so it does hang for me), @JimBledsoe wrote a script that will kill any hung phantomjs process' and wraith should restart it (upto 5 times I believe). That issue and script is here: To clear my cache, I followed this link and appended an "?wraith" to each line of my paths. As described: Ill try to use what you put and see if works for me. Thank you!! |
I am experiencing the same issue. Wraith hangs on the last url. I'm running wraith in the container https://hub.docker.com/r/bbcnews/wraith/ tagged 6eac3f399c56fc54bdbfd973908b190defa9c6cf74958900e0042118ed726f33. The site which I compare against (current) is on the internet. The (new) site which I run the test against is inside a container which is linked with the wraith container. My setup looks like this:
Unfortunately wraith hangs always on the last url, no matter if I lower the amount of pages. I'll try to publish both pages on a webserver to see if it still hangs when both pages are on the web and I'll share my findings here. |
We had the same issue on local dev Linux machines - we wanted to compare live instance with local dev instance. Wraith was hanging on the last URL check all the time and was only working with a couple of test URLs, but as soon as we have 7-8 or more URLs it was failing. We tried all recommended solutions in this and other issues and none of them worked. Finally we started changing web drivers so:
Chrome driver support landed recently in #541 and I would just recommend everybody just to use this and nothing else. Its solving last URL hanging issue and it is also faster in execution. At least until slimerjs is fixed to work with latest Firefox engine this is the best option for now. |
@pivica SlimerJS beta should support Firefox 57+ (https://download.slimerjs.org/releases/1.0.0-beta.1/). |
I'm using Wraith right now and I still have this problem. I use phantomjs. |
How do you use Chrome in Wraith? |
Ok, it was painfull to get normal chrome to work. (For mac you need an alias in your ~/.bash_profile capture.yaml browser: "chrome"
...
paths:
login_page: /backend/index.php
backend01 : /backend/index.php?content=228 # test
backend001 : /backend/index.php?content=85 # test
backend0001 : /backend/index.php?content=355 # test
backend00001 : /backend/index.php?content=31 # test
...
# (optional) JavaScript file to execute before taking screenshot of every path. Default: nil
before_capture: '../javascript/login-backend.js'
verbose: true
settle: 30 #(optional: integer) Number of seconds to wait for the page to settle (when using Chrome as the headless browser)
threads: 1 #(optional: integer) Number of capture threads to run simultanously
# (optional) Color to highlight the image diff. Default: 'blue'
highlight_color: red javascript/login-backend.js var original_url_asked = document.referrer;
if (typeof jQuery !== 'undefined') {//maybe 500 or 404 page
//we ended up on login page, let's login
$('body > form > input[type="password"]').prop('value', 'PASSWORD');
$('body > form > input[type="text"]').prop('value', 'USERNAME');
$('body > form > input[type="submit"]').click();//submit form
//we are logged in
$('body').empty();//clear all the stuff
//since we can't redirect, we'll open a full page iframe with the url we wanted to see initially
$('body').append('<div style="position:absolute; left: 0; right: 0; bottom: 0; top: 0px;"><iframe id="frame" width="100%" height="100%" frameborder="0" src="" ></iframe></div>');
$("#frame").load(function () {
//we are inside the iframe
if (typeof jQuery !== 'undefined') {//maybe 500 or 404 page
$(this).contents().find('#root div.backend_left').remove();//delete the menu, because it is usually not equal
$(this).contents().find('#root div.backend_right_top').remove();//delete the top bar
}
});
//load that original_url finally
$("#frame").attr("src", original_url_asked);//cannot redirect or wraith complains
}
//important or wraith will not understand it is ready to take a screenshot
var callback = arguments[arguments.length-1];
setTimeout(callback, 2000); This is my
Execute by running: if you get blank page, that's probably chrome and ssl problem, didn't find a fix, not even with
|
Wraith seems like a super useful tool that would be awesome to use for our pattern library, unfortunately, we can't get it to run reliably.
We have an app with 34 pages (and we're using the 5 default screen sizes). Running Wraith against it seems to fail ~9 out of 10 times, and always in the same way.
It goes through all of the pages, outputting all the urls and doing the "Resizing" and "Snapping" stuff, but then -- almost every time -- it hangs forever after it says it's "Snapping" the highest resolution on the final page (in our case:
Snapping http://localhost:8000/summary-table.html at: 1280x1500
). Lowering the number of pages (to 2 or 3, for example) seems to increase the likelihood of Wraith successfully finishing, but even then it will still frequently hang.Our issue is very similar to one that was closed without a resolution: "Wraith intermittently hangs"
Additionally, a coworker of mine ran it on his machine and encountered exactly the same issue.
ruby -v
phantomjs -v
wraith -v
I've tried passing in a few different options to phantomjs (adjusting the timeout setting, clearing the cache) and it seems to make no difference at all. Can you help us? I'm not sure what else I should try.
Since our project is public, it should be fairly easy for you to reproduce the issue:
sudo easy_install virtualenv
(installs virtualenv)git checkout pc-really-run-wraith
(checkout the branch with wraith)make serve_pages
(compile pages and serve them locally)bundle install wraith
(install Wraith)wraith history wraith/config.yml
(try to run Wraith)Issue checklist:
I have validated my config file against YAML Validator to make sure it is valid YAML.
I have run the
wraith info
command and pasted the output below:wraith history wraith/config.yml
in verbose mode (by addingverbose: true
to my config) and pasted the output below:↑ never gets past this line, which is the final page at the highest resolution ↑
The text was updated successfully, but these errors were encountered: