Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 115 lines (72 sloc) 4.398 kb
5965f8a @jasonm Added README with a link to download Qt on OSX
jasonm authored
1 capybara-webkit
2 ===============
3
59c4eae @jferris Updated license ane readme
jferris authored
4 A [capybara](https://github.com/jnicklas/capybara) driver that uses [WebKit](http://webkit.org) via [QtWebKit](http://doc.qt.nokia.com/4.7/qtwebkit.html).
5965f8a @jasonm Added README with a link to download Qt on OSX
jasonm authored
5
6b724ef @jferris Update README instructions about compiler issues
jferris authored
6 Qt Dependency and Installation Issues
c5e6396 @jferris Moved info about installing QT into the Wiki
jferris authored
7 -------------
5965f8a @jasonm Added README with a link to download Qt on OSX
jasonm authored
8
578e5c7 @gabebw Spruce up the README
gabebw authored
9 capybara-webkit depends on a WebKit implementation from Qt, a cross-platform
10 development toolkit. You'll need to download the Qt libraries to build and
c5e6396 @jferris Moved info about installing QT into the Wiki
jferris authored
11 install the gem. You can find instructions for downloading and installing QT on
a4fcb8e @jferris Fixed Installing QT link
jferris authored
12 the [capybara-webkit wiki](https://github.com/thoughtbot/capybara-webkit/wiki/Installing-Qt-and-compiling-capybara-webkit)
657ee68 @jferris Clarify installation notes
jferris authored
13
4b044cc @halogenandtoast Added README info about Windows support.
halogenandtoast authored
14 Windows Support
15 ---------------
16
17 Currently 32bit Windows will compile Capybara-webkit. Support for Windows is provided by the open source community and Windows related issues should be posted to the [mailing list](http://groups.google.com/group/capybara-webkit)
18
d3f344a @jferris Added a note about crashes to the README
jferris authored
19 Reporting Issues
20 ----------------
21
22 Without access to your application code we can't easily debug most crashes or
f82d661 Fix typo
Lake Denman authored
23 generic failures, so we've included a debug version of the driver that prints a
d3f344a @jferris Added a note about crashes to the README
jferris authored
24 log of what happened during each test. Before filing a crash bug, please see
25 [Reporting Crashes](https://github.com/thoughtbot/capybara-webkit/wiki/Reporting-Crashes).
26 You're much more likely to get a fix if you follow those instructions.
27
6b724ef @jferris Update README instructions about compiler issues
jferris authored
28 If you are having compiling issues please check out the
a4fcb8e @jferris Fixed Installing QT link
jferris authored
29 [capybara-webkit wiki](https://github.com/thoughtbot/capybara-webkit/wiki/Installing-Qt-and-compiling-capybara-webkit).
6b724ef @jferris Update README instructions about compiler issues
jferris authored
30 If you don't have any luck there, please post to the
31 [mailing list](http://groups.google.com/group/capybara-webkit). Please don't
32 open a Github issue for a system-specific compiler issue.
d8c640d @halogenandtoast Added note about mailing list for compilation errors.
halogenandtoast authored
33
d7f491d @croaky improving the install instructions
croaky authored
34 CI
35 --
36
37 If you're like us, you'll be using capybara-webkit on CI.
657ee68 @jferris Clarify installation notes
jferris authored
38
87a00ab @jferris Added more readme notes on Qt and Xvfb
jferris authored
39 On Linux platforms, capybara-webkit requires an X server to run, although it doesn't create any visible windows. Xvfb works fine for this. You can setup Xvfb yourself and set a DISPLAY variable, or try out the [headless gem](https://github.com/leonid-shevtsov/headless).
f754e93 @jferris Added Ubunutu instructions to the README
jferris authored
40
59c4eae @jferris Updated license ane readme
jferris authored
41 Usage
42 -----
43
44 Add the capybara-webkit gem to your Gemfile:
45
46 gem "capybara-webkit"
47
48 Set your Capybara Javascript driver to webkit:
49
50 Capybara.javascript_driver = :webkit
51
7be8f94 @jferris Clean up README
jferris authored
52 In cucumber, tag scenarios with @javascript to run them using a headless WebKit browser.
59c4eae @jferris Updated license ane readme
jferris authored
53
7be8f94 @jferris Clean up README
jferris authored
54 In RSpec, use the :js => true flag.
55
e2c103c @halogenandtoast Update documentation to point to actual capybara readme.
halogenandtoast authored
56 Take note of the transactional fixtures section of the [capybara README](https://github.com/jnicklas/capybara/blob/master/README.md).
eb6165d @joemsak Add a couple of notes that :js => true should still be used, and to n…
joemsak authored
57
6d224d0 @jc00ke Adding note about Capybara.app with Sinatra
jc00ke authored
58 If you're using capybara-webkit with Sinatra, don't forget to set
59
60 Capybara.app = MySinatraApp.new
61
7361822 @jferris Document unofficial driver methods
jferris authored
62 Non-Standard Driver Methods
63 ---------------------------
64
65 capybara-webkit supports a few methods that are not part of the standard capybara API. You can access these by calling `driver` on the capybara session. When using the DSL, that will look like `page.driver.method_name`.
66
67 **console_messages**: returns an array of messages printed using console.log
68
69 # In Javascript:
70 console.log("hello")
71 # In Ruby:
72 page.driver.console_messages
73 => {:source=>"http://example.com", :line_number=>1, :message=>"hello"}
74
75 **error_messages**: returns an array of Javascript errors that occurred
76
77 page.driver.error_messages
78 => {:source=>"http://example.com", :line_number=>1, :message=>"SyntaxError: Parse error"}
79
80 **resize_window**: change the viewport size to the given width and height
81
82 page.driver.resize_window(500, 300)
83 page.driver.evaluate_script("window.innerWidth")
84 => 500
85
86 **render**: render a screenshot of the current view
87
88 page.driver.render "tmp/screenshot.png"
89
90 **cookies**: allows read-only access of cookies for the current session
91
92 page.driver.cookies["alpha"]
93 => "abc"
94
3e9527a @mike-burns a contributing guide
mike-burns authored
95 Contributing
96 ------------
97
98 See the CONTRIBUTING document.
99
59c4eae @jferris Updated license ane readme
jferris authored
100 About
101 -----
102
8674ef7 @jferris Update authors
jferris authored
103 The capybara WebKit driver is maintained by Joe Ferris and Matt Mongeau. It was written by [thoughtbot, inc](http://thoughtbot.com/community) with the help of numerous [contributions from the open source community](https://github.com/thoughtbot/capybara-webkit/contributors).
59c4eae @jferris Updated license ane readme
jferris authored
104
37b3d24 @nicholaides Documenting that some code was borrowed from Phantom.js
nicholaides authored
105 Code for rendering the current webpage to a PNG is borrowed from Phantom.js' implementation.
106
64cf394 @jferris Added a note about X servers and the thoughtbot logo
jferris authored
107 ![thoughtbot](http://thoughtbot.com/images/tm/logo.png)
108
59c4eae @jferris Updated license ane readme
jferris authored
109 The names and logos for thoughtbot are trademarks of thoughtbot, inc.
110
111 License
112 -------
113
578e5c7 @gabebw Spruce up the README
gabebw authored
114 capybara-webkit is Copyright (c) 2011 thoughtbot, inc. It is free software, and may be redistributed under the terms specified in the LICENSE file.
Something went wrong with that request. Please try again.