Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .changeset/bright-input-lanes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
'@fluentui-react-native/components': patch
'@fluentui-react-native/desktop-driver': patch
'@fluentui-react-native/native-core': patch
'@fluentui-react-native/storybook-desktop': patch
'@fluentui-react-native/storybook-desktop-runtime': patch
---

Support statically extracted, endpoint-specific input classifications beside named story tests and select accessibility or physical coverage consistently in discovery and smoke execution. Classify existing Win32 callbacks without changing their assertions. Record native target provenance and reset the Win32 preview between test generations without resetting chrome preferences.
30 changes: 26 additions & 4 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -510,9 +510,13 @@ jobs:
if-no-files-found: warn

win32-storybook:
name: Win32 Storybook PR
name: Win32 Storybook PR (${{ matrix.input-mode }})
runs-on: windows-latest
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
input-mode: [accessibility, physical]
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
Expand All @@ -534,17 +538,34 @@ jobs:
uses: ./.github/actions/setup-desktop-driver
with:
platform: win32
disabled-input-features: keyboard,physicalClick,wheel
disabled-input-features: ${{ matrix.input-mode == 'accessibility' && 'keyboard,physicalClick,wheel' || '' }}

- name: Validate and capture the complete Win32 input catalog
id: input-coverage
working-directory: apps/storybook
env:
STORYBOOK_INPUT_MODE: ${{ matrix.input-mode }}
run: yarn input-coverage begin

- name: Smoke test Win32 Storybook
- name: Smoke test Win32 Storybook (${{ matrix.input-mode }})
id: smoke
working-directory: apps/storybook
env:
STORYBOOK_INPUT_MODE: ${{ matrix.input-mode }}
run: yarn storybook smoke --win32 --mode stories-and-tests

- name: Verify every declared Win32 input callback
if: ${{ always() && !cancelled() && steps.input-coverage.outcome == 'success' }}
working-directory: apps/storybook
env:
STORYBOOK_INPUT_MODE: ${{ matrix.input-mode }}
run: yarn input-coverage verify

- name: Upload Win32 Storybook artifacts
if: ${{ always() }}
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: Storybook_win32_paper_${{ github.run_id }}_${{ github.run_attempt }}
name: Storybook_win32_paper_${{ matrix.input-mode }}_${{ github.run_id }}_${{ github.run_attempt }}
path: |
apps/storybook/artifacts/win32
apps/storybook/artifacts/desktop
Expand Down Expand Up @@ -652,6 +673,7 @@ jobs:
- ios
- windows
- win32
- win32-storybook
- check-changesets
- publish-dry-run-pack
- test-links
Expand Down
46 changes: 46 additions & 0 deletions apps/storybook/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,52 @@ See `agent-map.yaml` for the current command contract and paths.
Generated projects, Pods, manifests, reports, and build products are disposable.
Change the owning config or source instead of generated output.

## Win32 input coverage

Win32/Paper PR testing has independent accessibility and physical-input jobs.
Both traverse the full platform story catalog. Each named test declares
`inputModes: { win32: 'accessibility' | 'physical' | 'both' }` beside its
`run` callback; `both` tests execute in each job. A semantic assertion that first
navigates with the keyboard still belongs to the physical lane.

`yarn input-coverage generate` discovers these declarations and writes
`artifacts/win32/input-tests.win32.json`. This is generated output, not a second
test inventory to maintain. The app owns only the exact exception registry,
[`input-test-quarantines.win32.json`](input-test-quarantines.win32.json).

The accessibility lane masks keyboard, physical clicks, and wheel input and
explicitly uses accessibility clicks. The physical lane enables those features
and explicitly uses physical clicks. Windows/Fabric and macOS policies are
unchanged. Source assertions and capability checks remain authoritative; this
catalog does not convert unsupported actions into passes.

Before smoke, `yarn input-coverage begin` generates the complete statically
discovered Win32 callback catalog and captures the source, lane, and preexisting
report directories. Missing or invalid classifications fail; additions, removals,
and renames come directly from story source. After smoke,
`yarn input-coverage verify` requires one fresh successful canonical test report,
with Win32/Paper provenance, and
one clean passing attempt for every callback assigned to that lane. Unexpected
skips, unsupported results, missing callbacks, duplicates, retries, and flaky
passes fail the job. The existing Button #4373 quarantine remains selected;
only its exact documented skip is permitted and reported as **unvalidated**,
not passed.

From this workspace, inspect a lane without executing native input:

```powershell
$env:STORYBOOK_INPUT_MODE = 'accessibility' # Or 'physical'.
yarn storybook test --win32 --list
Remove-Item Env:\STORYBOOK_INPUT_MODE
```

Actual input execution requires the matching driver capability policy and an
authorized desktop; selecting a lane alone does not grant input authority.
Each CI lane uploads its own `Storybook_win32_paper_<mode>_<run>_<attempt>`
artifact, including canonical native results, the classified input catalog,
and a coverage summary. The required `PR` aggregate includes both matrix jobs.
Run `yarn test` here for catalog and report-gate regression tests.

## Package guidance

- Storybook integration, CLI, discovery, and callbacks:
Expand Down
14 changes: 13 additions & 1 deletion apps/storybook/agent-map.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ purpose: Agent-optimized map of stable Storybook structure and runtime discovery

sources:
config: desktop.config.mts
win32_input_quarantines: input-test-quarantines.win32.json
win32_input_coverage: input-test-modes.mts
config_adapter: src/main.ts
app_entry: index.js
app_shell: src/StorybookApp.tsx
Expand All @@ -18,6 +20,11 @@ sources:
- '@fluentui-react-native/components'
- '@fluentui-react-native/native-core'

outputs:
win32_input_catalog:
path: artifacts/win32/input-tests.win32.json
policy: generated-from-story-input-metadata-do-not-edit

services:
supervisor:
command: yarn storybook driver --<platform>
Expand All @@ -31,11 +38,13 @@ services:
executable_tests:
command: yarn storybook test --<platform>
discovery: yarn storybook test --<platform> --list
authoring: top-level wdio callbacks or named callback collections in CSF3 stories
authoring: top-level wdio callbacks or named callback collections in CSF3 stories; Win32 input modes beside each named run callback
config: desktop.config.mts Storybook integration wdio settings
lifecycle: attached-session-per-test-with-isolated-node-worker
context_platform: macos-or-windows-or-win32-target-endpoint
test_filter: --test <name-glob>
smoke_test_filter_env: STORYBOOK_SMOKE_TEST
win32_input_mode_env: STORYBOOK_INPUT_MODE
smoke_mode: stories-and-tests
execution: navigate-and-remount-then-run-tests-grouped-by-story

Expand All @@ -45,6 +54,9 @@ agent_commands:
inspect_instance: yarn storybook instance --<platform>
list_stories: yarn desktop-driver stories list --url <driver-url> --target <target-id>
run_story_tests: yarn storybook test --<platform> --test <test-name-glob>
capture_win32_input_catalog: yarn input-coverage begin
generate_win32_input_catalog: yarn input-coverage generate
verify_win32_input_coverage: yarn input-coverage verify

lookup_order:
- Generate the exact platform manifest; never guess ID slugging.
Expand Down
2 changes: 2 additions & 0 deletions apps/storybook/desktop.config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
import { defineDesktopConfig } from '@fluentui-react-native/desktop-test/config';

import appManifest from './app.json' with { type: 'json' };
import { inputModeOptions } from './input-test-modes.mts';

const win32Host = {
component: 'AgenticStorybook',
Expand All @@ -24,6 +25,7 @@ export default defineDesktopConfig({
reporting: { artifactsRoot: './artifacts/desktop' },
suites: { stories: { kind: 'csf-wdio' } },
integration: storybook({
wdio: { test: process.env.STORYBOOK_SMOKE_TEST, ...inputModeOptions() },
storyPackages: [
[
'@fluentui-react-native/components',
Expand Down
Loading
Loading