spreewald 4.4.4 → 4.5.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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1920d9013d22c925f9b9b49058dc46d84228d74e79eb61cece32f1ab747e245e
|
4
|
+
data.tar.gz: 4ded87963d399820eed78316462402f2ded9c46384c073dd60dd7c24d7210f01
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d6a16084fc64d3063c095a4eb036a236c1fdf6c395bcfb42d8f418d6cf2de7a08be7628d797ca0ebadd0786eb48ee5964a5f54577eacf05dda33ac4182b1a977
|
7
|
+
data.tar.gz: 14e2db739ec6f716f23ca78a83d8b8480e889b10517776547352533919adc3f58f7225e8aa666b78520b8d4c839f7c9a2046d88c14d796621707f06da9666628
|
data/CHANGELOG.md
CHANGED
@@ -3,6 +3,9 @@ All notable changes to this project will be documented in this file.
|
|
3
3
|
|
4
4
|
This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
5
5
|
|
6
|
+
## 4.5.0
|
7
|
+
- `patiently` retries one more time in certain edge cases where the alloted time was used up within the last retry of the `patiently` block (usually by Capybara).
|
8
|
+
|
6
9
|
## 4.4.4
|
7
10
|
- Make `When /^(?:|I )attach the file "([^"]*)" to "([^"]*)"$/` compatible for Ruby 3.0.
|
8
11
|
|
@@ -39,16 +39,17 @@ module ToleranceForSeleniumSyncIssues
|
|
39
39
|
WAIT_PERIOD = 0.05
|
40
40
|
|
41
41
|
def patiently(seconds, &block)
|
42
|
-
|
42
|
+
patiently_started = monotonic_time
|
43
43
|
tries = 0
|
44
44
|
begin
|
45
45
|
tries += 1
|
46
|
+
block_started = monotonic_time
|
46
47
|
block.call
|
47
48
|
rescue Exception => e
|
48
49
|
raise e unless retryable_error?(e)
|
49
|
-
raise e if (
|
50
|
+
raise e if (block_started - patiently_started > seconds && tries >= 2)
|
50
51
|
sleep(WAIT_PERIOD)
|
51
|
-
raise Capybara::FrozenInTime, "time appears to be frozen, Capybara does not work with libraries which freeze time, consider using time travelling instead" if monotonic_time ==
|
52
|
+
raise Capybara::FrozenInTime, "time appears to be frozen, Capybara does not work with libraries which freeze time, consider using time travelling instead" if monotonic_time == patiently_started
|
52
53
|
retry
|
53
54
|
end
|
54
55
|
end
|
@@ -105,6 +105,18 @@ describe ToleranceForSeleniumSyncIssues do
|
|
105
105
|
expect(count).to be > 1
|
106
106
|
end
|
107
107
|
|
108
|
+
it 'retries the block if the given time has been used within the last retry (see issue #202)' do
|
109
|
+
count = 0
|
110
|
+
expect {
|
111
|
+
subject.patiently do
|
112
|
+
count += 1
|
113
|
+
sleep wait_time if count == 2
|
114
|
+
raise Capybara::ElementNotFound
|
115
|
+
end
|
116
|
+
}.to raise_error(Capybara::ElementNotFound)
|
117
|
+
expect(count).to be > 2
|
118
|
+
end
|
119
|
+
|
108
120
|
it 'will retry an outer patiently block if an inner patiently block took up all the time' do
|
109
121
|
try = 0
|
110
122
|
expect {
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spreewald
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tobias Kraze
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-04-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cucumber
|
@@ -354,7 +354,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
354
354
|
- !ruby/object:Gem::Version
|
355
355
|
version: '0'
|
356
356
|
requirements: []
|
357
|
-
rubygems_version: 3.4.
|
357
|
+
rubygems_version: 3.4.1
|
358
358
|
signing_key:
|
359
359
|
specification_version: 4
|
360
360
|
summary: Collection of useful cucumber steps.
|