Skip to content
This repository has been archived by the owner on Dec 18, 2018. It is now read-only.

Testing print styles #82

Closed
cantino opened this issue Oct 27, 2014 · 1 comment
Closed

Testing print styles #82

cantino opened this issue Oct 27, 2014 · 1 comment

Comments

@cantino
Copy link

cantino commented Oct 27, 2014

We've been having regressions around our print.css styles, since we don't see them often. Can PhantomCSS be used to test print styles?

@jamescryer
Copy link

You could do this before taking a screenshot. (Assumes jQuery is on the page)

casper.evaluate(function(){
  $('link:not(link[media*=print])').remove()
  $('link[media*=print]').attr('media', 'all');
});

I don't know if there is anything native to PhantomJS you could use, but the above script would essentially do the same, perhaps combine with setting viewport

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants