Repository: bbc/wraith

Issue #295: Help with Casper Mode-based Authentication
Created: 2015-10-07T23:23:30Z
I'm using wraith to connect and diff images from a dynamic js site. There's a sign-in form for authentication, and I usually have no trouble using casper.fill() in my generic casperjs tests. With wraith, attempting to insert a casper.fil(), wrapped in a casper.then() in javascript/casper.js causes phantomjs to seg fault and/or just hang. Attempts to use beforeCapture.js don't seem to execute the code at all, in that case, I'm using module.export. There are at least two factors I believe are affecting the wraith job:

phantomjs chokes on the https cert mismatch + tls protocol. Attempts to set --ssl-protocol and --web-security via 'phantomjs_options:' doesn't seem to work - the jobs do not run with the specified flags. When I execute the job via CLI, it fails without the above flags:

(as an aside, can someone explain what the bash executed 'casperjs' process is for?)
sh -c "casperjs" "" "javascript/casper.js" "https://foo.internal.dev" 
"1024" "shots/home/1024_phantomjs_dev.png" " " "javascript/gobal.js" "false"

phantomjs  "" /home/neha/code/tools/casperjs/bin/bootstrap.js 
--casper-path=/home/neha/code/tools/casperjs --cli javascript/casper.js 
https://foo.internal.dev 1024 shots/home/1280_phantomjs_dev.png
javascript/gobal.js javascript/local.js


There's a pesky phantomjs segfault that happens during execution, so it's possible my code was never completing. Here's the rub - i'm using casperjs 1.1.0-beta3, and phantomjs-2.0.0. However, I've confirmed the same behavior on the latest casperjs/phantomjs gems as well. Reviewing my config, I believe I may have a viewport mismatch issue.

What's the best method of inserting custom casper code into wraith? and how can I reliably insert arguments to phantomjs?
#Headless browser option
browser:
  # casperjs: "casperjs"
  phantomjs: "casperjs"
  # phantomjs_options: "--ssl-protocol=any"
  # slimerjs: "slimerjs"

# before capture event
before_capture: "javascript/gobal.js"

#If you want to have multiple snapping files, set the file name here
snap_file: "javascript/casper.js"

# Type the name of the directory that shots will be stored in
directory: 'shots'
# history_dir: 'shots_base'

# Add as many domains as necessary. Key will act as a label
domains:
  dev: "https://foo.internal.dev"

#Type screen widths below, here are a couple of examples
screen_widths:
  - 1024

# base_url: "https://foo.internal.dev"

#Type page URL paths below, here are a couple of examples
paths:
    home: /

#Amount of fuzz ImageMagick will use
fuzz: '20%'

#Set the filename of the spider file to use, if not specified it will fallback to spider.txt
# spider_file: bbc_co_uk_spider.txt

Duplicate issue #371: TLS/SSL versions
Created: 2016-01-13T21:37:56Z
I am trying to implement wraith to compare a dev version and prod. However, when I write the URL of my prod website: i.e. https:\www.something.com it throws an error: "Error with page..."
My question is if this issue could be to an obsolete SSL or TSL?

Closing comment (2016-01-14T09:44:45Z): This looks like a duplicate of #295 or #308.
You may need to add this to your config:
phantomjs_options: --ssl-protocol=tlsv1
Also, I assume you meant https://www rather than https:\www