Skip to content

Commit d3f6c84

Browse files
committed
chore: release 0.3.2
1 parent 037ac80 commit d3f6c84

9 files changed

Lines changed: 50 additions & 42 deletions

File tree

CHANGELOG.md

Lines changed: 28 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -5,49 +5,50 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [Unreleased]
9+
10+
## [0.3.2] - 2026-02-05
11+
12+
### Fixed
13+
14+
- `Playwright::TargetClosedError` on CI environments without X-server by only enabling debug console in headed mode
15+
- `pause` now raises a clear error when called in headless mode instead of failing silently
16+
817
## [0.3.1] - 2026-02-05
918

1019
### Fixed
1120

12-
- **RSpec Integration:** Fixed `uninitialized constant RSpec::Matchers` error when loading the gem in environments where RSpec is only partially initialized (e.g., via `Bundler.require`).
13-
- Matchers are now only defined if `RSpec::Matchers` is actually present.
14-
- Matchers are no longer automatically loaded by `require "e2e"`; they are now explicitly loaded via `require "e2e/rspec"`.
21+
- `uninitialized constant RSpec::Matchers` error when loading the gem in environments where RSpec is only partially initialized (e.g., via `Bundler.require`)
22+
- Matchers are now only defined if `RSpec::Matchers` is actually present
23+
- Matchers are no longer automatically loaded by `require "e2e"`; they are now explicitly loaded via `require "e2e/rspec"`
1524

1625
## [0.3.0] - 2026-02-05
1726

1827
### Added
1928

20-
- **Matchers:** Added custom RSpec matchers:
21-
- `have_class("class-name")`
22-
- `have_text("content")` / `have_content`
23-
- `have_value("val")`
24-
- `have_attribute("name", "val")`
25-
- `be_visible`
26-
- `be_checked`
27-
- `be_disabled` / `be_enabled`
28-
- **Element API:** Added `classes`, `has_class?`, `visible?`, `[]`, `value`, `checked?`, `disabled?`, `enabled?`.
29-
- **Debugging:** Improved debugging documentation and fixed `pause` helper.
29+
- Custom RSpec matchers: `have_class`, `have_text`/`have_content`, `have_value`, `have_attribute`, `be_visible`, `be_checked`, `be_disabled`/`be_enabled`
30+
- Element API methods: `classes`, `has_class?`, `visible?`, `[]`, `value`, `checked?`, `disabled?`, `enabled?`
31+
- Improved debugging documentation and fixed `pause` helper
3032

3133
## [0.2.0] - 2026-02-05
3234

3335
### Added
3436

35-
- **Browser Switching:** Support for Chromium, Firefox, and WebKit via `E2E.config.browser_type`.
36-
- **Dynamic Session Management:** `E2E.reset_session!` to handle browser switching mid-suite.
37-
- **Generators:**
38-
- `rails g e2e:install` now detects test framework (RSpec/Minitest) and injects RuboCop config.
39-
- `rails g e2e:test` scaffolds test files based on the detected framework.
40-
- **Minitest Support:** Full integration via `E2E::Minitest::TestCase`.
41-
- **RuboCop Integration:** Automatic injection of `inherit_gem` to relax rules for E2E specs.
42-
- **Debugging:** `pause` helper for calling Playwright Inspector.
37+
- Browser switching support for Chromium, Firefox, and WebKit via `E2E.config.browser_type`
38+
- `E2E.reset_session!` for dynamic session management
39+
- `rails g e2e:install` generator with test framework detection (RSpec/Minitest) and RuboCop config injection
40+
- `rails g e2e:test` generator for scaffolding test files
41+
- Minitest support via `E2E::Minitest::TestCase`
42+
- RuboCop integration with automatic `inherit_gem` injection
43+
- `pause` helper for Playwright Inspector
4344

4445
## [0.1.0] - 2026-02-05
4546

4647
### Added
4748

48-
- **Core:** Initial release of `e2e` gem, a unified testing framework wrapper around Playwright.
49-
- **Drivers:** Playwright driver implementation using `playwright-ruby-client` (IPC/Pipes).
50-
- **DSL:** Capybara-like API including `visit`, `click_button`, `click_link`, `fill_in`, `check`, `uncheck`, `attach_file`, `find`, `all`.
51-
- **Performance:** `E2E.enable_shared_connection!` for supporting fast transactional tests in Rails.
52-
- **Rails Integration:** Rack application booting (`E2E.config.app`).
53-
- **RSpec Support:** Basic RSpec integration (`type: :e2e`).
49+
- Initial release of `e2e` gem, a unified testing framework wrapper around Playwright
50+
- Playwright driver implementation using `playwright-ruby-client` (IPC/Pipes)
51+
- Capybara-like DSL: `visit`, `click_button`, `click_link`, `fill_in`, `check`, `uncheck`, `attach_file`, `find`, `all`
52+
- `E2E.enable_shared_connection!` for fast transactional tests in Rails
53+
- Rack application booting via `E2E.config.app`
54+
- Basic RSpec integration (`type: :e2e`)

Gemfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: .
33
specs:
4-
e2e (0.3.1)
4+
e2e (0.3.2)
55
playwright-ruby-client (>= 1.40.0)
66
rack
77
rackup
@@ -148,7 +148,7 @@ CHECKSUMS
148148
date (3.5.1) sha256=750d06384d7b9c15d562c76291407d89e368dda4d4fff957eb94962d325a0dc0
149149
diff-lcs (1.6.2) sha256=9ae0d2cba7d4df3075fe8cd8602a8604993efc0dfa934cff568969efb1909962
150150
docile (1.4.1) sha256=96159be799bfa73cdb721b840e9802126e4e03dfc26863db73647204c727f21e
151-
e2e (0.3.1)
151+
e2e (0.3.2)
152152
erb (6.0.1) sha256=28ecdd99c5472aebd5674d6061e3c6b0a45c049578b071e5a52c2a7f13c197e5
153153
io-console (0.8.2) sha256=d6e3ae7a7cc7574f4b8893b4fca2162e57a825b223a177b7afa236c5ef9814cc
154154
irb (1.16.0) sha256=2abe56c9ac947cdcb2f150572904ba798c1e93c890c256f8429981a7675b0806

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,23 +269,27 @@ end
269269
```
270270

271271
### Multiple Browsers
272+
272273
One of the key advantages of Playwright is true cross-browser testing. You can easily switch engines:
273274

274275
- **Chromium:** Google Chrome, Microsoft Edge, etc.
275276
- **Firefox:** Mozilla Firefox.
276277
- **WebKit:** Safari, iOS browsers.
277278

278279
To test in Safari (WebKit):
280+
279281
```ruby
280282
E2E.configure { |config| config.browser_type = :webkit }
281283
```
282284

283285
Don't forget to install all browser binaries:
286+
284287
```bash
285288
npx playwright install
286289
```
287290

288291
### Switching Browsers per Test (RSpec)
292+
289293
You can run specific tests in different browsers using metadata (requires simple setup in your helper).
290294

291295
First, update your `spec/e2e_helper.rb` to respect metadata:
@@ -299,7 +303,7 @@ RSpec.configure do |config|
299303
E2E.reset_session! # Force new browser launch
300304
end
301305
end
302-
306+
303307
config.after(:each) do
304308
if E2E.config.browser_type != :chromium
305309
E2E.config.browser_type = :chromium

gemfiles/rails_7.0.gemfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: ..
33
specs:
4-
e2e (0.3.1)
4+
e2e (0.3.2)
55
playwright-ruby-client (>= 1.40.0)
66
rack
77
rackup
@@ -335,7 +335,7 @@ CHECKSUMS
335335
diff-lcs (1.6.2) sha256=9ae0d2cba7d4df3075fe8cd8602a8604993efc0dfa934cff568969efb1909962
336336
docile (1.4.1) sha256=96159be799bfa73cdb721b840e9802126e4e03dfc26863db73647204c727f21e
337337
drb (2.2.3) sha256=0b00d6fdb50995fe4a45dea13663493c841112e4068656854646f418fda13373
338-
e2e (0.3.1)
338+
e2e (0.3.2)
339339
erb (6.0.1) sha256=28ecdd99c5472aebd5674d6061e3c6b0a45c049578b071e5a52c2a7f13c197e5
340340
erubi (1.13.1) sha256=a082103b0885dbc5ecf1172fede897f9ebdb745a4b97a5e8dc63953db1ee4ad9
341341
globalid (1.3.0) sha256=05c639ad6eb4594522a0b07983022f04aa7254626ab69445a0e493aa3786ff11

gemfiles/rails_7.1.gemfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: ..
33
specs:
4-
e2e (0.3.1)
4+
e2e (0.3.2)
55
playwright-ruby-client (>= 1.40.0)
66
rack
77
rackup
@@ -349,7 +349,7 @@ CHECKSUMS
349349
diff-lcs (1.6.2) sha256=9ae0d2cba7d4df3075fe8cd8602a8604993efc0dfa934cff568969efb1909962
350350
docile (1.4.1) sha256=96159be799bfa73cdb721b840e9802126e4e03dfc26863db73647204c727f21e
351351
drb (2.2.3) sha256=0b00d6fdb50995fe4a45dea13663493c841112e4068656854646f418fda13373
352-
e2e (0.3.1)
352+
e2e (0.3.2)
353353
erb (6.0.1) sha256=28ecdd99c5472aebd5674d6061e3c6b0a45c049578b071e5a52c2a7f13c197e5
354354
erubi (1.13.1) sha256=a082103b0885dbc5ecf1172fede897f9ebdb745a4b97a5e8dc63953db1ee4ad9
355355
globalid (1.3.0) sha256=05c639ad6eb4594522a0b07983022f04aa7254626ab69445a0e493aa3786ff11

gemfiles/rails_7.2.gemfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: ..
33
specs:
4-
e2e (0.3.1)
4+
e2e (0.3.2)
55
playwright-ruby-client (>= 1.40.0)
66
rack
77
rackup
@@ -343,7 +343,7 @@ CHECKSUMS
343343
diff-lcs (1.6.2) sha256=9ae0d2cba7d4df3075fe8cd8602a8604993efc0dfa934cff568969efb1909962
344344
docile (1.4.1) sha256=96159be799bfa73cdb721b840e9802126e4e03dfc26863db73647204c727f21e
345345
drb (2.2.3) sha256=0b00d6fdb50995fe4a45dea13663493c841112e4068656854646f418fda13373
346-
e2e (0.3.1)
346+
e2e (0.3.2)
347347
erb (6.0.1) sha256=28ecdd99c5472aebd5674d6061e3c6b0a45c049578b071e5a52c2a7f13c197e5
348348
erubi (1.13.1) sha256=a082103b0885dbc5ecf1172fede897f9ebdb745a4b97a5e8dc63953db1ee4ad9
349349
globalid (1.3.0) sha256=05c639ad6eb4594522a0b07983022f04aa7254626ab69445a0e493aa3786ff11

gemfiles/rails_8.0.gemfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: ..
33
specs:
4-
e2e (0.3.1)
4+
e2e (0.3.2)
55
playwright-ruby-client (>= 1.40.0)
66
rack
77
rackup
@@ -339,7 +339,7 @@ CHECKSUMS
339339
diff-lcs (1.6.2) sha256=9ae0d2cba7d4df3075fe8cd8602a8604993efc0dfa934cff568969efb1909962
340340
docile (1.4.1) sha256=96159be799bfa73cdb721b840e9802126e4e03dfc26863db73647204c727f21e
341341
drb (2.2.3) sha256=0b00d6fdb50995fe4a45dea13663493c841112e4068656854646f418fda13373
342-
e2e (0.3.1)
342+
e2e (0.3.2)
343343
erb (6.0.1) sha256=28ecdd99c5472aebd5674d6061e3c6b0a45c049578b071e5a52c2a7f13c197e5
344344
erubi (1.13.1) sha256=a082103b0885dbc5ecf1172fede897f9ebdb745a4b97a5e8dc63953db1ee4ad9
345345
globalid (1.3.0) sha256=05c639ad6eb4594522a0b07983022f04aa7254626ab69445a0e493aa3786ff11

lib/e2e/drivers/playwright.rb

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,12 @@ def initialize
1212
browser_type_name = E2E.config.browser_type || :chromium
1313
@browser_type = @playwright.send(browser_type_name)
1414

15-
@browser = @browser_type.launch(headless: E2E.config.headless)
15+
@headless = E2E.config.headless
16+
@browser = @browser_type.launch(headless: @headless)
1617
@context = @browser.new_context
1718

18-
# Enable debug console to allow page.pause
19-
@context.enable_debug_console!
19+
# Enable debug console to allow page.pause (requires GUI, so only in headed mode)
20+
@context.enable_debug_console! unless @headless
2021

2122
@page = @context.new_page
2223
end
@@ -90,6 +91,8 @@ def native
9091
end
9192

9293
def pause
94+
raise E2E::Error, "pause is not available in headless mode" if @headless
95+
9396
@page.pause
9497
end
9598

lib/e2e/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# frozen_string_literal: true
22

33
module E2E
4-
VERSION = "0.3.1"
4+
VERSION = "0.3.2"
55
end

0 commit comments

Comments
 (0)