cellenium 0.2.0__tar.gz → 0.2.1__tar.gz

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.
Files changed (71) hide show
  1. cellenium-0.2.1/.claude/commands/cellenium/artifact.md +9 -0
  2. {cellenium-0.2.0/.claude/commands/testflow → cellenium-0.2.1/.claude/commands/cellenium}/checklist/before-startup.md +2 -2
  3. {cellenium-0.2.0/.claude/commands/testflow → cellenium-0.2.1/.claude/commands/cellenium}/checklist/cruising.md +2 -2
  4. {cellenium-0.2.0/.claude/commands/testflow → cellenium-0.2.1/.claude/commands/cellenium}/checklist/fordec.md +2 -2
  5. {cellenium-0.2.0/.claude/commands/testflow → cellenium-0.2.1/.claude/commands/cellenium}/checklist/landing.md +2 -2
  6. {cellenium-0.2.0/.claude/commands/testflow → cellenium-0.2.1/.claude/commands/cellenium}/evaluator.md +2 -3
  7. {cellenium-0.2.0/.claude/commands/testflow → cellenium-0.2.1/.claude/commands/cellenium}/executor.md +2 -2
  8. cellenium-0.2.1/.claude/commands/cellenium/locator-writer.md +9 -0
  9. {cellenium-0.2.0/.claude/commands/testflow → cellenium-0.2.1/.claude/commands/cellenium}/prd-reader.md +2 -3
  10. cellenium-0.2.1/.claude/commands/cellenium/test-spec.md +8 -0
  11. {cellenium-0.2.0/.claude/commands/testflow → cellenium-0.2.1/.claude/commands/cellenium}/web.md +2 -3
  12. {cellenium-0.2.0/.claude/commands/testflow → cellenium-0.2.1/.claude/commands/cellenium}/writer.md +2 -3
  13. {cellenium-0.2.0 → cellenium-0.2.1}/PKG-INFO +15 -12
  14. {cellenium-0.2.0 → cellenium-0.2.1}/README.md +209 -206
  15. {cellenium-0.2.0 → cellenium-0.2.1}/pyproject.toml +45 -40
  16. {cellenium-0.2.0 → cellenium-0.2.1}/src/cellenium/cli.py +58 -1
  17. {cellenium-0.2.0 → cellenium-0.2.1}/tests/test_cli.py +28 -1
  18. {cellenium-0.2.0 → cellenium-0.2.1}/uv.lock +3896 -3896
  19. cellenium-0.2.0/.claude/commands/testflow/artifact.md +0 -9
  20. cellenium-0.2.0/.claude/commands/testflow/locator-writer.md +0 -10
  21. cellenium-0.2.0/.claude/commands/testflow/test-spec.md +0 -8
  22. {cellenium-0.2.0 → cellenium-0.2.1}/.claude/bin/checklist.js +0 -0
  23. {cellenium-0.2.0/.claude/skills/testflow → cellenium-0.2.1/.claude/skills/cellenium}/artifact/SKILL.md +0 -0
  24. {cellenium-0.2.0/.claude/skills/testflow → cellenium-0.2.1/.claude/skills/cellenium}/before-startup/SKILL.md +0 -0
  25. {cellenium-0.2.0/.claude/skills/testflow → cellenium-0.2.1/.claude/skills/cellenium}/cruising/SKILL.md +0 -0
  26. {cellenium-0.2.0/.claude/skills/checklist → cellenium-0.2.1/.claude/skills/cellenium}/emergency/fordec/SKILL.md +0 -0
  27. {cellenium-0.2.0/.claude/skills/testflow → cellenium-0.2.1/.claude/skills/cellenium}/evaluator/SKILL.md +0 -0
  28. {cellenium-0.2.0/.claude/skills/testflow → cellenium-0.2.1/.claude/skills/cellenium}/executor/SKILL.md +0 -0
  29. {cellenium-0.2.0/.claude/skills/testflow → cellenium-0.2.1/.claude/skills/cellenium}/landing/SKILL.md +0 -0
  30. {cellenium-0.2.0/.claude/skills/testflow → cellenium-0.2.1/.claude/skills/cellenium}/locator-writer/SKILL.md +0 -0
  31. {cellenium-0.2.0/.claude/skills/testflow → cellenium-0.2.1/.claude/skills/cellenium}/prd-reader/SKILL.md +0 -0
  32. {cellenium-0.2.0/.claude/skills/testflow → cellenium-0.2.1/.claude/skills/cellenium}/test-spec/SKILL.md +0 -0
  33. {cellenium-0.2.0/.claude/skills/testflow → cellenium-0.2.1/.claude/skills/cellenium}/web/SKILL.md +0 -0
  34. {cellenium-0.2.0/.claude/skills/testflow → cellenium-0.2.1/.claude/skills/cellenium}/writer/SKILL.md +0 -0
  35. {cellenium-0.2.0 → cellenium-0.2.1}/.claude/skills/checklist/before-startup/SKILL.md +0 -0
  36. {cellenium-0.2.0 → cellenium-0.2.1}/.claude/skills/checklist/cruising/SKILL.md +0 -0
  37. {cellenium-0.2.0/.claude/skills/testflow → cellenium-0.2.1/.claude/skills/checklist}/emergency/fordec/SKILL.md +0 -0
  38. {cellenium-0.2.0 → cellenium-0.2.1}/.claude/skills/checklist/landing/SKILL.md +0 -0
  39. {cellenium-0.2.0 → cellenium-0.2.1}/.claude/test/install.test.js +0 -0
  40. {cellenium-0.2.0 → cellenium-0.2.1}/.env.example +0 -0
  41. {cellenium-0.2.0 → cellenium-0.2.1}/.gitignore +0 -0
  42. {cellenium-0.2.0 → cellenium-0.2.1}/LICENSE +0 -0
  43. {cellenium-0.2.0 → cellenium-0.2.1}/main.py +0 -0
  44. {cellenium-0.2.0 → cellenium-0.2.1}/src/cellenium/__init__.py +0 -0
  45. {cellenium-0.2.0 → cellenium-0.2.1}/src/cellenium/ai/__init__.py +0 -0
  46. {cellenium-0.2.0 → cellenium-0.2.1}/src/cellenium/ai/agents/__init__.py +0 -0
  47. {cellenium-0.2.0 → cellenium-0.2.1}/src/cellenium/ai/agents/vision/__init__.py +0 -0
  48. {cellenium-0.2.0 → cellenium-0.2.1}/src/cellenium/ai/agents/vision/config/agents.yaml +0 -0
  49. {cellenium-0.2.0 → cellenium-0.2.1}/src/cellenium/ai/agents/vision/config/tasks.yaml +0 -0
  50. {cellenium-0.2.0 → cellenium-0.2.1}/src/cellenium/ai/agents/vision/crew.py +0 -0
  51. {cellenium-0.2.0 → cellenium-0.2.1}/src/cellenium/ai/agents/vision/schemas.py +0 -0
  52. {cellenium-0.2.0 → cellenium-0.2.1}/src/cellenium/ai/agents/vision/skills/evaluator/SKILL.md +0 -0
  53. {cellenium-0.2.0 → cellenium-0.2.1}/src/cellenium/ai/agents/vision/skills/vision/SKILL.md +0 -0
  54. {cellenium-0.2.0 → cellenium-0.2.1}/src/cellenium/ai/agents/vision/tools/vision.py +0 -0
  55. {cellenium-0.2.0 → cellenium-0.2.1}/src/cellenium/ai/config.py +0 -0
  56. {cellenium-0.2.0 → cellenium-0.2.1}/src/cellenium/ai/tools/__init__.py +0 -0
  57. {cellenium-0.2.0 → cellenium-0.2.1}/src/cellenium/ai/tools/image_encoder.py +0 -0
  58. {cellenium-0.2.0 → cellenium-0.2.1}/src/cellenium/engine/__init__.py +0 -0
  59. {cellenium-0.2.0 → cellenium-0.2.1}/src/cellenium/engine/manager.py +0 -0
  60. {cellenium-0.2.0 → cellenium-0.2.1}/src/cellenium/engine/page_engine.py +0 -0
  61. {cellenium-0.2.0 → cellenium-0.2.1}/src/cellenium/functions/__init__.py +0 -0
  62. {cellenium-0.2.0 → cellenium-0.2.1}/src/cellenium/functions/locators.py +0 -0
  63. {cellenium-0.2.0 → cellenium-0.2.1}/src/cellenium/functions/logger.py +0 -0
  64. {cellenium-0.2.0 → cellenium-0.2.1}/src/cellenium/functions/sheets.py +0 -0
  65. {cellenium-0.2.0 → cellenium-0.2.1}/src/cellenium/settings.py +0 -0
  66. {cellenium-0.2.0 → cellenium-0.2.1}/src/cellenium/templates/env.template +0 -0
  67. {cellenium-0.2.0 → cellenium-0.2.1}/tests/e2e/conftest.py +0 -0
  68. {cellenium-0.2.0 → cellenium-0.2.1}/tests/e2e/test_google_search.py +0 -0
  69. {cellenium-0.2.0 → cellenium-0.2.1}/tests/test_google_sheet_locators.py +0 -0
  70. {cellenium-0.2.0 → cellenium-0.2.1}/tests/test_page_engine.py +0 -0
  71. {cellenium-0.2.0 → cellenium-0.2.1}/tests/test_settings.py +0 -0
@@ -0,0 +1,9 @@
1
+ ---
2
+ name: artifact
3
+ description: Turn a PRD or specification into traceable pytest tests, execute them, and evaluate their quality through the complete TestFlow pipeline.
4
+ argument-hint: <PRD/spec path and test target>
5
+ command: /cellenium:artifact
6
+ ---
7
+
8
+ Before doing anything else, read `.claude/skills/cellenium/artifact/SKILL.md` (or `~/.claude/skills/cellenium/artifact/SKILL.md` if it is not in the project) and follow it as your instructions. Each stage it names lives in a sibling folder, e.g. `prd-reader` is `.claude/skills/cellenium/prd-reader/SKILL.md`; read a stage's SKILL.md before applying it.
9
+ Pass `$ARGUMENTS` as the pipeline input and complete every reachable TestFlow stage.
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: before-startup
3
3
  description: System readiness check before building tests. Use before starting TestFlow or writing any test to verify that the repository, toolchain, browsers, configuration, external services, test infrastructure, baseline, and inputs are healthy and ready for test creation.
4
- command: /before-startup
4
+ command: /cellenium:checklist:before-startup
5
5
  ---
6
6
 
7
- Invoke the Skill tool with `skill: "testflow:before-startup"` before doing anything else.
7
+ Before doing anything else, read `.claude/skills/cellenium/before-startup/SKILL.md` (or `~/.claude/skills/cellenium/before-startup/SKILL.md` if it is not in the project) and follow it as your instructions.
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: cruising
3
3
  description: In-flight check while tests are being built. Use after any TestFlow stage, after writing or changing tests, or before a commit or PR to verify that everything is in place and to hunt for critical errors and potential bugs in the tests, locators, fixtures, and observed product behavior.
4
- command: /cruising
4
+ command: /cellenium:checklist:cruising
5
5
  ---
6
6
 
7
- Invoke the Skill tool with `skill: "testflow:cruising"` before doing anything else.
7
+ Before doing anything else, read `.claude/skills/cellenium/cruising/SKILL.md` (or `~/.claude/skills/cellenium/cruising/SKILL.md` if it is not in the project) and follow it as your instructions.
@@ -6,7 +6,7 @@ description: |
6
6
  Use when a production outage, failed deploy, broken main branch,
7
7
  data corruption, security incident, or other consequential engineering
8
8
  problem needs a clear, time-aware choice, assigned actions, and active reassessment.
9
- command: /fordec
9
+ command: /cellenium:checklist:fordec
10
10
  ---
11
11
 
12
- Invoke the Skill tool with `skill: "testflow:fordec"` before doing anything else.
12
+ Before doing anything else, read `.claude/skills/cellenium/emergency/fordec/SKILL.md` (or `~/.claude/skills/cellenium/emergency/fordec/SKILL.md` if it is not in the project) and follow it as your instructions.
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: landing
3
3
  description: Final production-readiness checklist. Use before final PR approval, merge, release, or production deployment to verify the final state, compare land and go-around options, make an explicit decision, define or perform the authorized execution, and check production signals with rollback triggers.
4
- command: /landing
4
+ command: /cellenium:checklist:landing
5
5
  ---
6
6
 
7
- Invoke the Skill tool with `skill: "testflow:landing"` before doing anything else.
7
+ Before doing anything else, read `.claude/skills/cellenium/landing/SKILL.md` (or `~/.claude/skills/cellenium/landing/SKILL.md` if it is not in the project) and follow it as your instructions.
@@ -2,9 +2,8 @@
2
2
  name: evaluator
3
3
  description: Evaluate pytest tests against requirements, specifications, implementation contracts, and execution evidence.
4
4
  argument-hint: <requirements, tests, and execution results>
5
- command: /testflow:evaluator
5
+ command: /cellenium:evaluator
6
6
  ---
7
7
 
8
- Invoke the Skill tool with `skill: "testflow:evaluator"`
9
- before doing anything else. Pass `$ARGUMENTS` as the evaluation
8
+ Before doing anything else, read `.claude/skills/cellenium/evaluator/SKILL.md` (or `~/.claude/skills/cellenium/evaluator/SKILL.md` if it is not in the project) and follow it as your instructions. Pass `$ARGUMENTS` as the evaluation
10
9
  scope and return the coverage matrix, evidence-backed findings, residual risks, and verdict.
@@ -2,9 +2,9 @@
2
2
  name: executor
3
3
  description: Run repository-native pytest commands, preserve exact evidence, and classify collection, environment, test, and product failures.
4
4
  argument-hint: <test paths, node IDs, or markers>
5
- command: /testflow:executor
5
+ command: /cellenium:executor
6
6
  ---
7
7
 
8
- Invoke the Skill tool with `skill: "testflow:executor"` before doing anything else.
8
+ Before doing anything else, read `.claude/skills/cellenium/executor/SKILL.md` (or `~/.claude/skills/cellenium/executor/SKILL.md` if it is not in the project) and follow it as your instructions.
9
9
  Pass `$ARGUMENTS` as the requested test selection and report exact commands,
10
10
  results, failure classifications, and verdict.
@@ -0,0 +1,9 @@
1
+ ---
2
+ name: locator-writer
3
+ description: Discover stable Playwright locators, validate the target elements, and upsert them into the configured Google Sheets Page Object Model.
4
+ argument-hint: <page, screen, and required elements>
5
+ command: /cellenium:locator-writer
6
+ ---
7
+
8
+ Before doing anything else, read `.claude/skills/cellenium/locator-writer/SKILL.md` (or `~/.claude/skills/cellenium/locator-writer/SKILL.md` if it is not in the project) and follow it as your instructions. Pass `$ARGUMENTS` as the UI target and element requirements.
9
+ Preview updates before replacing existing non-empty sheet rows.
@@ -2,9 +2,8 @@
2
2
  name: prd-reader
3
3
  description: Extract testable, traceable pytest requirements from a PRD, feature brief, ticket, or acceptance criteria.
4
4
  argument-hint: <PRD path, issue, or requirements>
5
- command: /testflow:prd-reader
5
+ command: /cellenium:prd-reader
6
6
  ---
7
7
 
8
- Invoke the Skill tool with `skill: "testflow:prd-reader"`
9
- before doing anything else. Pass `$ARGUMENTS` as the product
8
+ Before doing anything else, read `.claude/skills/cellenium/prd-reader/SKILL.md` (or `~/.claude/skills/cellenium/prd-reader/SKILL.md` if it is not in the project) and follow it as your instructions. Pass `$ARGUMENTS` as the product
10
9
  source and return the requirement matrix without running downstream stages.
@@ -0,0 +1,8 @@
1
+ ---
2
+ name: test-spec
3
+ description: Convert requirements and technical specifications into a complete, traceable pytest test specification.
4
+ argument-hint: <requirements/spec path and target>
5
+ command: /cellenium:test-spec
6
+ ---
7
+
8
+ Before doing anything else, read `.claude/skills/cellenium/test-spec/SKILL.md` (or `~/.claude/skills/cellenium/test-spec/SKILL.md` if it is not in the project) and follow it as your instructions. Pass `$ARGUMENTS` as specification context and return the test strategy, cases, file plan, environment contract, and traceability map.
@@ -2,10 +2,9 @@
2
2
  name: web
3
3
  description: Explore a live web application in a real browser to discover and document reproducible potential bugs with evidence.
4
4
  argument-hint: <URL, scope, role, and optional PRD/spec>
5
- command: /testflow:web
5
+ command: /cellenium:web
6
6
  ---
7
7
 
8
- Invoke the Skill tool with `skill: "testflow:web"`
9
- before doing anything else. Pass `$ARGUMENTS` as the exploration charter.
8
+ Before doing anything else, read `.claude/skills/cellenium/web/SKILL.md` (or `~/.claude/skills/cellenium/web/SKILL.md` if it is not in the project) and follow it as your instructions. Pass `$ARGUMENTS` as the exploration charter.
10
9
  Use a real browser, preserve safety boundaries,
11
10
  and return verified findings plus regression-test candidates without modifying application code.
@@ -2,9 +2,8 @@
2
2
  name: writer
3
3
  description: Implement approved test cases as deterministic, behavior-focused pytest tests that follow repository conventions.
4
4
  argument-hint: <test specification and target>
5
- command: /testflow:writer
5
+ command: /cellenium:writer
6
6
  ---
7
7
 
8
- Invoke the Skill tool with `skill: "testflow:writer"`
9
- before doing anything else. Pass `$ARGUMENTS` as the
8
+ Before doing anything else, read `.claude/skills/cellenium/writer/SKILL.md` (or `~/.claude/skills/cellenium/writer/SKILL.md` if it is not in the project) and follow it as your instructions. Pass `$ARGUMENTS` as the
10
9
  approved test specification, write the pytest tests, and return collection plus targeted execution evidence.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: cellenium
3
- Version: 0.2.0
3
+ Version: 0.2.1
4
4
  Summary: Playwright browser automation with a Google Sheets Page Object Model and CrewAI vision analysis
5
5
  Project-URL: Homepage, https://github.com/MedviJenka/cellenium-playwright
6
6
  License-File: LICENSE
@@ -70,12 +70,15 @@ uv run playwright install --with-deps chromium
70
70
  In the project where you use cellenium, run:
71
71
 
72
72
  ```sh
73
- cellenium init # writes a .env template, adds .env and credentials.json to .gitignore, installs Chromium
73
+ cellenium init # writes a .env template, adds .env and credentials.json to .gitignore, installs Chromium and the Claude Code commands
74
+ cellenium claude # (re)installs the /cellenium:* Claude Code commands and skills into .claude/
74
75
  cellenium doctor # checks settings, credentials.json, Google Sheet access, and that Chromium launches
75
76
  ```
76
77
 
77
78
  `cellenium init --with-deps` also installs Chromium's system libraries (Linux/CI). `cellenium doctor --offline` skips opening the sheet; it exits non-zero when a check fails, so it can gate CI.
78
79
 
80
+ `cellenium claude --global` installs the commands into `~/.claude` so they are available in every project; locally modified files are kept unless you pass `--force`. Restart Claude Code after installing. `cellenium init --skip-claude` skips this step.
81
+
79
82
  Settings are read from `.env` in the working directory or from environment variables:
80
83
 
81
84
  ```dotenv
@@ -182,14 +185,14 @@ claude plugin validate .
182
185
  Run Claude Code from the repository and invoke either the complete pipeline or an individual stage:
183
186
 
184
187
  ```text
185
- /testflow:web
186
- /testflow:artifact
187
- /testflow:prd-reader
188
- /testflow:test-spec
189
- /testflow:locator-writer
190
- /testflow:writer
191
- /testflow:executor
192
- /testflow:evaluator
188
+ /cellenium:web
189
+ /cellenium:artifact
190
+ /cellenium:prd-reader
191
+ /cellenium:test-spec
192
+ /cellenium:locator-writer
193
+ /cellenium:writer
194
+ /cellenium:executor
195
+ /cellenium:evaluator
193
196
  ```
194
197
 
195
198
  The skills are manual-only. The locator writer previews changes before replacing existing Google Sheet selectors and verifies selectors against the live UI.
@@ -200,9 +203,9 @@ The separate checklist skills live under `.claude/skills/checklist/`: `before-st
200
203
 
201
204
  ```text
202
205
  .github/workflows/ GitHub Actions CI
203
- .claude/skills/testflow/ Pytest TestFlow skill definitions
206
+ .claude/skills/cellenium/ Pytest TestFlow skill definitions
204
207
  .claude/skills/checklist/ Checklist skills (before-startup, cruising, landing, fordec)
205
- .claude/commands/testflow/ TestFlow slash-command entries
208
+ .claude/commands/cellenium/ TestFlow slash-command entries
206
209
  .claude-plugin/plugin.json Claude Code plugin metadata
207
210
  src/core/engine/ Playwright browser and page engines
208
211
  src/core/functions/ Locator resolution and direct Google Sheets access
@@ -1,206 +1,209 @@
1
- # Cellenium Playwright
2
-
3
- Cellenium Playwright is an experimental Python browser-automation toolkit built on [Playwright](https://playwright.dev/python/). It provides browser lifecycle management, a Google-Sheets-backed Page Object Model (POM), screenshot capture, and components for structured visual analysis with CrewAI.
4
-
5
- The repository also contains **TestFlow**, a set of Claude Code skills that turns product requirements and technical specifications into traceable pytest tests, validated UI locators, execution evidence, and a test-quality verdict.
6
-
7
- > **Status:** active development. The browser and locator layers are usable, but the checked-in vision test is still a scaffold and does not currently pass. Install it from PyPI with `pip install cellenium` (or `uv add cellenium`), then run `playwright install chromium`. Configuration (`.env`, `credentials.json`) is read from your project's working directory.
8
-
9
- ## Features
10
-
11
- - Synchronous Chromium, Firefox, or WebKit sessions through Playwright.
12
- - Reusable `PageEngine` helpers for navigation, locators, screenshots, scrolling, dropdowns, and tabs.
13
- - Page Object Model data read directly from Google Sheets at runtime.
14
- - Locator strategies for name, XPath, ID, CSS, class name, link text, and tag name.
15
- - Structured image-analysis components built with CrewAI and Pydantic.
16
- - Parallel pytest execution in CI on Python 3.13 and 3.14.
17
- - Optional TestFlow skills for end-to-end pytest test generation and evaluation.
18
-
19
- ## Requirements
20
-
21
- - Python 3.13 or 3.14
22
- - [`uv`](https://docs.astral.sh/uv/)
23
- - A Playwright-supported browser
24
- - A Google service account for resolving locators
25
- - An OpenAI-compatible model and API key when using the vision components
26
-
27
- ## Quick start
28
-
29
- Clone the repository and install the locked dependencies:
30
-
31
- ```sh
32
- git clone https://github.com/MedviJenka/cellenium-playwright.git
33
- cd cellenium-playwright
34
- uv sync --frozen
35
- ```
36
-
37
- Install Chromium:
38
-
39
- ```sh
40
- uv run playwright install chromium
41
- ```
42
-
43
- On Ubuntu or another Debian-based CI runner, install Chromium and its system dependencies together:
44
-
45
- ```sh
46
- uv run playwright install --with-deps chromium
47
- ```
48
-
49
- ## Configuration
50
-
51
- In the project where you use cellenium, run:
52
-
53
- ```sh
54
- cellenium init # writes a .env template, adds .env and credentials.json to .gitignore, installs Chromium
55
- cellenium doctor # checks settings, credentials.json, Google Sheet access, and that Chromium launches
56
- ```
57
-
58
- `cellenium init --with-deps` also installs Chromium's system libraries (Linux/CI). `cellenium doctor --offline` skips opening the sheet; it exits non-zero when a check fails, so it can gate CI.
59
-
60
- Settings are read from `.env` in the working directory or from environment variables:
61
-
62
- ```dotenv
63
- GOOGLE_SHEETS=<spreadsheet-edit-url>
64
- CREDENTIALS_JSON=credentials.json
65
- OPENAI_MODEL=<model-name>
66
- OPENAI_API_KEY=<optional-api-key>
67
- LOGFIRE_TOKEN=<optional-logfire-token>
68
- TEST_HEADLESS=true
69
- ```
70
-
71
- `GOOGLE_SHEETS` selects the locator spreadsheet. When `LOGFIRE_TOKEN` is omitted, logging remains local and no data is sent to Logfire.
72
-
73
- Save the Google service-account key as `credentials.json` and share the locator spreadsheet with its `client_email` as a viewer (`cellenium doctor` prints the address). Never commit `.env` or `credentials.json`.
74
-
75
- ## Google Sheets Page Object Model
76
-
77
- Each worksheet tab represents one screen. The first row must contain these columns:
78
-
79
- | Column | Purpose |
80
- |---|---|
81
- | `name` | Logical element name used by tests |
82
- | `locator` | Locator strategy such as `NAME`, `XPATH`, `ID`, or `CSS` |
83
- | `type` | Locator value; this name is retained for compatibility with the source sheet |
84
- | `actions` | Optional metadata |
85
- | `comments` | Optional notes |
86
-
87
- Example worksheet:
88
-
89
- | name | locator | type | actions | comments |
90
- |---|---|---|---|---|
91
- | search | NAME | q | fill | Google search field |
92
- | button | NAME | btnK | click | Search button |
93
-
94
- `PageEngine(screen="Google")` reads locator rows directly from the worksheet tab
95
- named `Google`. No generated JSON mapping or synchronization step is required.
96
-
97
- ## Browser automation
98
-
99
- ```python
100
- from src.core.engine.page_engine import PageEngine
101
-
102
- engine = PageEngine(screen="Google", headless=True)
103
-
104
- try:
105
- engine.get_web("https://www.google.com")
106
- engine.get_element("search").fill("cats")
107
- engine.get_element("button").click()
108
- screenshot = engine.get_screenshot("google-results")
109
- print(screenshot)
110
- finally:
111
- engine.teardown()
112
- ```
113
-
114
- `screen="Google"` selects the worksheet tab named `Google`. With multiple tabs, pass the page's tab name when constructing `PageEngine` (for example, `Google`, `Heroku`, or `ST`). Missing worksheets, missing element names, and unsupported locator strategies raise explicit exceptions.
115
-
116
- ## Tests and linting
117
-
118
- Run the test suite:
119
-
120
- ```sh
121
- uv run --frozen pytest src/tests tests -v -n auto --dist loadscope
122
- ```
123
-
124
- `src/tests/test_google_search.py` exercises the live browser flow. The unit regressions in `tests/` cover screenshot persistence and direct worksheet selection without contacting external services.
125
-
126
- Run the blocking CI lint checks:
127
-
128
- ```sh
129
- uvx --from flake8==7.4.1 flake8 main.py settings.py src \
130
- --count --select=E9,F63,F7,F82 --show-source --statistics
131
- ```
132
-
133
- The GitHub Actions workflow in `.github/workflows/python-package.yml` performs locked dependency installation, installs Chromium, runs lint checks, and executes the tests under Xvfb for Python 3.13 and 3.14.
134
-
135
- ## TestFlow Claude Code skills
136
-
137
- TestFlow separates pytest creation into focused stages:
138
-
139
- ```text
140
- PRD → test specification → UI locators → pytest writer → executor → evaluator
141
- ```
142
-
143
- | Order | Skill | Purpose |
144
- |---:|---|---|
145
- | Optional | `web` | Explore a live application in a real browser and produce reproducible bug evidence |
146
- | 1 | `prd-reader` | Extract explicit, derived, and unknown test requirements from the PRD |
147
- | 2 | `test-spec` | Design traceable pytest cases, boundaries, fixtures, and execution prerequisites |
148
- | 3 | `locator-writer` | For UI cases, validate stable Playwright selectors and upsert elements into Google Sheets |
149
- | 4 | `writer` | Implement deterministic, behavior-focused pytest tests |
150
- | 5 | `executor` | Run collection, targeted tests, related tests, and classify failures |
151
- | 6 | `evaluator` | Evaluate traceability, regression sensitivity, coverage quality, and execution evidence |
152
-
153
- `artifact` orchestrates the complete pipeline and repeats only the affected downstream stages when evaluation finds a defect.
154
-
155
- `web` is a report-only exploratory entry point. Verified findings become regression candidates for `test-spec`; it does not modify application code.
156
-
157
- Validate the Claude Code plugin metadata:
158
-
159
- ```sh
160
- claude plugin validate .
161
- ```
162
-
163
- Run Claude Code from the repository and invoke either the complete pipeline or an individual stage:
164
-
165
- ```text
166
- /testflow:web
167
- /testflow:artifact
168
- /testflow:prd-reader
169
- /testflow:test-spec
170
- /testflow:locator-writer
171
- /testflow:writer
172
- /testflow:executor
173
- /testflow:evaluator
174
- ```
175
-
176
- The skills are manual-only. The locator writer previews changes before replacing existing Google Sheet selectors and verifies selectors against the live UI.
177
-
178
- The separate checklist skills live under `.claude/skills/checklist/`: `before-startup` (system ready to build tests), `cruising` (everything in place, critical errors and potential bugs), `landing` (final production readiness), and the standalone `fordec` emergency decision skill.
179
-
180
- ## Project layout
181
-
182
- ```text
183
- .github/workflows/ GitHub Actions CI
184
- .claude/skills/testflow/ Pytest TestFlow skill definitions
185
- .claude/skills/checklist/ Checklist skills (before-startup, cruising, landing, fordec)
186
- .claude/commands/testflow/ TestFlow slash-command entries
187
- .claude-plugin/plugin.json Claude Code plugin metadata
188
- src/core/engine/ Playwright browser and page engines
189
- src/core/functions/ Locator resolution and direct Google Sheets access
190
- src/core/ai/ CrewAI configuration and vision components
191
- src/tests/ Browser test scenarios
192
- settings.py Environment-backed runtime configuration
193
- pyproject.toml Python requirements and dependencies
194
- uv.lock Reproducible dependency lockfile
195
- ```
196
-
197
- ## Known limitations
198
-
199
- - The checked-in vision test uses a placeholder `VisionAssertion` without a `run()` implementation.
200
- - The sample end-to-end test depends on Google and is not hermetic.
201
- - Configuration currently requires fields that are reserved but not consumed by every component.
202
- - The project does not yet define a wheel/sdist build or publishing workflow.
203
-
204
- ## License
205
-
206
- Licensed under the [ISC License](LICENSE). Copyright © 2026 Jenia Petrusenko.
1
+ # Cellenium Playwright
2
+
3
+ Cellenium Playwright is an experimental Python browser-automation toolkit built on [Playwright](https://playwright.dev/python/). It provides browser lifecycle management, a Google-Sheets-backed Page Object Model (POM), screenshot capture, and components for structured visual analysis with CrewAI.
4
+
5
+ The repository also contains **TestFlow**, a set of Claude Code skills that turns product requirements and technical specifications into traceable pytest tests, validated UI locators, execution evidence, and a test-quality verdict.
6
+
7
+ > **Status:** active development. The browser and locator layers are usable, but the checked-in vision test is still a scaffold and does not currently pass. Install it from PyPI with `pip install cellenium` (or `uv add cellenium`), then run `playwright install chromium`. Configuration (`.env`, `credentials.json`) is read from your project's working directory.
8
+
9
+ ## Features
10
+
11
+ - Synchronous Chromium, Firefox, or WebKit sessions through Playwright.
12
+ - Reusable `PageEngine` helpers for navigation, locators, screenshots, scrolling, dropdowns, and tabs.
13
+ - Page Object Model data read directly from Google Sheets at runtime.
14
+ - Locator strategies for name, XPath, ID, CSS, class name, link text, and tag name.
15
+ - Structured image-analysis components built with CrewAI and Pydantic.
16
+ - Parallel pytest execution in CI on Python 3.13 and 3.14.
17
+ - Optional TestFlow skills for end-to-end pytest test generation and evaluation.
18
+
19
+ ## Requirements
20
+
21
+ - Python 3.13 or 3.14
22
+ - [`uv`](https://docs.astral.sh/uv/)
23
+ - A Playwright-supported browser
24
+ - A Google service account for resolving locators
25
+ - An OpenAI-compatible model and API key when using the vision components
26
+
27
+ ## Quick start
28
+
29
+ Clone the repository and install the locked dependencies:
30
+
31
+ ```sh
32
+ git clone https://github.com/MedviJenka/cellenium-playwright.git
33
+ cd cellenium-playwright
34
+ uv sync --frozen
35
+ ```
36
+
37
+ Install Chromium:
38
+
39
+ ```sh
40
+ uv run playwright install chromium
41
+ ```
42
+
43
+ On Ubuntu or another Debian-based CI runner, install Chromium and its system dependencies together:
44
+
45
+ ```sh
46
+ uv run playwright install --with-deps chromium
47
+ ```
48
+
49
+ ## Configuration
50
+
51
+ In the project where you use cellenium, run:
52
+
53
+ ```sh
54
+ cellenium init # writes a .env template, adds .env and credentials.json to .gitignore, installs Chromium and the Claude Code commands
55
+ cellenium claude # (re)installs the /cellenium:* Claude Code commands and skills into .claude/
56
+ cellenium doctor # checks settings, credentials.json, Google Sheet access, and that Chromium launches
57
+ ```
58
+
59
+ `cellenium init --with-deps` also installs Chromium's system libraries (Linux/CI). `cellenium doctor --offline` skips opening the sheet; it exits non-zero when a check fails, so it can gate CI.
60
+
61
+ `cellenium claude --global` installs the commands into `~/.claude` so they are available in every project; locally modified files are kept unless you pass `--force`. Restart Claude Code after installing. `cellenium init --skip-claude` skips this step.
62
+
63
+ Settings are read from `.env` in the working directory or from environment variables:
64
+
65
+ ```dotenv
66
+ GOOGLE_SHEETS=<spreadsheet-edit-url>
67
+ CREDENTIALS_JSON=credentials.json
68
+ OPENAI_MODEL=<model-name>
69
+ OPENAI_API_KEY=<optional-api-key>
70
+ LOGFIRE_TOKEN=<optional-logfire-token>
71
+ TEST_HEADLESS=true
72
+ ```
73
+
74
+ `GOOGLE_SHEETS` selects the locator spreadsheet. When `LOGFIRE_TOKEN` is omitted, logging remains local and no data is sent to Logfire.
75
+
76
+ Save the Google service-account key as `credentials.json` and share the locator spreadsheet with its `client_email` as a viewer (`cellenium doctor` prints the address). Never commit `.env` or `credentials.json`.
77
+
78
+ ## Google Sheets Page Object Model
79
+
80
+ Each worksheet tab represents one screen. The first row must contain these columns:
81
+
82
+ | Column | Purpose |
83
+ |---|---|
84
+ | `name` | Logical element name used by tests |
85
+ | `locator` | Locator strategy such as `NAME`, `XPATH`, `ID`, or `CSS` |
86
+ | `type` | Locator value; this name is retained for compatibility with the source sheet |
87
+ | `actions` | Optional metadata |
88
+ | `comments` | Optional notes |
89
+
90
+ Example worksheet:
91
+
92
+ | name | locator | type | actions | comments |
93
+ |---|---|---|---|---|
94
+ | search | NAME | q | fill | Google search field |
95
+ | button | NAME | btnK | click | Search button |
96
+
97
+ `PageEngine(screen="Google")` reads locator rows directly from the worksheet tab
98
+ named `Google`. No generated JSON mapping or synchronization step is required.
99
+
100
+ ## Browser automation
101
+
102
+ ```python
103
+ from src.core.engine.page_engine import PageEngine
104
+
105
+ engine = PageEngine(screen="Google", headless=True)
106
+
107
+ try:
108
+ engine.get_web("https://www.google.com")
109
+ engine.get_element("search").fill("cats")
110
+ engine.get_element("button").click()
111
+ screenshot = engine.get_screenshot("google-results")
112
+ print(screenshot)
113
+ finally:
114
+ engine.teardown()
115
+ ```
116
+
117
+ `screen="Google"` selects the worksheet tab named `Google`. With multiple tabs, pass the page's tab name when constructing `PageEngine` (for example, `Google`, `Heroku`, or `ST`). Missing worksheets, missing element names, and unsupported locator strategies raise explicit exceptions.
118
+
119
+ ## Tests and linting
120
+
121
+ Run the test suite:
122
+
123
+ ```sh
124
+ uv run --frozen pytest src/tests tests -v -n auto --dist loadscope
125
+ ```
126
+
127
+ `src/tests/test_google_search.py` exercises the live browser flow. The unit regressions in `tests/` cover screenshot persistence and direct worksheet selection without contacting external services.
128
+
129
+ Run the blocking CI lint checks:
130
+
131
+ ```sh
132
+ uvx --from flake8==7.4.1 flake8 main.py settings.py src \
133
+ --count --select=E9,F63,F7,F82 --show-source --statistics
134
+ ```
135
+
136
+ The GitHub Actions workflow in `.github/workflows/python-package.yml` performs locked dependency installation, installs Chromium, runs lint checks, and executes the tests under Xvfb for Python 3.13 and 3.14.
137
+
138
+ ## TestFlow Claude Code skills
139
+
140
+ TestFlow separates pytest creation into focused stages:
141
+
142
+ ```text
143
+ PRD → test specification → UI locators → pytest writer → executor → evaluator
144
+ ```
145
+
146
+ | Order | Skill | Purpose |
147
+ |---:|---|---|
148
+ | Optional | `web` | Explore a live application in a real browser and produce reproducible bug evidence |
149
+ | 1 | `prd-reader` | Extract explicit, derived, and unknown test requirements from the PRD |
150
+ | 2 | `test-spec` | Design traceable pytest cases, boundaries, fixtures, and execution prerequisites |
151
+ | 3 | `locator-writer` | For UI cases, validate stable Playwright selectors and upsert elements into Google Sheets |
152
+ | 4 | `writer` | Implement deterministic, behavior-focused pytest tests |
153
+ | 5 | `executor` | Run collection, targeted tests, related tests, and classify failures |
154
+ | 6 | `evaluator` | Evaluate traceability, regression sensitivity, coverage quality, and execution evidence |
155
+
156
+ `artifact` orchestrates the complete pipeline and repeats only the affected downstream stages when evaluation finds a defect.
157
+
158
+ `web` is a report-only exploratory entry point. Verified findings become regression candidates for `test-spec`; it does not modify application code.
159
+
160
+ Validate the Claude Code plugin metadata:
161
+
162
+ ```sh
163
+ claude plugin validate .
164
+ ```
165
+
166
+ Run Claude Code from the repository and invoke either the complete pipeline or an individual stage:
167
+
168
+ ```text
169
+ /cellenium:web
170
+ /cellenium:artifact
171
+ /cellenium:prd-reader
172
+ /cellenium:test-spec
173
+ /cellenium:locator-writer
174
+ /cellenium:writer
175
+ /cellenium:executor
176
+ /cellenium:evaluator
177
+ ```
178
+
179
+ The skills are manual-only. The locator writer previews changes before replacing existing Google Sheet selectors and verifies selectors against the live UI.
180
+
181
+ The separate checklist skills live under `.claude/skills/checklist/`: `before-startup` (system ready to build tests), `cruising` (everything in place, critical errors and potential bugs), `landing` (final production readiness), and the standalone `fordec` emergency decision skill.
182
+
183
+ ## Project layout
184
+
185
+ ```text
186
+ .github/workflows/ GitHub Actions CI
187
+ .claude/skills/cellenium/ Pytest TestFlow skill definitions
188
+ .claude/skills/checklist/ Checklist skills (before-startup, cruising, landing, fordec)
189
+ .claude/commands/cellenium/ TestFlow slash-command entries
190
+ .claude-plugin/plugin.json Claude Code plugin metadata
191
+ src/core/engine/ Playwright browser and page engines
192
+ src/core/functions/ Locator resolution and direct Google Sheets access
193
+ src/core/ai/ CrewAI configuration and vision components
194
+ src/tests/ Browser test scenarios
195
+ settings.py Environment-backed runtime configuration
196
+ pyproject.toml Python requirements and dependencies
197
+ uv.lock Reproducible dependency lockfile
198
+ ```
199
+
200
+ ## Known limitations
201
+
202
+ - The checked-in vision test uses a placeholder `VisionAssertion` without a `run()` implementation.
203
+ - The sample end-to-end test depends on Google and is not hermetic.
204
+ - Configuration currently requires fields that are reserved but not consumed by every component.
205
+ - The project does not yet define a wheel/sdist build or publishing workflow.
206
+
207
+ ## License
208
+
209
+ Licensed under the [ISC License](LICENSE). Copyright © 2026 Jenia Petrusenko.