poltergeist 1.15.0 → 1.16.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +7 -3
- data/lib/capybara/poltergeist/browser.rb +5 -1
- data/lib/capybara/poltergeist/client.rb +8 -5
- data/lib/capybara/poltergeist/client/browser.coffee +7 -2
- data/lib/capybara/poltergeist/client/compiled/browser.js +8 -2
- data/lib/capybara/poltergeist/client/compiled/web_page.js +1 -1
- data/lib/capybara/poltergeist/client/web_page.coffee +2 -2
- data/lib/capybara/poltergeist/driver.rb +4 -0
- data/lib/capybara/poltergeist/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6638e15d99597aff8640e53f7664ccbe63aa0767
|
4
|
+
data.tar.gz: 68af8a941ebdde61b19c314de194237f31c1f9c9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ac7e76188f1052eccd3f7becd4af299bd3b467ad20480edf79f8c6ce22ddba8bd44cee05a717a3d5320ff30104cf64a18fe606f97badcd1a7dca63d1814b401c
|
7
|
+
data.tar.gz: e7938e73c8e55cebd9ad804cc54d4c865cc4ef0eda0af576966ce14a2c53ade5a5dff6ef204451549668f95c10178405ea5a3cde180636efc23c4a2fa7f1b134
|
data/README.md
CHANGED
@@ -9,7 +9,7 @@ provided by [PhantomJS](http://phantomjs.org/).
|
|
9
9
|
**If you're viewing this at https://github.com/teampoltergeist/poltergeist,
|
10
10
|
you're reading the documentation for the master branch.
|
11
11
|
[View documentation for the latest release
|
12
|
-
(1.
|
12
|
+
(1.16.0).](https://github.com/teampoltergeist/poltergeist/tree/v1.16.0)**
|
13
13
|
|
14
14
|
## Getting help ##
|
15
15
|
|
@@ -53,11 +53,15 @@ dependencies* (you don't need Qt, or a running X server, etc.)
|
|
53
53
|
|
54
54
|
### Linux ###
|
55
55
|
|
56
|
-
* Download the [32 bit](https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.
|
57
|
-
or [64 bit](https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.
|
56
|
+
* Download the [32 bit](https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-i686.tar.bz2)
|
57
|
+
or [64 bit](https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2)
|
58
58
|
binary.
|
59
59
|
* Extract the tarball and copy `bin/phantomjs` into your `PATH`
|
60
60
|
|
61
|
+
_DO NOT_ use `phantomjs` from the official Ubuntu repositories, since it doesn't
|
62
|
+
work well with `poltergeist`. More information
|
63
|
+
[here](https://github.com/teampoltergeist/poltergeist/issues/866).
|
64
|
+
|
61
65
|
### Windows ###
|
62
66
|
* Download the [precompiled binary](https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.8-windows.zip)
|
63
67
|
for Windows
|
@@ -391,6 +391,10 @@ module Capybara::Poltergeist
|
|
391
391
|
command 'go_forward'
|
392
392
|
end
|
393
393
|
|
394
|
+
def refresh
|
395
|
+
command 'refresh'
|
396
|
+
end
|
397
|
+
|
394
398
|
def accept_confirm
|
395
399
|
command 'set_confirm_process', true
|
396
400
|
end
|
@@ -435,7 +439,7 @@ module Capybara::Poltergeist
|
|
435
439
|
equals: :Equal,
|
436
440
|
Control: :Ctrl,
|
437
441
|
control: :Ctrl,
|
438
|
-
|
442
|
+
multiply: 'numpad*',
|
439
443
|
add: 'numpad+',
|
440
444
|
divide: 'numpad/',
|
441
445
|
subtract: 'numpad-',
|
@@ -27,11 +27,14 @@ module Capybara::Poltergeist
|
|
27
27
|
Process.kill('KILL', pid)
|
28
28
|
else
|
29
29
|
Process.kill('TERM', pid)
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
30
|
+
start = Time.now
|
31
|
+
while Process.wait(pid, Process::WNOHANG).nil?
|
32
|
+
sleep 0.05
|
33
|
+
if (Time.now - start) > KILL_TIMEOUT
|
34
|
+
Process.kill('KILL', pid)
|
35
|
+
Process.wait(pid)
|
36
|
+
break
|
37
|
+
end
|
35
38
|
end
|
36
39
|
end
|
37
40
|
rescue Errno::ESRCH, Errno::ECHILD
|
@@ -19,7 +19,7 @@ class Poltergeist.Browser
|
|
19
19
|
if @page?
|
20
20
|
unless @page.closed
|
21
21
|
@page.clearLocalStorage() if @page.currentUrl() != 'about:blank'
|
22
|
-
@page.
|
22
|
+
@page.close()
|
23
23
|
phantom.clearCookies()
|
24
24
|
|
25
25
|
@page = @currentPage = new Poltergeist.WebPage
|
@@ -280,7 +280,7 @@ class Poltergeist.Browser
|
|
280
280
|
close_window: (handle) ->
|
281
281
|
page = @getPageByHandle(handle)
|
282
282
|
if page
|
283
|
-
page.
|
283
|
+
page.close()
|
284
284
|
@current_command.sendResponse(true)
|
285
285
|
else
|
286
286
|
@current_command.sendResponse(false)
|
@@ -520,6 +520,11 @@ class Poltergeist.Browser
|
|
520
520
|
else
|
521
521
|
@current_command.sendResponse(false)
|
522
522
|
|
523
|
+
refresh: ->
|
524
|
+
@currentPage.state = 'wait_for_loading'
|
525
|
+
@currentPage.reload()
|
526
|
+
@_waitForHistoryChange()
|
527
|
+
|
523
528
|
set_url_whitelist: (wildcards...)->
|
524
529
|
@currentPage.urlWhitelist = (@_wildcardToRegexp(wc) for wc in wildcards)
|
525
530
|
@current_command.sendResponse(true)
|
@@ -23,7 +23,7 @@ Poltergeist.Browser = (function() {
|
|
23
23
|
if (this.page.currentUrl() !== 'about:blank') {
|
24
24
|
this.page.clearLocalStorage();
|
25
25
|
}
|
26
|
-
this.page.
|
26
|
+
this.page.close();
|
27
27
|
}
|
28
28
|
phantom.clearCookies();
|
29
29
|
}
|
@@ -384,7 +384,7 @@ Poltergeist.Browser = (function() {
|
|
384
384
|
var page;
|
385
385
|
page = this.getPageByHandle(handle);
|
386
386
|
if (page) {
|
387
|
-
page.
|
387
|
+
page.close();
|
388
388
|
return this.current_command.sendResponse(true);
|
389
389
|
} else {
|
390
390
|
return this.current_command.sendResponse(false);
|
@@ -715,6 +715,12 @@ Poltergeist.Browser = (function() {
|
|
715
715
|
}
|
716
716
|
};
|
717
717
|
|
718
|
+
Browser.prototype.refresh = function() {
|
719
|
+
this.currentPage.state = 'wait_for_loading';
|
720
|
+
this.currentPage.reload();
|
721
|
+
return this._waitForHistoryChange();
|
722
|
+
};
|
723
|
+
|
718
724
|
Browser.prototype.set_url_whitelist = function() {
|
719
725
|
var wc, wildcards;
|
720
726
|
wildcards = 1 <= arguments.length ? slice.call(arguments, 0) : [];
|
@@ -7,7 +7,7 @@ Poltergeist.WebPage = (function() {
|
|
7
7
|
|
8
8
|
WebPage.CALLBACKS = ['onConsoleMessage', 'onError', 'onLoadFinished', 'onInitialized', 'onLoadStarted', 'onResourceRequested', 'onResourceReceived', 'onResourceError', 'onNavigationRequested', 'onUrlChanged', 'onPageCreated', 'onClosing'];
|
9
9
|
|
10
|
-
WebPage.DELEGATES = ['open', 'sendEvent', 'uploadFile', '
|
10
|
+
WebPage.DELEGATES = ['open', 'sendEvent', 'uploadFile', 'render', 'close', 'renderBase64', 'goBack', 'goForward', 'reload'];
|
11
11
|
|
12
12
|
WebPage.COMMANDS = ['currentUrl', 'find', 'nodeCall', 'documentSize', 'beforeUpload', 'afterUpload', 'clearLocalStorage'];
|
13
13
|
|
@@ -5,8 +5,8 @@ class Poltergeist.WebPage
|
|
5
5
|
'onNavigationRequested', 'onUrlChanged', 'onPageCreated',
|
6
6
|
'onClosing']
|
7
7
|
|
8
|
-
@DELEGATES = ['open', 'sendEvent', 'uploadFile', '
|
9
|
-
'renderBase64', 'goBack', 'goForward']
|
8
|
+
@DELEGATES = ['open', 'sendEvent', 'uploadFile', 'render', 'close',
|
9
|
+
'renderBase64', 'goBack', 'goForward', 'reload']
|
10
10
|
|
11
11
|
@COMMANDS = ['currentUrl', 'find', 'nodeCall', 'documentSize',
|
12
12
|
'beforeUpload', 'afterUpload', 'clearLocalStorage']
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: poltergeist
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.16.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jon Leighton
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-08-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capybara
|