Skip to content

Commit adec882

Browse files
committed
bench(ios): press an unambiguous target on the catalog and Settings screens
The first-interaction cell pressed the screen's anchor text, which on the catalog and iOS Settings screens names two actionable elements (the native tab and the screen title); the CLI refuses that as AMBIGUOUS_MATCH by design, so those two cells could never measure anything. Each such screen now names the element the cell presses.
1 parent 41bdc69 commit adec882

3 files changed

Lines changed: 8 additions & 1 deletion

File tree

‎scripts/ios-snapshot-benchmark/command.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ export function firstInteractionAfterOpen(context: CliContext, fixture: ScreenFi
8080
const selector =
8181
fixture.launchUrl && deepLinkConfirmationShown(context, opened)
8282
? 'label="Open"'
83-
: `text=${JSON.stringify(fixture.anchorText)}`;
83+
: (fixture.interactionTarget ?? `text=${JSON.stringify(fixture.anchorText)}`);
8484
return pressFixtureTarget(context, selector);
8585
}
8686

‎scripts/ios-snapshot-benchmark/definitions.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ const SCREEN_FIXTURES: readonly ScreenFixture[] = [
2929
app: FIXTURE_APP_ID,
3030
launchUrl: `${FIXTURE_SCHEME}/catalog`,
3131
anchorText: 'Catalog',
32+
interactionTarget: 'id="catalog-search"',
3233
},
3334
{
3435
id: 'nested-scroll',
@@ -51,6 +52,7 @@ const SCREEN_FIXTURES: readonly ScreenFixture[] = [
5152
label: 'iOS Settings system surface',
5253
app: IOS_SETTINGS_APP_ID,
5354
anchorText: 'Settings',
55+
interactionTarget: 'text="General"',
5456
},
5557
{
5658
id: 'xctest-stress',

‎scripts/ios-snapshot-benchmark/types.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@ export type ScreenFixture = {
3939
anchorText: string;
4040
postSetupAnchorText?: string;
4141
setupAction?: 'open-alert';
42+
/**
43+
* What the first-interaction cell presses when the anchor text names more than one
44+
* actionable element (a native tab and the screen title share it); the anchor otherwise.
45+
*/
46+
interactionTarget?: string;
4247
};
4348

4449
export type Failure = {

0 commit comments

Comments
 (0)