Commit 0e6ee9f
test(Obscura): runner-level acceptance suite
test/acceptance/codecept.Obscura.js mirrors codecept.Playwright.js's shape:
TestHelper.siteUrl(), Obscura in self-launch mode (no endpoint -- binary
resolved via OBSCURA_PATH/PATH, same as the existing helper-suite config),
ScreenshotSessionHelper, @codeceptjs/expect-helper, the same bootstrap/
mocha/plugins/gherkin blocks, grep: '@obscura'.
Every scenario tagged @obscura was verified empirically against the real
runner (./bin/codecept.js run -c test/acceptance/codecept.Obscura.js --grep
@obscura, both plain and --debug, run repeatedly for consistency), never
guessed. Tagged: the 4 gherkin features already carrying another engine's
tag (background/basic/before_hook/examples -- all pass), config_test.js's 6
dynamic-config scenarios + simple page test (the mock-server-dependent "make
API call" scenario fails identically for Playwright in this environment --
pre-existing, unrelated), and within_test.js's one scenario that expects an
ElementNotFound throw (genuinely correct for Obscura).
Left untagged, with root causes found rather than assumed:
- els.js's element()/eachElement()/expectElement() family requires ANY
helper with a _locate method returning real element handles
(lib/els.js:147); CDPBrowser has no such method and doesn't hold element
handles at all by design (candidates are re-resolved in-page per call).
grabWebElements/CDPElementHandle exist but don't implement the handle
interface (.getAttribute/.click/.type/.$/.$$/etc.) els.js's consumers
need -- building that out is a real feature, not a small fix, so this
contradicts the mandate's "els/grabWebElements expected to work" premise
and is reported as such rather than forced.
- within_test.js's other 10 scenarios: 9 need switchTo/iframe support
CDPBrowser doesn't implement (I.switchTo is not a function -- confirmed
hard incompatibility, matches expectation). The remaining one
(locate().at().find() scoped inside within(...)) surfaced two distinct,
pre-existing framework-level issues, not Obscura-specific, isolated via
a minimal standalone repro: (a) lib/effects.js's within() calls
_withinBegin via recorder.add() before invoking the within callback --
if _withinBegin itself rejects, the callback's .then/.catch (which is
what tears down recorder.session.start('within')) never runs, corrupting
the recorder session for every later scenario in the same process; (b)
the XPath a chained locate().at(N) produces is absolute ("//...", not
".//...") so document.evaluate(xpath, root, ...) ignores the within
scope's root entirely -- a locator-generation issue in core, not this
helper. Both live in lib/ and are shared across all helpers; per this
mandate's own scope (prefer not touching lib/, fix only small/safe
things), neither was fixed here, only diagnosed and reported.
- session_test.js: CDPBrowser has no _session (confirmed absent, matching
the mandate's own expectation) -- session() throws "Configured helpers do
not support starting sessions." But several of its non-async scenarios
call session() without awaiting the (async) global wrapper, so the
rejection becomes an unhandled promise rejection AFTER the scenario has
already moved on, making them show as a false-positive pass with the
session's own inner steps silently skipped. Left entirely untagged
regardless of the runner's raw pass/fail, since none of them are
semantically valid for a _session-less helper.
- retryTo_test.js, coverage_test.js, shadow_dom.feature: none carry a tag
for any currently-active engine (no @Playwright/@Puppeteer/@webdriverio
anywhere in them) -- not part of the established cross-engine comparison
this mandate extends, so left alone rather than newly exercised only for
Obscura.
.github/workflows/obscura.yml gets a new step after the existing unit-test
step, running the acceptance config with the same OBSCURA_PATH env
(self-launch proves itself again at runner level, as it already does for
the unit suite).
No lib/ changes. Full @obscura suite: 14 scenarios, 0 failures, run
repeatedly (plain and --debug) for consistency, no hang, clean exit.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>1 parent 7f948c7 commit 0e6ee9f
8 files changed
Lines changed: 48 additions & 12 deletions
File tree
- .github/workflows
- test/acceptance
- gherkin
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
| 39 | + | |
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
| 44 | + | |
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
109 | | - | |
| 109 | + | |
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
| |||
0 commit comments