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 +4 -4
- data/CHANGELOG.md +5 -0
- data/Gemfile.lock +1 -1
- data/README.md +1 -1
- data/lib/capybara-lockstep/client.rb +6 -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: fec95c22e010d3c9f9fbf5c9625a2660267de90a80da2a395355a9aa6ffe292e
|
4
|
+
data.tar.gz: 80b6ccc788241ca29aec1eddc2e0a5faa85ce5122fda16ba000b9980ca921270
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
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
|
|
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.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-
|
11
|
+
date: 2023-11-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capybara
|