test(app): accept the Cupertino create prompt at 2x without role assumptions

This commit is contained in:
2026-10-21 21:52:57 +01:00
parent 37332a3d40
commit 215755bb1e
3 changed files with 42 additions and 12 deletions
+11 -2
View File
@@ -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
+21 -7
View File
@@ -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<String>('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<String>('template-probe-open'),
onPressed: _open,
child: const Text(
'Create pipeline from this template',
textAlign: TextAlign.center,
),
),
),
),
);
+10 -3
View File
@@ -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(),