capybara-experience 0.3.3 → 0.3.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +2 -0
- data/capybara-experience.gemspec +1 -0
- data/lib/capybara/experience/pool.rb +4 -3
- data/lib/capybara/experience/rspec.rb +5 -3
- data/lib/capybara/experience/version.rb +1 -1
- data/lib/capybara/experience.rb +8 -2
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 84a97377aa40b425565277472cb8508fd305f9288b77876f40e760291b623eda
|
4
|
+
data.tar.gz: c47a957680c97755d48f47df1430b111e920bf79a06e1e64ba0e9e53a4260b41
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b5b283908c6c0076883a8bad1e6dab873cb643e5109fb071f539a4cc12fe3844f52e4e92a5c4b96b0739ff00989e6abdb170725045f850ac22ab0de223c4ee6b
|
7
|
+
data.tar.gz: d544901d7cd5b30600b37f8ebfce1e074e028c805b776a4813a034f71ef4f79193e52a3b42d63d74ea64cf3f16c2fe2ba3875c9f592bb585ebbbcbe1b67251ce
|
data/Gemfile
CHANGED
data/capybara-experience.gemspec
CHANGED
@@ -28,6 +28,7 @@ Gem::Specification.new do |spec|
|
|
28
28
|
spec.add_development_dependency "bundler", "~> 2.0"
|
29
29
|
spec.add_development_dependency "rake", "~> 10.0"
|
30
30
|
spec.add_development_dependency "rspec", "~> 3.0"
|
31
|
+
spec.add_development_dependency "sinatra", ">= 3.0.2"
|
31
32
|
|
32
33
|
spec.add_runtime_dependency "capybara", "~> 3.0"
|
33
34
|
end
|
@@ -9,7 +9,7 @@ module Capybara
|
|
9
9
|
def [](key)
|
10
10
|
super(key) || begin
|
11
11
|
driver, _session_name, app_object_id = key.split(":")
|
12
|
-
take(driver: driver, app_object_id: app_object_id, key: key)
|
12
|
+
take(driver: driver.to_sym, app_object_id: app_object_id.to_i, key: key)
|
13
13
|
end
|
14
14
|
end
|
15
15
|
|
@@ -36,9 +36,10 @@ module Capybara
|
|
36
36
|
end
|
37
37
|
|
38
38
|
def reset_idle!
|
39
|
-
|
40
|
-
|
39
|
+
new_hash = each_with_object({}) do |(key, session), hash|
|
40
|
+
hash[session_key(session)] = delete(key)
|
41
41
|
end
|
42
|
+
replace(new_hash)
|
42
43
|
@idle = values
|
43
44
|
|
44
45
|
nil
|
@@ -15,7 +15,9 @@ module Capybara
|
|
15
15
|
|
16
16
|
def refresh_description
|
17
17
|
metadata[:description] = metadata[:description_args].join(" ")
|
18
|
-
metadata[:full_description] =
|
18
|
+
metadata[:full_description] =
|
19
|
+
[metadata[:example_group][:full_description]]
|
20
|
+
.concat(metadata[:description_args]).join(" ")
|
19
21
|
end
|
20
22
|
|
21
23
|
def metadata
|
@@ -23,13 +25,13 @@ module Capybara
|
|
23
25
|
end
|
24
26
|
|
25
27
|
def in_continuous_integration_env?
|
26
|
-
ENV["CI"]
|
28
|
+
ENV["CI"]&.empty?
|
27
29
|
end
|
28
30
|
end
|
29
31
|
|
30
32
|
RSpec.configure do |config|
|
31
33
|
config.include BehaviorDSL
|
32
|
-
config.
|
34
|
+
config.after :each, type: :feature, js: true do
|
33
35
|
Capybara::Experience::Pool.instance.reset_idle!
|
34
36
|
end
|
35
37
|
end
|
data/lib/capybara/experience.rb
CHANGED
@@ -6,7 +6,11 @@ module Capybara
|
|
6
6
|
class Experience
|
7
7
|
include Capybara::DSL
|
8
8
|
|
9
|
-
|
9
|
+
if defined?(I18n)
|
10
|
+
def t(*arg)
|
11
|
+
I18n.t(*args)
|
12
|
+
end
|
13
|
+
end
|
10
14
|
|
11
15
|
def initialize(driver_name: nil)
|
12
16
|
@driver_name = driver_name
|
@@ -20,7 +24,9 @@ module Capybara
|
|
20
24
|
@driver_name ||= Capybara.current_driver
|
21
25
|
end
|
22
26
|
|
23
|
-
|
27
|
+
def driver
|
28
|
+
page.driver
|
29
|
+
end
|
24
30
|
|
25
31
|
def page
|
26
32
|
@page ||= Experience::Pool.instance.take(driver: driver_name)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capybara-experience
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Ong
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2022-
|
12
|
+
date: 2022-10-12 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -53,6 +53,20 @@ dependencies:
|
|
53
53
|
- - "~>"
|
54
54
|
- !ruby/object:Gem::Version
|
55
55
|
version: '3.0'
|
56
|
+
- !ruby/object:Gem::Dependency
|
57
|
+
name: sinatra
|
58
|
+
requirement: !ruby/object:Gem::Requirement
|
59
|
+
requirements:
|
60
|
+
- - ">="
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: 3.0.2
|
63
|
+
type: :development
|
64
|
+
prerelease: false
|
65
|
+
version_requirements: !ruby/object:Gem::Requirement
|
66
|
+
requirements:
|
67
|
+
- - ">="
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: 3.0.2
|
56
70
|
- !ruby/object:Gem::Dependency
|
57
71
|
name: capybara
|
58
72
|
requirement: !ruby/object:Gem::Requirement
|