e2e 0.4.0 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +17 -0
- data/config/rubocop.yml +6 -0
- data/gemfiles/rails_7.0.gemfile.lock +2 -2
- data/gemfiles/rails_7.1.gemfile.lock +2 -2
- data/gemfiles/rails_7.2.gemfile.lock +2 -2
- data/gemfiles/rails_8.0.gemfile.lock +2 -2
- data/lefthook.yml +3 -0
- data/lib/e2e/matchers.rb +96 -2
- data/lib/e2e/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 342adef1a62250902049417eea009bda8913b09cbe1647d6296252a95247c63c
|
|
4
|
+
data.tar.gz: bebb9795471ba014c145be81a02d134ea79f7516e2937dcc2b6597e6a4e0e5a8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d10e9a9b09628ea51b0b286b72deaf567d625368c5dd63c955c61d6aa47986644f63c5e4b469c18e19242e40d186bd571f15199e7fe943a37452b97494bee78b
|
|
7
|
+
data.tar.gz: f64645a7f01ecb1f8ad66bd7b0782b8b111afefcaa92eb021a290695d36d1c217bc47b8073ef380a1aa64cc08ef141a7f2fdf16b744665aceac22a5afcdac628
|
data/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,23 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.4.2] - 2026-02-07
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
|
|
14
|
+
- RuboCop configuration now correctly disables `Capybara/SpecificFinders` cop for E2E tests, preventing false positive suggestions to use `find_by_id` (which is not supported by this gem)
|
|
15
|
+
|
|
16
|
+
## [0.4.1] - 2026-02-07
|
|
17
|
+
|
|
18
|
+
### Added
|
|
19
|
+
|
|
20
|
+
- `have_no_content` / `have_no_text` matchers with auto-waiting support
|
|
21
|
+
- `have_no_current_path` matcher with auto-waiting support
|
|
22
|
+
|
|
23
|
+
### Fixed
|
|
24
|
+
|
|
25
|
+
- `have_current_path` (and its negation) no longer crashes on invalid URIs (e.g., `data:` URLs)
|
|
26
|
+
|
|
10
27
|
## [0.4.0] - 2026-02-06
|
|
11
28
|
|
|
12
29
|
### Added
|
data/config/rubocop.yml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: ..
|
|
3
3
|
specs:
|
|
4
|
-
e2e (0.4.
|
|
4
|
+
e2e (0.4.2)
|
|
5
5
|
playwright-ruby-client (>= 1.40.0)
|
|
6
6
|
rack
|
|
7
7
|
rackup
|
|
@@ -335,7 +335,7 @@ CHECKSUMS
|
|
|
335
335
|
diff-lcs (1.6.2) sha256=9ae0d2cba7d4df3075fe8cd8602a8604993efc0dfa934cff568969efb1909962
|
|
336
336
|
docile (1.4.1) sha256=96159be799bfa73cdb721b840e9802126e4e03dfc26863db73647204c727f21e
|
|
337
337
|
drb (2.2.3) sha256=0b00d6fdb50995fe4a45dea13663493c841112e4068656854646f418fda13373
|
|
338
|
-
e2e (0.4.
|
|
338
|
+
e2e (0.4.2)
|
|
339
339
|
erb (6.0.1) sha256=28ecdd99c5472aebd5674d6061e3c6b0a45c049578b071e5a52c2a7f13c197e5
|
|
340
340
|
erubi (1.13.1) sha256=a082103b0885dbc5ecf1172fede897f9ebdb745a4b97a5e8dc63953db1ee4ad9
|
|
341
341
|
globalid (1.3.0) sha256=05c639ad6eb4594522a0b07983022f04aa7254626ab69445a0e493aa3786ff11
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: ..
|
|
3
3
|
specs:
|
|
4
|
-
e2e (0.4.
|
|
4
|
+
e2e (0.4.2)
|
|
5
5
|
playwright-ruby-client (>= 1.40.0)
|
|
6
6
|
rack
|
|
7
7
|
rackup
|
|
@@ -349,7 +349,7 @@ CHECKSUMS
|
|
|
349
349
|
diff-lcs (1.6.2) sha256=9ae0d2cba7d4df3075fe8cd8602a8604993efc0dfa934cff568969efb1909962
|
|
350
350
|
docile (1.4.1) sha256=96159be799bfa73cdb721b840e9802126e4e03dfc26863db73647204c727f21e
|
|
351
351
|
drb (2.2.3) sha256=0b00d6fdb50995fe4a45dea13663493c841112e4068656854646f418fda13373
|
|
352
|
-
e2e (0.4.
|
|
352
|
+
e2e (0.4.2)
|
|
353
353
|
erb (6.0.1) sha256=28ecdd99c5472aebd5674d6061e3c6b0a45c049578b071e5a52c2a7f13c197e5
|
|
354
354
|
erubi (1.13.1) sha256=a082103b0885dbc5ecf1172fede897f9ebdb745a4b97a5e8dc63953db1ee4ad9
|
|
355
355
|
globalid (1.3.0) sha256=05c639ad6eb4594522a0b07983022f04aa7254626ab69445a0e493aa3786ff11
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: ..
|
|
3
3
|
specs:
|
|
4
|
-
e2e (0.4.
|
|
4
|
+
e2e (0.4.2)
|
|
5
5
|
playwright-ruby-client (>= 1.40.0)
|
|
6
6
|
rack
|
|
7
7
|
rackup
|
|
@@ -343,7 +343,7 @@ CHECKSUMS
|
|
|
343
343
|
diff-lcs (1.6.2) sha256=9ae0d2cba7d4df3075fe8cd8602a8604993efc0dfa934cff568969efb1909962
|
|
344
344
|
docile (1.4.1) sha256=96159be799bfa73cdb721b840e9802126e4e03dfc26863db73647204c727f21e
|
|
345
345
|
drb (2.2.3) sha256=0b00d6fdb50995fe4a45dea13663493c841112e4068656854646f418fda13373
|
|
346
|
-
e2e (0.4.
|
|
346
|
+
e2e (0.4.2)
|
|
347
347
|
erb (6.0.1) sha256=28ecdd99c5472aebd5674d6061e3c6b0a45c049578b071e5a52c2a7f13c197e5
|
|
348
348
|
erubi (1.13.1) sha256=a082103b0885dbc5ecf1172fede897f9ebdb745a4b97a5e8dc63953db1ee4ad9
|
|
349
349
|
globalid (1.3.0) sha256=05c639ad6eb4594522a0b07983022f04aa7254626ab69445a0e493aa3786ff11
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: ..
|
|
3
3
|
specs:
|
|
4
|
-
e2e (0.4.
|
|
4
|
+
e2e (0.4.2)
|
|
5
5
|
playwright-ruby-client (>= 1.40.0)
|
|
6
6
|
rack
|
|
7
7
|
rackup
|
|
@@ -339,7 +339,7 @@ CHECKSUMS
|
|
|
339
339
|
diff-lcs (1.6.2) sha256=9ae0d2cba7d4df3075fe8cd8602a8604993efc0dfa934cff568969efb1909962
|
|
340
340
|
docile (1.4.1) sha256=96159be799bfa73cdb721b840e9802126e4e03dfc26863db73647204c727f21e
|
|
341
341
|
drb (2.2.3) sha256=0b00d6fdb50995fe4a45dea13663493c841112e4068656854646f418fda13373
|
|
342
|
-
e2e (0.4.
|
|
342
|
+
e2e (0.4.2)
|
|
343
343
|
erb (6.0.1) sha256=28ecdd99c5472aebd5674d6061e3c6b0a45c049578b071e5a52c2a7f13c197e5
|
|
344
344
|
erubi (1.13.1) sha256=a082103b0885dbc5ecf1172fede897f9ebdb745a4b97a5e8dc63953db1ee4ad9
|
|
345
345
|
globalid (1.3.0) sha256=05c639ad6eb4594522a0b07983022f04aa7254626ab69445a0e493aa3786ff11
|
data/lefthook.yml
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
pre-commit:
|
|
2
2
|
parallel: true
|
|
3
3
|
commands:
|
|
4
|
+
gemfile:
|
|
5
|
+
glob: "{Gemfile,e2e.gemspec,lib/e2e/version.rb}"
|
|
6
|
+
run: bundle install && git add Gemfile.lock
|
|
4
7
|
appraisal:
|
|
5
8
|
glob: "{Gemfile,e2e.gemspec,lib/e2e/version.rb}"
|
|
6
9
|
run: bundle exec appraisal install && git add gemfiles/*.lock
|
data/lib/e2e/matchers.rb
CHANGED
|
@@ -51,12 +51,54 @@ if defined?(RSpec::Matchers)
|
|
|
51
51
|
|
|
52
52
|
RSpec::Matchers.alias_matcher :have_content, :have_text
|
|
53
53
|
|
|
54
|
+
RSpec::Matchers.define :have_no_text do |expected_text|
|
|
55
|
+
match do |actual|
|
|
56
|
+
@actual_text = nil
|
|
57
|
+
|
|
58
|
+
E2E.wait_until do
|
|
59
|
+
@actual_text = actual.text
|
|
60
|
+
if expected_text.is_a?(Regexp)
|
|
61
|
+
!@actual_text.match?(expected_text)
|
|
62
|
+
else
|
|
63
|
+
!@actual_text.include?(expected_text)
|
|
64
|
+
end
|
|
65
|
+
end
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
match_when_negated do |actual|
|
|
69
|
+
E2E.wait_until do
|
|
70
|
+
@actual_text = actual.text
|
|
71
|
+
if expected_text.is_a?(Regexp)
|
|
72
|
+
@actual_text.match?(expected_text)
|
|
73
|
+
else
|
|
74
|
+
@actual_text.include?(expected_text)
|
|
75
|
+
end
|
|
76
|
+
end
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
failure_message do
|
|
80
|
+
"expected not to find text #{expected_text.inspect} in #{@actual_text.inspect}"
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
failure_message_when_negated do
|
|
84
|
+
"expected to find text #{expected_text.inspect} in #{@actual_text.inspect}"
|
|
85
|
+
end
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
RSpec::Matchers.alias_matcher :have_no_content, :have_no_text
|
|
89
|
+
|
|
54
90
|
RSpec::Matchers.define :have_current_path do |expected_path|
|
|
55
91
|
match do |session|
|
|
56
92
|
@actual_path = nil
|
|
57
93
|
|
|
58
94
|
E2E.wait_until do
|
|
59
|
-
|
|
95
|
+
url = session.current_url
|
|
96
|
+
@actual_path = begin
|
|
97
|
+
URI.parse(url).path
|
|
98
|
+
rescue URI::InvalidURIError
|
|
99
|
+
url
|
|
100
|
+
end
|
|
101
|
+
|
|
60
102
|
if expected_path.is_a?(Regexp)
|
|
61
103
|
@actual_path.match?(expected_path)
|
|
62
104
|
else
|
|
@@ -67,7 +109,13 @@ if defined?(RSpec::Matchers)
|
|
|
67
109
|
|
|
68
110
|
match_when_negated do |session|
|
|
69
111
|
E2E.wait_until do
|
|
70
|
-
|
|
112
|
+
url = session.current_url
|
|
113
|
+
@actual_path = begin
|
|
114
|
+
URI.parse(url).path
|
|
115
|
+
rescue URI::InvalidURIError
|
|
116
|
+
url
|
|
117
|
+
end
|
|
118
|
+
|
|
71
119
|
if expected_path.is_a?(Regexp)
|
|
72
120
|
!@actual_path.match?(expected_path)
|
|
73
121
|
else
|
|
@@ -85,6 +133,52 @@ if defined?(RSpec::Matchers)
|
|
|
85
133
|
end
|
|
86
134
|
end
|
|
87
135
|
|
|
136
|
+
RSpec::Matchers.define :have_no_current_path do |expected_path|
|
|
137
|
+
match do |session|
|
|
138
|
+
@actual_path = nil
|
|
139
|
+
|
|
140
|
+
E2E.wait_until do
|
|
141
|
+
url = session.current_url
|
|
142
|
+
@actual_path = begin
|
|
143
|
+
URI.parse(url).path
|
|
144
|
+
rescue URI::InvalidURIError
|
|
145
|
+
url
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
if expected_path.is_a?(Regexp)
|
|
149
|
+
!@actual_path.match?(expected_path)
|
|
150
|
+
else
|
|
151
|
+
@actual_path != expected_path
|
|
152
|
+
end
|
|
153
|
+
end
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
match_when_negated do |session|
|
|
157
|
+
E2E.wait_until do
|
|
158
|
+
url = session.current_url
|
|
159
|
+
@actual_path = begin
|
|
160
|
+
URI.parse(url).path
|
|
161
|
+
rescue URI::InvalidURIError
|
|
162
|
+
url
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
if expected_path.is_a?(Regexp)
|
|
166
|
+
@actual_path.match?(expected_path)
|
|
167
|
+
else
|
|
168
|
+
@actual_path == expected_path
|
|
169
|
+
end
|
|
170
|
+
end
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
failure_message do
|
|
174
|
+
"expected current path not to be #{expected_path.inspect}, but was #{@actual_path.inspect}"
|
|
175
|
+
end
|
|
176
|
+
|
|
177
|
+
failure_message_when_negated do
|
|
178
|
+
"expected current path to be #{expected_path.inspect}, but it was"
|
|
179
|
+
end
|
|
180
|
+
end
|
|
181
|
+
|
|
88
182
|
RSpec::Matchers.define :have_value do |expected_value|
|
|
89
183
|
match do |element|
|
|
90
184
|
element.value == expected_value
|
data/lib/e2e/version.rb
CHANGED