forked from teampoltergeist/poltergeist
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
609 additions
and
520 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -97,14 +97,14 @@ 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 | ||
|
||
|
@@ -131,11 +131,6 @@ If you need for some reasons base64 encoded screenshot you can simply call | |
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 | ||
|
@@ -217,31 +212,6 @@ The following methods are used to inspect and manipulate cookies: | |
object. | ||
* `page.driver.remove_cookie(name)` - remove a cookie | ||
|
||
### 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 => "[email protected]" | ||
fill_in "pass", :with => "my_pass" | ||
click_button "Log In" | ||
end | ||
``` | ||
|
||
### Sending keys ### | ||
|
||
There's an ability to send arbitrary keys to the element: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.