From 215755bb1eee1b1fc73160b6681617c39c3060d7 Mon Sep 17 00:00:00 2001 From: Alan Silva Date: Wed, 21 Oct 2026 21:52:57 +0100 Subject: [PATCH] test(app): accept the Cupertino create prompt at 2x without role assumptions --- app/notes/T1-create.md | 13 +++++++++++-- app/tool/template_create_probe.dart | 28 +++++++++++++++++++++------- app/tool/template_create_probe.mjs | 13 ++++++++++--- 3 files changed, 42 insertions(+), 12 deletions(-) diff --git a/app/notes/T1-create.md b/app/notes/T1-create.md index 67668cbc..90d7561f 100644 --- a/app/notes/T1-create.md +++ b/app/notes/T1-create.md @@ -5,8 +5,17 @@ repairs when merging. Split native field/action controls from dialog state so production files remain under250lines. Added a fail-closed repository guard: an empty/malformed created detail without a positive integral pipeline identity cannot be reported as successful creation. The new regression failed before the -guard; all24 template tests pass after. Source/native capture recheck precedes -actual gallery/Settings delivery; no production definition was created. +guard; all24 template tests pass after. + +Browser acceptance now also covers Cupertino at 2x on a phone. The probe found +the prompt open and usable; its old "is the prompt open?" test required a +`role=button` Create node, which the Cupertino action row does not expose at that +scale even though the action is present and tappable. The probe now tests the +native alert-dialog surface directly and keeps the Material-only aria-disabled +check, with disabled-state coverage for Cupertino in widget tests. The probe's +own opener is now a bounded scrollable column so a long button label cannot run +past a phone viewport. No product layout change was needed: the Cupertino dialog +fits at 2x and its success capture was inspected. ## Result diff --git a/app/tool/template_create_probe.dart b/app/tool/template_create_probe.dart index 94776fda..47596931 100644 --- a/app/tool/template_create_probe.dart +++ b/app/tool/template_create_probe.dart @@ -145,10 +145,18 @@ class _ProbeHomeState extends State<_ProbeHome> { navigationBar: const CupertinoNavigationBar( middle: Text('Template create probe'), ), + // One bounded, scrollable column keeps the opener reachable at 2x text, + // where a long button label is wider than a phone viewport. child: Center( - child: CupertinoButton.filled( - onPressed: _open, - child: const Text('Create pipeline from this template'), + child: SingleChildScrollView( + padding: const EdgeInsets.all(24), + child: CupertinoButton.filled( + onPressed: _open, + child: const Text( + 'Create pipeline from this template', + textAlign: TextAlign.center, + ), + ), ), ), ); @@ -156,10 +164,16 @@ class _ProbeHomeState extends State<_ProbeHome> { return Scaffold( appBar: AppBar(title: const Text('Template create probe')), body: Center( - child: FilledButton( - key: const ValueKey('template-probe-open'), - onPressed: _open, - child: const Text('Create pipeline from this template'), + child: SingleChildScrollView( + padding: const EdgeInsets.all(24), + child: FilledButton( + key: const ValueKey('template-probe-open'), + onPressed: _open, + child: const Text( + 'Create pipeline from this template', + textAlign: TextAlign.center, + ), + ), ), ), ); diff --git a/app/tool/template_create_probe.mjs b/app/tool/template_create_probe.mjs index 14860200..06d7244c 100644 --- a/app/tool/template_create_probe.mjs +++ b/app/tool/template_create_probe.mjs @@ -178,7 +178,14 @@ try { await delay(400); }; - // Null while the prompt is closed; true/false is the Create button's state. + // The prompt is open as soon as its native alert-dialog surface exists. The + // Create action's button role/aria-disabled is host- and scale-dependent on + // the web semantics layer, so the disabled state is asserted module-side for + // Material and by widget tests for Cupertino. + const promptOpen = () => + evaluate("Boolean(document.querySelector('[role=alertdialog]'))"); + + // Null unless a Material Create button exposes its disabled state. const createDisabled = () => evaluate(`(() => { const el = [...document.querySelectorAll('flt-semantics')].find( @@ -232,7 +239,7 @@ try { await assertBody('Create pipeline from this template'); await clickLabel('Create pipeline from this template'); - await waitFor(() => createDisabled().then((value) => value !== null), 'the create prompt'); + await waitFor(promptOpen, 'the create prompt'); await assertBody('Create from Release workflow'); await assertBody('New pipeline name (required)'); await assertBody("Creates a new draft pipeline on the server from this template's source; it is not run."); @@ -301,7 +308,7 @@ try { }); await clickLabel('Close'); - await waitFor(async () => (await createDisabled()) === null, 'the prompt to close'); + await waitFor(async () => !(await promptOpen()), 'the prompt to close'); checks.push({ check: 'Close dismissed the prompt without another request', state: await state(),