capybara-lockstep 2.0.0 → 2.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +10 -0
- data/Gemfile.lock +1 -1
- data/README.md +1 -1
- data/lib/capybara-lockstep/client.rb +6 -1
- data/lib/capybara-lockstep/configuration.rb +1 -1
- data/lib/capybara-lockstep/logging.rb +1 -1
- data/lib/capybara-lockstep/page_access.rb +1 -1
- data/lib/capybara-lockstep/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 495d3ed978e831569eb691423ab97e79b4a354e415ce7247c7fba01916bce60a
|
4
|
+
data.tar.gz: bb51f4acfbd6cbe7b19f3e326d7e8d771004babe1ed415ca9f283c1301822ac9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
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
|
@@ -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
|
|
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.
|
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
|
+
date: 2023-12-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capybara
|