capybara-lockstep 2.0.0 → 2.0.1

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
  SHA256:
3
- metadata.gz: a9d5a9ec157f65f4efb9be5ac2b33c5447552eb70e8d118438a7aad763c57492
4
- data.tar.gz: 2ddde2a3b51079603d8368f0ebbe81d5205d473beeaf301bb6bdd42c80c968d3
3
+ metadata.gz: fec95c22e010d3c9f9fbf5c9625a2660267de90a80da2a395355a9aa6ffe292e
4
+ data.tar.gz: 80b6ccc788241ca29aec1eddc2e0a5faa85ce5122fda16ba000b9980ca921270
5
5
  SHA512:
6
- metadata.gz: b7d8723fe020460efad2e46555be0cf50d38e7398103e7462b8d0c21ac8260ee312bd8f7987e1a04ca471d6acb167b6b1e21565ef5ba73b19d021711bbb8743a
7
- data.tar.gz: e364cdf67046d885d2f3b27404e258a37388cba10edb1f1f83f286fbc7023ff73f872558dfb33862e95ff6df2f3516bcd687a78094b27a4468ec86cc55a6032a
6
+ metadata.gz: bb4df421a7b648a20950d56c91bfdf3ed6c3155a5fe93a9808bb48de550a31820a17a265306957df3cbed7fc3b119b9dd643be05aea372bec33dcff131dcfb18
7
+ data.tar.gz: 8f5dcb3934037d1cccf3c03257a00c4d8fa45b1797d0261fd74a19b3f787f9034b9966064eed25be3fc556cc4be5ecfbf930508893c9b973b6a5cb2f70c3e38e
data/CHANGELOG.md CHANGED
@@ -3,6 +3,11 @@ All notable changes to this project will be documented in this file.
3
3
  This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
4
4
 
5
5
 
6
+ # 2.0.1
7
+
8
+ - Don't crash when an interaction closes the window (tab).
9
+
10
+
6
11
  # 2.0.0
7
12
 
8
13
  This major release detects many additional sources of flaky tests:
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- capybara-lockstep (2.0.0)
4
+ capybara-lockstep (2.0.1)
5
5
  activesupport (>= 4.2)
6
6
  capybara (>= 3.0)
7
7
  ruby2_keywords
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # capybara-lockstep
1
+ # capybara-lockstep [![Tests](https://github.com/makandra/capybara-lockstep/actions/workflows/test.yml/badge.svg)](https://github.com/makandra/capybara-lockstep/actions)
2
2
 
3
3
  This Ruby gem synchronizes [Capybara](https://github.com/teamcapybara/capybara) commands with client-side JavaScript and AJAX requests. This greatly improves the stability of an end-to-end ("E2E") test suite, even if that suite has timing issues.
4
4
 
@@ -7,6 +7,7 @@ module Capybara
7
7
  ERROR_SNIPPET_MISSING = 'Cannot synchronize: capybara-lockstep JavaScript snippet is missing'
8
8
  ERROR_PAGE_MISSING = 'Cannot synchronize with empty page'
9
9
  ERROR_ALERT_OPEN = 'Cannot synchronize while an alert is open'
10
+ ERROR_WINDOW_CLOSED = 'Cannot synchronize with closed window'
10
11
  ERROR_NAVIGATED_AWAY = "Browser navigated away while synchronizing"
11
12
 
12
13
  SYNCHRONIZED_IVAR = :@lockstep_synchronized_client
@@ -94,7 +95,11 @@ module Capybara
94
95
  end
95
96
  rescue ::Selenium::WebDriver::Error::UnexpectedAlertOpenError
96
97
  log ERROR_ALERT_OPEN
97
- # Don't raise an error, this will happen in an innocent test.
98
+ # Don't raise an error, this will happen in an innocent test where a click opens an alert.
99
+ # We will retry on the next Capybara synchronize call.
100
+ rescue ::Selenium::WebDriver::Error::NoSuchWindowError
101
+ log ERROR_WINDOW_CLOSED
102
+ # Don't raise an error, this will happen in an innocent test where a click closes a window.
98
103
  # We will retry on the next Capybara synchronize call.
99
104
  rescue ::Selenium::WebDriver::Error::JavascriptError => e
100
105
  # When the URL changes while a script is running, my current selenium-webdriver
@@ -19,7 +19,7 @@ module Capybara
19
19
  # to its `getLog` API. This causes Selenium to time out with a `Net::ReadTimeout` error
20
20
  page.driver.browser.switch_to.alert
21
21
  true
22
- rescue Capybara::NotSupportedByDriverError, ::Selenium::WebDriver::Error::NoSuchAlertError
22
+ rescue Capybara::NotSupportedByDriverError, ::Selenium::WebDriver::Error::NoSuchAlertError, ::Selenium::WebDriver::Error::NoSuchWindowError
23
23
  false
24
24
  end
25
25
 
@@ -1,5 +1,5 @@
1
1
  module Capybara
2
2
  module Lockstep
3
- VERSION = "2.0.0"
3
+ VERSION = "2.0.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capybara-lockstep
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Henning Koch
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-11-24 00:00:00.000000000 Z
11
+ date: 2023-11-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capybara