I am using watir-webdriver in combination with chromedriver (on Mac OS X) for the visualized testing. Once it started working I switched to headless testing using PhantomJS.
def browser_init
client = Selenium::WebDriver::Remote::Http::Default.new
client.timeout = @browser_timeout
case @browsing_type
when 'visual'
@b = Watir::Browser.new :chrome, :http_client => client
when 'headless'
@b = Watir::Browser.new :phantomjs, :http_client => client
end
end
Here is my problem and the question. Some of the web pages that I test are either fully stored in PDF format (and have an URL ending with .pdf) or consist of an embedded PDF content. These webpages are not reflected properly in :phantomjs case: their @b.title or @b.url point to the previously visited page. In the case of :chrome this information of a pdf page is accessible and hence verifiable for testing purposes.
Since PhantomJS is well known for its ability to produce PDF screenshots of the webpages, I am in doubt that it is not able to open PDF page on the web.
Am I right to understand that there is no PDF plugin for PhantomJS or do I do something wrong? I will highly appreciate any advice about headless testing of PDF pages in either case.