capybara-lockstep 2.0.0 → 2.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a9d5a9ec157f65f4efb9be5ac2b33c5447552eb70e8d118438a7aad763c57492
4
- data.tar.gz: 2ddde2a3b51079603d8368f0ebbe81d5205d473beeaf301bb6bdd42c80c968d3
3
+ metadata.gz: 495d3ed978e831569eb691423ab97e79b4a354e415ce7247c7fba01916bce60a
4
+ data.tar.gz: bb51f4acfbd6cbe7b19f3e326d7e8d771004babe1ed415ca9f283c1301822ac9
5
5
  SHA512:
6
- metadata.gz: b7d8723fe020460efad2e46555be0cf50d38e7398103e7462b8d0c21ac8260ee312bd8f7987e1a04ca471d6acb167b6b1e21565ef5ba73b19d021711bbb8743a
7
- data.tar.gz: e364cdf67046d885d2f3b27404e258a37388cba10edb1f1f83f286fbc7023ff73f872558dfb33862e95ff6df2f3516bcd687a78094b27a4468ec86cc55a6032a
6
+ metadata.gz: aeb726459feb3f529e02bc8cc5d8c8cd5afe2377d7906ff5e78485137770ad851cfa7e9a175a3f9ff59bbf2deb4a8fc0d14a06af584928e552a8d25bba3ddc43
7
+ data.tar.gz: 8f6955613d8a1073dcfeb26d003a22c0694462bdbab917ae66f31b11bbca2af36d5164394e4eafd18157b57d5684d7c9ae2afce4c0693230f91aca7c532d8528
data/CHANGELOG.md CHANGED
@@ -3,6 +3,16 @@ 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.2
7
+
8
+ - Fix a bug where setting a logger object with `Capybara::Lockstep.debug = logger` would crash (by @dorianmarie).
9
+
10
+
11
+ # 2.0.1
12
+
13
+ - Don't crash when an interaction closes the window (tab).
14
+
15
+
6
16
  # 2.0.0
7
17
 
8
18
  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.2)
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
@@ -35,7 +35,7 @@ module Capybara
35
35
  end
36
36
 
37
37
  send_config_to_browser(<<~JS)
38
- CapybaraLockstep.debug = #{value.to_json}
38
+ CapybaraLockstep.debug = #{debug?.to_json}
39
39
  JS
40
40
 
41
41
  @debug
@@ -6,7 +6,7 @@ module Capybara
6
6
  message = "[capybara-lockstep] #{message}"
7
7
  if is_logger?(Lockstep.debug)
8
8
  # If someone set Capybara::Lockstep.debug to a logger, use that
9
- Lockstep.debug(message)
9
+ Lockstep.debug.debug(message)
10
10
  else
11
11
  # Otherwise print to STDOUT
12
12
  puts message
@@ -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.2"
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.2
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-12-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capybara