capybara-lockstep 2.0.1 → 2.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +12 -0
- data/Gemfile.lock +1 -1
- data/README.md +1 -1
- data/lib/capybara-lockstep/configuration.rb +1 -1
- data/lib/capybara-lockstep/helper.js +4 -1
- data/lib/capybara-lockstep/helper.rb +6 -5
- data/lib/capybara-lockstep/logging.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: bc0373be228e0d19b35174656617d256a469fb1f652728eaa031b91a9370aa38
|
4
|
+
data.tar.gz: 45a3b441340e1cf477564f47af7961799ac0cf37e533a42393c89a08744f1657
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b3c3f17a3a6b1e32b43ee86106294b9351bc312234070f4308e93dce8dfeae4198831f04c50e20ca37fc533ecbf1f77b51fe11e24c1336f2866018380052e07a
|
7
|
+
data.tar.gz: 64b39c510daba699db4c0204caa5004e8d367c3e6208a9b2d0a7912925e4dd7c5223e3caf516633310c7f41dbf524af0520715c5051c1d0ead3f8494a0bb0a75
|
data/CHANGELOG.md
CHANGED
@@ -3,6 +3,18 @@ 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.3
|
7
|
+
|
8
|
+
- Fix a bug where we wouldn't wait for an additional JavaScript task after a tracked event or async job.
|
9
|
+
- Fix a bug where the `Capybara::Lockstep.wait_tasks` configuration would be ignored.
|
10
|
+
- Fix a bug where the `capybara_lockstep_js` helper (for use without Rails) would not include the current configuration.
|
11
|
+
|
12
|
+
|
13
|
+
# 2.0.2
|
14
|
+
|
15
|
+
- Fix a bug where setting a logger object with `Capybara::Lockstep.debug = logger` would crash (by @dorianmarie).
|
16
|
+
|
17
|
+
|
6
18
|
# 2.0.1
|
7
19
|
|
8
20
|
- Don't crash when an interaction closes the window (tab).
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -377,7 +377,7 @@ It is theoretically possible that your test will observe the browser in that win
|
|
377
377
|
Any issues caused by this will usually be mitigated by Capybara's retry logic. **If** you think that this is an issue for your test suite, you can configure capybara-headless to wait additional tasks before it considers the browser to be idle:
|
378
378
|
|
379
379
|
```ruby
|
380
|
-
Capybara::Lockstep.wait_tasks = 2
|
380
|
+
Capybara::Lockstep.wait_tasks = 2 # default is 1
|
381
381
|
```
|
382
382
|
|
383
383
|
If you see longer chains of `then()` or nested `setTimeout()` calls in your code, you may need to configure a higher number of tasks to wait.
|
@@ -257,7 +257,10 @@ window.CapybaraLockstep = (function() {
|
|
257
257
|
|
258
258
|
function afterWaitTasks(fn, tasksLeft = waitTasks) {
|
259
259
|
if (tasksLeft > 0) {
|
260
|
-
|
260
|
+
// Wait 1 task and recurse
|
261
|
+
setTimeout(function() {
|
262
|
+
afterWaitTasks(fn, tasksLeft - 1)
|
263
|
+
})
|
261
264
|
} else {
|
262
265
|
fn()
|
263
266
|
}
|
@@ -3,10 +3,10 @@ module Capybara
|
|
3
3
|
module Helper
|
4
4
|
|
5
5
|
JS_PATH = File.expand_path('../helper.js', __FILE__)
|
6
|
-
|
6
|
+
HELPER_JS = IO.read(JS_PATH)
|
7
7
|
|
8
|
-
def capybara_lockstep_js
|
9
|
-
|
8
|
+
def capybara_lockstep_js(options = {})
|
9
|
+
HELPER_JS + capybara_lockstep_config_js(options)
|
10
10
|
end
|
11
11
|
|
12
12
|
def capybara_lockstep(options = {})
|
@@ -17,10 +17,11 @@ module Capybara
|
|
17
17
|
tag_options[:nonce] = options.fetch(:nonce, true)
|
18
18
|
end
|
19
19
|
|
20
|
-
|
21
|
-
javascript_tag(js, tag_options)
|
20
|
+
javascript_tag(capybara_lockstep_js(options), tag_options)
|
22
21
|
end
|
23
22
|
|
23
|
+
private
|
24
|
+
|
24
25
|
def capybara_lockstep_config_js(options = {})
|
25
26
|
js = ''
|
26
27
|
|
@@ -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
|
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.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Henning Koch
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-01-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capybara
|