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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 83bb04d3f05ad64c5a1b5b213d89acce146434b3
4
- data.tar.gz: 6b566336fff00fff1f62fe1161e55beb45e713ce
3
+ metadata.gz: 6638e15d99597aff8640e53f7664ccbe63aa0767
4
+ data.tar.gz: 68af8a941ebdde61b19c314de194237f31c1f9c9
5
5
  SHA512:
6
- metadata.gz: 159c3e618bd128c033e6746738e725b6e4f7cd2be5a9b7da53455c09c58c6f48d98a2eaf4dd0087b355a6259489d419be989bb6df89f5c7d86485a33c7217de2
7
- data.tar.gz: bd0c8a67bf6e392e2aff5e5a6cc0e65d818c173e1879d8d6dc1ffc282d4bcc48374fcf6943ff30283e981d6398489125bd7151f7ecf1e8ced971c445ec108dfc
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.15.0).](https://github.com/teampoltergeist/poltergeist/tree/v1.15.0)**
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.9.8-linux-i686.tar.bz2)
57
- or [64 bit](https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.8-linux-x86_64.tar.bz2)
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
- mulitply: 'numpad*',
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
- begin
31
- Timeout.timeout(KILL_TIMEOUT) { Process.wait(pid) }
32
- rescue Timeout::Error
33
- Process.kill('KILL', pid)
34
- Process.wait(pid)
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.release()
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.release()
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.release();
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.release();
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', 'release', 'render', 'renderBase64', 'goBack', 'goForward'];
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', 'release', 'render',
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']
@@ -361,6 +361,10 @@ module Capybara::Poltergeist
361
361
  browser.go_forward
362
362
  end
363
363
 
364
+ def refresh
365
+ browser.refresh
366
+ end
367
+
364
368
  def accept_modal(type, options = {})
365
369
  case type
366
370
  when :confirm
@@ -1,5 +1,5 @@
1
1
  module Capybara
2
2
  module Poltergeist
3
- VERSION = "1.15.0"
3
+ VERSION = "1.16.0"
4
4
  end
5
5
  end
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.15.0
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-05-01 00:00:00.000000000 Z
11
+ date: 2017-08-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capybara