playwright-ruby-client 1.58.0 → 1.58.1.alpha1
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/AGENTS.md +4 -0
- data/CLAUDE/api_generation.md +28 -0
- data/CLAUDE/ci_expectations.md +23 -0
- data/CLAUDE/gem_release_flow.md +39 -0
- data/CLAUDE/past_upgrade_pr_patterns.md +42 -0
- data/CLAUDE/playwright_upgrade_workflow.md +35 -0
- data/CLAUDE/rspec_debugging.md +30 -0
- data/CLAUDE/unimplemented_examples.md +18 -0
- data/CLAUDE.md +32 -0
- data/lib/playwright/channel_owners/tracing.rb +15 -6
- data/lib/playwright/version.rb +1 -1
- metadata +10 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 78c64e38b462ad2449eda1349128c44ae6dbe7adae66570b76cd886e005f418f
|
|
4
|
+
data.tar.gz: d410ab0adf418bbf8f43925984a95663b7f947519b85e9afa93bec64daf76f06
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 319787778e82280859a291247e01b4fc5626b12974e9d7e08fd7331beb596696f15cc83c09d9b6f2cb5a76c15ef30308cc9e9eb7f2f16462188d08bc72546ddc
|
|
7
|
+
data.tar.gz: df5b988a9124a42006720bee860c3ebc91804ebc9ce396a922b0dbd0e1a1c81798912cd42530f91dcde49da83432b60be17cded55408548d7e795a7991b8276b
|
data/AGENTS.md
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# API Generation
|
|
2
|
+
|
|
3
|
+
## Source of generated artifacts
|
|
4
|
+
|
|
5
|
+
- Input: `development/api.json`
|
|
6
|
+
- Generator script: `development/generate_api.rb`
|
|
7
|
+
|
|
8
|
+
## Generated outputs
|
|
9
|
+
|
|
10
|
+
- `lib/playwright_api/*.rb`
|
|
11
|
+
- `documentation/docs/api/**/*.md`
|
|
12
|
+
- `documentation/docs/include/api_coverage.md`
|
|
13
|
+
- `sig/playwright.rbs`
|
|
14
|
+
- `development/unimplemented_examples.md`
|
|
15
|
+
|
|
16
|
+
## Critical rules
|
|
17
|
+
|
|
18
|
+
- `lib/playwright_api/` is not tracked by Git (`lib/playwright_api/.gitignore` only).
|
|
19
|
+
- Do not manually edit `lib/playwright_api/*.rb`.
|
|
20
|
+
- Re-run `development/generate_api.rb` whenever API specs change.
|
|
21
|
+
|
|
22
|
+
## Typical command set
|
|
23
|
+
|
|
24
|
+
```sh
|
|
25
|
+
rm lib/playwright_api/*.rb
|
|
26
|
+
find documentation/docs -name "*.md" | grep -v documentation/docs/article/ | xargs rm
|
|
27
|
+
bundle exec ruby development/generate_api.rb
|
|
28
|
+
```
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# CI Expectations
|
|
2
|
+
|
|
3
|
+
## Main guardrails
|
|
4
|
+
|
|
5
|
+
`/.github/workflows/check.yml` detects stale generated artifacts.
|
|
6
|
+
|
|
7
|
+
Checked paths:
|
|
8
|
+
|
|
9
|
+
- `development/api.json`
|
|
10
|
+
- `documentation/docs/**`
|
|
11
|
+
- `development/unimplemented_examples.md`
|
|
12
|
+
|
|
13
|
+
## Practical implication
|
|
14
|
+
|
|
15
|
+
- If API-related code changes, regenerate artifacts before finishing.
|
|
16
|
+
- If you open a PR without regeneration, `check.yml` will likely fail.
|
|
17
|
+
|
|
18
|
+
## Related workflows
|
|
19
|
+
|
|
20
|
+
- `/.github/workflows/rspec.yml`
|
|
21
|
+
- `/.github/workflows/deploy.yml`
|
|
22
|
+
|
|
23
|
+
These workflows also depend on `bundle exec ruby development/generate_api.rb`.
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Gem Release Flow
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
Pushing a Git tag triggers `.github/workflows/deploy.yml`, which builds and publishes the gem to RubyGems.
|
|
6
|
+
|
|
7
|
+
## Tag format
|
|
8
|
+
|
|
9
|
+
The deploy workflow triggers on tags matching these patterns:
|
|
10
|
+
|
|
11
|
+
- `X.Y.Z` — stable release (e.g. `1.58.0`)
|
|
12
|
+
- `X.Y.betaN` — beta release (e.g. `1.58.beta1`)
|
|
13
|
+
- `X.Y.Z.alphaN` — alpha release (e.g. `1.58.1.alpha1`)
|
|
14
|
+
|
|
15
|
+
## Steps to release
|
|
16
|
+
|
|
17
|
+
1. Update `lib/playwright/version.rb`:
|
|
18
|
+
- Set `Playwright::VERSION` to the target version string.
|
|
19
|
+
- `COMPATIBLE_PLAYWRIGHT_VERSION` stays at the base Playwright version.
|
|
20
|
+
|
|
21
|
+
2. Commit the version change.
|
|
22
|
+
|
|
23
|
+
3. Create and push a Git tag matching the version exactly:
|
|
24
|
+
```sh
|
|
25
|
+
git tag 1.58.1.alpha1
|
|
26
|
+
git push origin 1.58.1.alpha1
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
4. The deploy workflow will:
|
|
30
|
+
- Check out the tagged commit.
|
|
31
|
+
- Verify `Playwright::VERSION == RELEASE_TAG` (must match exactly).
|
|
32
|
+
- Run `bundle exec ruby development/generate_api.rb` to generate API code.
|
|
33
|
+
- Run `rake build` to build the gem.
|
|
34
|
+
- Push the gem to RubyGems using the `RUBYGEMS_API_KEY` secret.
|
|
35
|
+
|
|
36
|
+
## Important notes
|
|
37
|
+
|
|
38
|
+
- The `Playwright::VERSION` in `lib/playwright/version.rb` **must exactly match** the Git tag name. If they differ, the deploy job fails at the version check step.
|
|
39
|
+
- Alpha/beta tags do NOT require a separate branch — they can be tagged on any commit.
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# Past Upgrade PR Patterns
|
|
2
|
+
|
|
3
|
+
Common patterns observed from `Update Playwright driver to 1.xx.x` PRs reviewed with `gh`.
|
|
4
|
+
|
|
5
|
+
## PR sample
|
|
6
|
+
|
|
7
|
+
- `#366` (1.58.0)
|
|
8
|
+
- `#360` (1.57.0)
|
|
9
|
+
- `#354` (1.56.1)
|
|
10
|
+
- `#348` (1.55.0)
|
|
11
|
+
- `#341` (1.54.1)
|
|
12
|
+
- `#336` (1.53.0)
|
|
13
|
+
- `#331` (1.52.0)
|
|
14
|
+
- `#327` (1.51.0)
|
|
15
|
+
|
|
16
|
+
## Frequently changed files
|
|
17
|
+
|
|
18
|
+
Almost every time:
|
|
19
|
+
|
|
20
|
+
- `development/CLI_VERSION`
|
|
21
|
+
- `development/api.json`
|
|
22
|
+
- `lib/playwright/version.rb`
|
|
23
|
+
|
|
24
|
+
High frequency:
|
|
25
|
+
|
|
26
|
+
- `documentation/docs/api/*.md`
|
|
27
|
+
- `documentation/docs/include/api_coverage.md`
|
|
28
|
+
- `development/generate_api/example_codes.rb`
|
|
29
|
+
- `spec/integration/example_spec.rb`
|
|
30
|
+
- `lib/playwright/channel_owners/page.rb`
|
|
31
|
+
- `lib/playwright/locator_impl.rb`
|
|
32
|
+
|
|
33
|
+
Sometimes:
|
|
34
|
+
|
|
35
|
+
- `development/generate_api.rb`
|
|
36
|
+
- `development/unimplemented_examples.md`
|
|
37
|
+
|
|
38
|
+
## Work style trend
|
|
39
|
+
|
|
40
|
+
- The first commit often updates version files and generated API artifacts.
|
|
41
|
+
- Follow-up commits often add/update specs and then implement `lib/playwright/**` changes.
|
|
42
|
+
- Broader upstream changes usually increase docs/example/assets updates.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Playwright Upgrade Workflow
|
|
2
|
+
|
|
3
|
+
## Scope
|
|
4
|
+
|
|
5
|
+
Standard process for `Update Playwright driver to 1.xx.x` tasks.
|
|
6
|
+
|
|
7
|
+
## Order (Do not reorder)
|
|
8
|
+
|
|
9
|
+
1. Update versions
|
|
10
|
+
- `development/CLI_VERSION`
|
|
11
|
+
- `lib/playwright/version.rb` (`VERSION`, `COMPATIBLE_PLAYWRIGHT_VERSION`)
|
|
12
|
+
|
|
13
|
+
2. Update API definition
|
|
14
|
+
- Set `PLAYWRIGHT_CLI_EXECUTABLE_PATH`
|
|
15
|
+
- `$PLAYWRIGHT_CLI_EXECUTABLE_PATH print-api-json | jq . > development/api.json`
|
|
16
|
+
|
|
17
|
+
3. Clean before generation + regenerate
|
|
18
|
+
- `rm lib/playwright_api/*.rb`
|
|
19
|
+
- `find documentation/docs -name "*.md" | grep -v documentation/docs/article/ | xargs rm`
|
|
20
|
+
- `bundle exec ruby development/generate_api.rb`
|
|
21
|
+
|
|
22
|
+
4. Update tests first
|
|
23
|
+
- Add/update `spec/` changes that represent upstream behavior differences.
|
|
24
|
+
|
|
25
|
+
5. Implement
|
|
26
|
+
- Apply minimal implementation changes in `lib/playwright/**`.
|
|
27
|
+
|
|
28
|
+
6. Run tests
|
|
29
|
+
- `bundle exec rspec`
|
|
30
|
+
- Run focused specs first while iterating, then run the full suite.
|
|
31
|
+
|
|
32
|
+
## Notes
|
|
33
|
+
|
|
34
|
+
- During upgrade work, prefer the steps in `development/README.md`.
|
|
35
|
+
- `development/update_playwright_driver.sh` can be used as a helper script.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# RSpec Debugging
|
|
2
|
+
|
|
3
|
+
## Critical execution rule
|
|
4
|
+
|
|
5
|
+
- Run RSpec via `rbenv exec`.
|
|
6
|
+
- Some environments fail with plain `bundle exec rspec`, so always use `rbenv exec bundle exec rspec ...`.
|
|
7
|
+
|
|
8
|
+
## Debug rule when spec fails
|
|
9
|
+
|
|
10
|
+
- On failure, rerun with `DEBUG=1`.
|
|
11
|
+
- Use `DEBUG=1` output to inspect Playwright protocol logs and isolate the issue.
|
|
12
|
+
|
|
13
|
+
## Example
|
|
14
|
+
|
|
15
|
+
```sh
|
|
16
|
+
rbenv exec bundle exec rspec spec/integration/page/aria_snapshot_ai_spec.rb
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
```sh
|
|
20
|
+
DEBUG=1 rbenv exec bundle exec rspec spec/integration/page/aria_snapshot_ai_spec.rb
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Node.js Playwright protocol log
|
|
24
|
+
|
|
25
|
+
- Node.js Playwright protocol logs can be captured with `DEBUG=pw:*`.
|
|
26
|
+
- This is useful when comparing behavior against the Ruby client.
|
|
27
|
+
|
|
28
|
+
```sh
|
|
29
|
+
DEBUG=pw:* node script.mjs 2>&1 | head -200
|
|
30
|
+
```
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# unimplemented_examples.md
|
|
2
|
+
|
|
3
|
+
## What it is
|
|
4
|
+
|
|
5
|
+
- `development/unimplemented_examples.md` is a generated artifact.
|
|
6
|
+
- It lists examples from API docs that could not be converted to Ruby examples.
|
|
7
|
+
|
|
8
|
+
## How examples are converted
|
|
9
|
+
|
|
10
|
+
- Source: API doc comments
|
|
11
|
+
- Conversion rules: `development/generate_api/example_codes.rb`
|
|
12
|
+
- Unmapped examples remain in Python in docs and are listed in `development/unimplemented_examples.md`.
|
|
13
|
+
|
|
14
|
+
## When this file changes
|
|
15
|
+
|
|
16
|
+
1. Review the diff to identify unmapped examples.
|
|
17
|
+
2. Add conversion mappings to `development/generate_api/example_codes.rb` when needed.
|
|
18
|
+
3. Re-run `bundle exec ruby development/generate_api.rb`.
|
data/CLAUDE.md
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# CLAUDE.md
|
|
2
|
+
|
|
3
|
+
This file contains only the checks that must be verified first.
|
|
4
|
+
For detailed rules, see `CLAUDE/*.md`.
|
|
5
|
+
|
|
6
|
+
## Must Check First
|
|
7
|
+
|
|
8
|
+
1. Determine first whether the task is a Playwright version upgrade.
|
|
9
|
+
2. Confirm generated-code handling.
|
|
10
|
+
- `lib/playwright_api/*.rb` is auto-generated by `development/generate_api.rb`.
|
|
11
|
+
- `lib/playwright_api/` is not tracked by Git. Do not edit generated files manually.
|
|
12
|
+
3. Confirm change order.
|
|
13
|
+
- For version upgrade work, update tests first, then implement `lib/playwright/**`.
|
|
14
|
+
4. Confirm generation and diff consistency.
|
|
15
|
+
- Update `development/api.json`, run generation, and verify generated diffs.
|
|
16
|
+
5. Confirm CI-required generated files.
|
|
17
|
+
- `development/api.json`
|
|
18
|
+
- `documentation/docs/**`
|
|
19
|
+
- `development/unimplemented_examples.md`
|
|
20
|
+
6. Confirm RSpec execution mode (critical).
|
|
21
|
+
- Run RSpec via `rbenv exec`.
|
|
22
|
+
- On failure, rerun with `DEBUG=1` and inspect protocol logs.
|
|
23
|
+
|
|
24
|
+
## Topic Docs
|
|
25
|
+
|
|
26
|
+
- `CLAUDE/playwright_upgrade_workflow.md`
|
|
27
|
+
- `CLAUDE/api_generation.md`
|
|
28
|
+
- `CLAUDE/unimplemented_examples.md`
|
|
29
|
+
- `CLAUDE/ci_expectations.md`
|
|
30
|
+
- `CLAUDE/past_upgrade_pr_patterns.md`
|
|
31
|
+
- `CLAUDE/rspec_debugging.md`
|
|
32
|
+
- `CLAUDE/gem_release_flow.md`
|
|
@@ -23,7 +23,8 @@ module Playwright
|
|
|
23
23
|
@is_tracing = true
|
|
24
24
|
@connection.set_in_tracing(true)
|
|
25
25
|
end
|
|
26
|
-
|
|
26
|
+
local_utils = @connection.local_utils
|
|
27
|
+
@stacks_id = local_utils&.tracing_started(@traces_dir, trace_name)
|
|
27
28
|
end
|
|
28
29
|
|
|
29
30
|
def stop_chunk(path: nil)
|
|
@@ -40,20 +41,26 @@ module Playwright
|
|
|
40
41
|
@is_tracing = false
|
|
41
42
|
@connection.set_in_tracing(false)
|
|
42
43
|
end
|
|
44
|
+
local_utils = @connection.local_utils
|
|
43
45
|
|
|
44
46
|
unless file_path
|
|
45
47
|
# Not interested in any artifacts
|
|
46
48
|
@channel.send_message_to_server('tracingStopChunk', mode: 'discard')
|
|
47
49
|
if @stacks_id
|
|
48
|
-
|
|
50
|
+
local_utils.trace_discarded(@stacks_id) if local_utils
|
|
49
51
|
end
|
|
50
52
|
|
|
51
53
|
return
|
|
52
54
|
end
|
|
53
55
|
|
|
54
|
-
|
|
56
|
+
is_local = !@connection.remote?
|
|
57
|
+
if is_local
|
|
58
|
+
unless local_utils
|
|
59
|
+
raise 'Cannot save trace because localUtils is unavailable.'
|
|
60
|
+
end
|
|
61
|
+
|
|
55
62
|
result = @channel.send_message_to_server_result('tracingStopChunk', mode: 'entries')
|
|
56
|
-
|
|
63
|
+
local_utils.zip(
|
|
57
64
|
zipFile: file_path,
|
|
58
65
|
entries: result['entries'],
|
|
59
66
|
stacksId: @stacks_id,
|
|
@@ -69,7 +76,7 @@ module Playwright
|
|
|
69
76
|
# The artifact may be missing if the browser closed while stopping tracing.
|
|
70
77
|
unless result['artifact']
|
|
71
78
|
if @stacks_id
|
|
72
|
-
|
|
79
|
+
local_utils.trace_discarded(@stacks_id) if local_utils
|
|
73
80
|
end
|
|
74
81
|
|
|
75
82
|
return
|
|
@@ -80,7 +87,9 @@ module Playwright
|
|
|
80
87
|
artifact.save_as(file_path)
|
|
81
88
|
artifact.delete
|
|
82
89
|
|
|
83
|
-
|
|
90
|
+
return unless local_utils
|
|
91
|
+
|
|
92
|
+
local_utils.zip(
|
|
84
93
|
zipFile: file_path,
|
|
85
94
|
entries: [],
|
|
86
95
|
stacksId: @stacks_id,
|
data/lib/playwright/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: playwright-ruby-client
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.58.
|
|
4
|
+
version: 1.58.1.alpha1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- YusukeIwaki
|
|
@@ -226,6 +226,15 @@ extensions: []
|
|
|
226
226
|
extra_rdoc_files: []
|
|
227
227
|
files:
|
|
228
228
|
- ".rspec"
|
|
229
|
+
- AGENTS.md
|
|
230
|
+
- CLAUDE.md
|
|
231
|
+
- CLAUDE/api_generation.md
|
|
232
|
+
- CLAUDE/ci_expectations.md
|
|
233
|
+
- CLAUDE/gem_release_flow.md
|
|
234
|
+
- CLAUDE/past_upgrade_pr_patterns.md
|
|
235
|
+
- CLAUDE/playwright_upgrade_workflow.md
|
|
236
|
+
- CLAUDE/rspec_debugging.md
|
|
237
|
+
- CLAUDE/unimplemented_examples.md
|
|
229
238
|
- CODE_OF_CONDUCT.md
|
|
230
239
|
- CONTRIBUTING.md
|
|
231
240
|
- Gemfile
|