Skip to content
This repository
Newer
Older
100644 193 lines (138 sloc) 6.83 kb
5965f8a5 » jasonm
2011-02-28 Added README with a link to download Qt on OSX
1 capybara-webkit
2 ===============
3
a4324403 » gabebw
2012-10-12 Add Code Climate badge
4 [![Code Climate](https://codeclimate.com/badge.png)](https://codeclimate.com/github/thoughtbot/capybara-webkit)
5
59c4eaeb » jferris
2011-03-09 Updated license ane readme
6 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).
5965f8a5 » jasonm
2011-02-28 Added README with a link to download Qt on OSX
7
6b724ef4 » jferris
2012-02-24 Update README instructions about compiler issues
8 Qt Dependency and Installation Issues
c5e6396b » jferris
2011-09-14 Moved info about installing QT into the Wiki
9 -------------
5965f8a5 » jasonm
2011-02-28 Added README with a link to download Qt on OSX
10
578e5c75 » gabebw
2011-08-27 Spruce up the README
11 capybara-webkit depends on a WebKit implementation from Qt, a cross-platform
12 development toolkit. You'll need to download the Qt libraries to build and
c5e6396b » jferris
2011-09-14 Moved info about installing QT into the Wiki
13 install the gem. You can find instructions for downloading and installing QT on
a4fcb8e0 » jferris
2012-02-27 Fixed Installing QT link
14 the [capybara-webkit wiki](https://github.com/thoughtbot/capybara-webkit/wiki/Installing-Qt-and-compiling-capybara-webkit)
657ee682 » jferris
2011-04-13 Clarify installation notes
15
4b044ccf » halogenandtoast
2012-03-16 Added README info about Windows support.
16 Windows Support
17 ---------------
18
19 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)
20
d3f344af » jferris
2011-10-01 Added a note about crashes to the README
21 Reporting Issues
22 ----------------
23
24 Without access to your application code we can't easily debug most crashes or
f82d6617 » Lake Denman
2011-10-06 Fix typo
25 generic failures, so we've included a debug version of the driver that prints a
d3f344af » jferris
2011-10-01 Added a note about crashes to the README
26 log of what happened during each test. Before filing a crash bug, please see
27 [Reporting Crashes](https://github.com/thoughtbot/capybara-webkit/wiki/Reporting-Crashes).
28 You're much more likely to get a fix if you follow those instructions.
29
6b724ef4 » jferris
2012-02-24 Update README instructions about compiler issues
30 If you are having compiling issues please check out the
a4fcb8e0 » jferris
2012-02-27 Fixed Installing QT link
31 [capybara-webkit wiki](https://github.com/thoughtbot/capybara-webkit/wiki/Installing-Qt-and-compiling-capybara-webkit).
6b724ef4 » jferris
2012-02-24 Update README instructions about compiler issues
32 If you don't have any luck there, please post to the
33 [mailing list](http://groups.google.com/group/capybara-webkit). Please don't
34 open a Github issue for a system-specific compiler issue.
d8c640d1 » halogenandtoast
2012-01-13 Added note about mailing list for compilation errors.
35
d7f491d7 » croaky
2011-06-05 improving the install instructions
36 CI
37 --
38
39 If you're like us, you'll be using capybara-webkit on CI.
657ee682 » jferris
2011-04-13 Clarify installation notes
40
87a00ab6 » jferris
2011-04-14 Added more readme notes on Qt and Xvfb
41 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).
f754e932 » jferris
2011-04-13 Added Ubunutu instructions to the README
42
59c4eaeb » jferris
2011-03-09 Updated license ane readme
43 Usage
44 -----
45
46 Add the capybara-webkit gem to your Gemfile:
47
48 gem "capybara-webkit"
49
50 Set your Capybara Javascript driver to webkit:
51
52 Capybara.javascript_driver = :webkit
53
7be8f94c » jferris
2011-11-01 Clean up README
54 In cucumber, tag scenarios with @javascript to run them using a headless WebKit browser.
59c4eaeb » jferris
2011-03-09 Updated license ane readme
55
6535c1b1 » jferris
2012-06-08 README links to more information about usage with RSpec.
56 In RSpec, use the :js => true flag. See the [capybara documention](http://rubydoc.info/gems/capybara#Using_Capybara_with_RSpec) for more information about using capybara with RSpec.
7be8f94c » jferris
2011-11-01 Clean up README
57
e2c103cd » halogenandtoast
2012-01-13 Update documentation to point to actual capybara readme.
58 Take note of the transactional fixtures section of the [capybara README](https://github.com/jnicklas/capybara/blob/master/README.md).
eb6165d9 » joemsak
2011-11-01 Add a couple of notes that :js => true should still be used, and to n…
59
6d224d07 » jc00ke
2012-04-17 Adding note about Capybara.app with Sinatra
60 If you're using capybara-webkit with Sinatra, don't forget to set
61
62 Capybara.app = MySinatraApp.new
63
73618220 » jferris
2012-04-03 Document unofficial driver methods
64 Non-Standard Driver Methods
65 ---------------------------
66
67 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`.
68
69 **console_messages**: returns an array of messages printed using console.log
70
71 # In Javascript:
72 console.log("hello")
73 # In Ruby:
74 page.driver.console_messages
75 => {:source=>"http://example.com", :line_number=>1, :message=>"hello"}
76
77 **error_messages**: returns an array of Javascript errors that occurred
78
79 page.driver.error_messages
80 => {:source=>"http://example.com", :line_number=>1, :message=>"SyntaxError: Parse error"}
81
e677cb9c » danivovich
2012-07-10 Control JavaScript confirmation dialogs from Ruby
82 **alert_messages, confirm_messages, prompt_messages**: returns arrays of Javascript dialog messages for each dialog type
83
84 # In Javascript:
85 alert("HI");
86 confirm("Ok?");
87 prompt("Number?", "42");
88 # In Ruby:
89 page.driver.alert_messages
90 => ["Hi"]
91 page.driver.confirm_messages
92 => ["Ok?"]
93 page.driver.prompt_messages
94 => ["Number?"]
95
73618220 » jferris
2012-04-03 Document unofficial driver methods
96 **resize_window**: change the viewport size to the given width and height
97
98 page.driver.resize_window(500, 300)
99 page.driver.evaluate_script("window.innerWidth")
100 => 500
101
f4b34e14 » dznz
2012-05-03 If `page.driver.render` needs mini_magick and ImageMagick installed, …
102 **render**: render a screenshot of the current view (requires [mini_magick](https://github.com/probablycorey/mini_magick) and [ImageMagick](http://www.imagemagick.org))
73618220 » jferris
2012-04-03 Document unofficial driver methods
103
104 page.driver.render "tmp/screenshot.png"
105
106 **cookies**: allows read-only access of cookies for the current session
107
108 page.driver.cookies["alpha"]
109 => "abc"
110
e677cb9c » danivovich
2012-07-10 Control JavaScript confirmation dialogs from Ruby
111 **accept_js_confirms!**: accept any Javascript confirm that is triggered by the page's Javascript
112
113 # In Javascript:
114 if (confirm("Ok?"))
115 console.log("Hi");
116 else
117 console.log("Bye");
118 # In Ruby:
119 page.driver.accept_js_confirms!
120 visit "/"
121 page.driver.console_messages.first[:message]
122 => "Hi"
123
124 **dismiss_js_confirms!**: dismiss any Javascript confirm that is triggered by the page's Javascript
125
126 # In Javascript:
127 if (confirm("Ok?"))
128 console.log("Hi");
129 else
130 console.log("Bye");
131 # In Ruby:
132 page.driver.dismiss_js_confirms!
133 visit "/"
134 page.driver.console_messages.first[:message]
135 => "Bye"
136
137 **accept_js_prompts!**: accept any Javascript prompt that is triggered by the page's Javascript
138
139 # In Javascript:
140 var a = prompt("Number?", "0")
141 console.log(a);
142 # In Ruby:
143 page.driver.accept_js_prompts!
144 visit "/"
145 page.driver.console_messages.first[:message]
146 => "0"
147
148 **dismiss_js_prompts!**: dismiss any Javascript prompt that is triggered by the page's Javascript
149
150 # In Javascript:
151 var a = prompt("Number?", "0")
152 if (a != null)
153 console.log(a);
154 else
155 console.log("you said no"));
156 # In Ruby:
157 page.driver.dismiss_js_prompts!
158 visit "/"
159 page.driver.console_messages.first[:message]
160 => "you said no"
161
162 **js_prompt_input=(value)**: set the text to use if a Javascript prompt is encountered and accepted
163
164 # In Javascript:
165 var a = prompt("Number?", "0")
166 console.log(a);
167 # In Ruby:
168 page.driver.js_prompt_input = "42"
169 page.driver.accept_js_prompts!
170 visit "/"
171 page.driver.console_messages.first[:message]
172 => "42"
173
3e9527a4 » mike-burns
2011-07-22 a contributing guide
174 Contributing
175 ------------
176
177 See the CONTRIBUTING document.
178
59c4eaeb » jferris
2011-03-09 Updated license ane readme
179 About
180 -----
181
8674ef7a » jferris
2011-11-01 Update authors
182 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).
59c4eaeb » jferris
2011-03-09 Updated license ane readme
183
37b3d24f » nicholaides
2011-07-03 Documenting that some code was borrowed from Phantom.js
184 Code for rendering the current webpage to a PNG is borrowed from Phantom.js' implementation.
185
64cf394f » jferris
2011-04-13 Added a note about X servers and the thoughtbot logo
186 ![thoughtbot](http://thoughtbot.com/images/tm/logo.png)
187
59c4eaeb » jferris
2011-03-09 Updated license ane readme
188 The names and logos for thoughtbot are trademarks of thoughtbot, inc.
189
190 License
191 -------
192
e39a5c9e » adarsh
2012-09-14 Update README.md copyright year
193 capybara-webkit is Copyright (c) 2010-2012 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.