Skip to content

Commit 3b2c044

Browse files
DavertMikclaude
andcommitted
test(acceptance): form filling e2e scenarios
test/acceptance/forms_test.js -- 5 realistic e2e form flows against the PHP app, valuable for every acting-actor helper, not just Obscura: fill a field by label + submit + assert the posted value (the generic /form/* POST handler's print_r($_POST) pattern config_test.js and within_test.js already rely on for assertions), check a checkbox by its label + state assertion, select an option + read the selected value back before submitting, a multi-field form (name + textarea + select) submitted together, and clear/append behavior on a pre-filled field. A sixth, negative (required-field/empty-submit) scenario was considered and dropped: the only fixture with real required="1" attributes (form/example4.php) depends on a separate local asset server (127.0.0.1:8100 for its CSS/JS) not available in this environment, and no other fixture enforces required in a way that's checkable without relying on native HTML5 validation UI, which headless/synthetic engines don't reliably surface the same way. Five scenarios matches the mandate's own "~5-6" range. Every scenario verified empirically, twice each for consistency, through the real CLI against all three helpers this environment can actually run: Obscura (this mandate's own config), Playwright (--grep to bypass tag filtering, chromium already available), Puppeteer (its config, which has no grep filtering at all -- runs unconditionally). All 5 passed on all 3, so all 5 carry @obscura @playwright @puppeteer. WebDriverIO was not touched -- no Selenium server in this environment to verify against, so no @webdriver tag was added; left for the maintainer to enable and tag once a Selenium environment is available, per the mandate's own instruction not to tag what wasn't proven. No lib/ changes. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 0e6ee9f commit 3b2c044

1 file changed

Lines changed: 46 additions & 0 deletions

File tree

test/acceptance/forms_test.js

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
Feature('Form filling')
2+
3+
Scenario('fill a field by label and submit, then see the posted value @Obscura @Playwright @Puppeteer', ({ I }) => {
4+
I.amOnPage('/form/field')
5+
I.fillField('Name', 'Alice Example')
6+
I.click('Submit')
7+
I.see('[name] => Alice Example')
8+
})
9+
10+
Scenario('check a checkbox by its label and submit @Obscura @Playwright @Puppeteer', ({ I }) => {
11+
I.amOnPage('/form/checkbox')
12+
I.checkOption('I Agree')
13+
I.seeCheckboxIsChecked('#checkin')
14+
I.click('Submit')
15+
I.see('[terms] => agree')
16+
})
17+
18+
Scenario('select an option, read the value back, then submit @Obscura @Playwright @Puppeteer', async ({ I }) => {
19+
I.amOnPage('/form/select')
20+
I.selectOption('Select your age', '13-21')
21+
const value = await I.grabValueFrom('#age')
22+
I.expectEqual(value, 'teenage')
23+
I.click('Submit')
24+
I.see('[age] => teenage')
25+
})
26+
27+
Scenario('fill several fields on a multi-field form and submit @Obscura @Playwright @Puppeteer', ({ I }) => {
28+
I.amOnPage('/form/complex')
29+
I.fillField('Name', 'Bob Multi')
30+
I.fillField('Description', 'a multi-field submission')
31+
I.selectOption('Select your age', '21-60')
32+
I.click('Submit')
33+
I.see('[name] => Bob Multi')
34+
I.see('[description] => a multi-field submission')
35+
I.see('[age] => adult')
36+
})
37+
38+
Scenario('clear and append a pre-filled field @Obscura @Playwright @Puppeteer', ({ I }) => {
39+
I.amOnPage('/form/field')
40+
I.seeInField('#name', 'OLD_VALUE')
41+
I.clearField('#name')
42+
I.fillField('#name', 'fresh')
43+
I.seeInField('#name', 'fresh')
44+
I.appendField('#name', '-appended')
45+
I.seeInField('#name', 'fresh-appended')
46+
})

0 commit comments

Comments
 (0)