README.md in poltergeist-1.5.1 vs README.md in poltergeist-1.6.0
- old
+ new
@@ -1,25 +1,25 @@
# Poltergeist - A PhantomJS driver for Capybara #
-[![Build Status](https://secure.travis-ci.org/jonleighton/poltergeist.png)](http://travis-ci.org/jonleighton/poltergeist)
+[![Build Status](https://secure.travis-ci.org/teampoltergeist/poltergeist.png)](http://travis-ci.org/teampoltergeist/poltergeist)
Poltergeist is a driver for [Capybara](https://github.com/jnicklas/capybara). It allows you to
run your Capybara tests on a headless [WebKit](http://webkit.org) browser,
provided by [PhantomJS](http://www.phantomjs.org/).
-**If you're viewing this at https://github.com/jonleighton/poltergeist,
+**If you're viewing this at https://github.com/teampoltergeist/poltergeist,
you're reading the documentation for the master branch.
[View documentation for the latest release
-(1.5.0).](https://github.com/jonleighton/poltergeist/tree/v1.5.0)**
+(1.6.0).](https://github.com/teampoltergeist/poltergeist/tree/v1.6.0)**
## Getting help ##
Questions should be posted [on Stack
Overflow, using the 'poltergeist' tag](http://stackoverflow.com/questions/tagged/poltergeist).
Bug reports should be posted [on
-GitHub](https://github.com/jonleighton/poltergeist/issues) (and be sure
+GitHub](https://github.com/teampoltergeist/poltergeist/issues) (and be sure
to read the bug reporting guidance below).
## Installation ##
Add `poltergeist` to your Gemfile, and in your test setup add:
@@ -41,29 +41,29 @@
### Mac ###
* *Homebrew*: `brew install phantomjs`
* *MacPorts*: `sudo port install phantomjs`
-* *Manual install*: [Download this](http://phantomjs.googlecode.com/files/phantomjs-1.9.2-macosx.zip)
+* *Manual install*: [Download this](https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.7-macosx.zip)
### Linux ###
-* Download the [32 bit](https://phantomjs.googlecode.com/files/phantomjs-1.9.2-linux-i686.tar.bz2)
-or [64 bit](https://phantomjs.googlecode.com/files/phantomjs-1.9.2-linux-x86_64.tar.bz2)
+* Download the [32 bit](https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.7-linux-i686.tar.bz2)
+or [64 bit](https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.7-linux-x86_64.tar.bz2)
binary.
* Extract the tarball and copy `bin/phantomjs` into your `PATH`
### Windows ###
-* Download the [precompiled binary](http://phantomjs.googlecode.com/files/phantomjs-1.9.2-windows.zip)
+* Download the [precompiled binary](https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.7-windows.zip)
for Windows
### Manual compilation ###
Do this as a last resort if the binaries don't work for you. It will
take quite a long time as it has to build WebKit.
-* Download [the source tarball](http://phantomjs.googlecode.com/files/phantomjs-1.9.2-source.zip)
+* Download [the source tarball](https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.7-source.zip)
* Extract and cd in
* `./build.sh`
(See also the [PhantomJS building
guide](http://phantomjs.org/build.html).)
@@ -95,18 +95,18 @@
Poltergeist supports all the mandatory features for a Capybara driver,
and the following optional features:
* `page.evaluate_script` and `page.execute_script`
* `page.within_frame`
-* `page.within_window`
* `page.status_code`
* `page.response_headers`
* `page.save_screenshot`
* `page.driver.render_base64(format, options)`
* `page.driver.scroll_to(left, top)`
* `page.driver.basic_authorize(user, password)`
* `element.native.send_keys(*keys)`
+* window API
* cookie handling
* drag-and-drop
There are some additional features:
@@ -129,15 +129,10 @@
If you need for some reasons base64 encoded screenshot you can simply call
`render_base64` that will return you encoded image. Additional options are the
same as for `save_screenshot` except the first argument which is format (:png by
default, acceptable :png, :gif, :jpeg).
-### Resizing the window ###
-
-Sometimes the window size is important to how things are rendered. Poltergeist sets the window
-size to 1024x768 by default, but you can set this yourself with `page.driver.resize(width, height)`.
-
### Clicking precise coordinates ###
Sometimes its desirable to click a very specific area of the screen. You can accomplish this with
`page.driver.click(x, y)`, where x and y are the screen coordinates.
@@ -214,36 +209,12 @@
* `page.driver.set_cookie(name, value, options = {})` - set a cookie.
The options hash can take the following keys: `:domain`, `:path`,
`:secure`, `:httponly`, `:expires`. `:expires` should be a `Time`
object.
* `page.driver.remove_cookie(name)` - remove a cookie
+* `page.driver.clear_cookies` - clear all cookies
-### Window switching ###
-
-The following methods can be used to execute commands inside different windows:
-
-* `page.driver.window_handles` - an array containing the names of all
- the open windows.
-
-* `page.within_window(name) { # actions }` - executes
- the passed block in the context of the named window.
-
-Example:
-
-``` ruby
-find_link("Login with Facebook").trigger("click")
-
-sleep(0.1)
-
-fb_popup = page.driver.window_handles.last
-page.within_window fb_popup do
- fill_in "email", :with => "facebook_email@email.tst"
- fill_in "pass", :with => "my_pass"
- click_button "Log In"
-end
-```
-
### Sending keys ###
There's an ability to send arbitrary keys to the element:
``` ruby
@@ -286,16 +257,16 @@
when communicating with PhantomJS. Default is 30.
* `:inspector` (Boolean, String) - See 'Remote Debugging', above.
* `:js_errors` (Boolean) - When false, Javascript errors do not get re-raised in Ruby.
* `:window_size` (Array) - The dimensions of the browser window in which to test, expressed
as a 2-element array, e.g. [1024, 768]. Default: [1024, 768]
-* `:phantomjs_options` (Array) - Additional [command line options](https://github.com/ariya/phantomjs/wiki/API-Reference)
+* `:phantomjs_options` (Array) - Additional [command line options](http://phantomjs.org/api/command-line.html)
to be passed to PhantomJS, e.g. `['--load-images=no', '--ignore-ssl-errors=yes']`
* `:extensions` (Array) - An array of JS files to be preloaded into
the phantomjs browser. Useful for faking unsupported APIs.
* `:port` (Fixnum) - The port which should be used to communicate
- with the PhantomJS process. Default: 44678.
+ with the PhantomJS process. Defaults to a random open port.
## Troubleshooting ##
Unfortunately, the nature of full-stack testing is that things can and
do go wrong from time to time. This section aims to highlight a number
@@ -307,11 +278,11 @@
of crashes: those that can be reproduced every time, and those that
occur sporadically and are not easily reproduced.
If your crash happens every time, you should read the [PhantomJS crash
reporting
-guide](https://github.com/ariya/phantomjs/wiki/Crash-Reporting) and file
+guide](http://phantomjs.org/crash-reporting.html) and file
a bug against PhantomJS. Feel free to also file a bug against
Poltergeist in case there are workarounds that can be implemented within
Poltergeist. Also, if lots of Poltergeist users are experiencing the
same crash then fixing it will move up the priority list.
@@ -410,10 +381,10 @@
Version history and a list of next-release features and fixes can be found in
the [changelog](CHANGELOG.md).
## License ##
-Copyright (c) 2011 Jonathan Leighton
+Copyright (c) 2011-2014 Jonathan Leighton
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,