Skip to content
Merged
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
13 changes: 10 additions & 3 deletions UITests/DocumentationExportUITests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,19 @@ final class DocumentationExportUITests: XCTestCase {
app.typeText(parent.path)
app.typeKey(.return, modifierFlags: [])
let panel = app.dialogs["open-panel"]
XCTAssertTrue(panel.waitForExistence(timeout: 5), app.debugDescription)
// Check current readiness before starting a polling wait; `||`
// short-circuits, so delayed readiness keeps the same bounded waits.
XCTAssertTrue(
panel.exists || panel.waitForExistence(timeout: 5), app.debugDescription)
// AppKit exposes this button's localized AXTitle, not an AXLabel.
// Its in-dialog identifier excludes the Touch Bar duplicate.
let choose = panel.buttons["OKButton"]
XCTAssertTrue(choose.waitForExistence(timeout: 5), app.debugDescription)
XCTAssertTrue(choose.wait(for: \.isHittable, toEqual: true, timeout: 5))
XCTAssertTrue(
choose.exists || choose.waitForExistence(timeout: 5), app.debugDescription)
XCTAssertTrue(
choose.isHittable
|| choose.wait(for: \.isHittable, toEqual: true, timeout: 5),
app.debugDescription)
recordSegment("panel")
choose.click()
XCTAssertTrue(
Expand Down
19 changes: 19 additions & 0 deletions docs/DOCUMENTATION-UI-PROFILING.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,22 @@ The performance lane's compile/link overhead is a separate hypothesis. Inspect t
actual build graph and configuration differences before proposing reuse. Existing
lane-partition checks already prevent duplicated performance/golden coverage work;
that existing behavior is not a new optimization.

## Already-ready folder-panel checks

The folder-panel journey checks the current `exists`/`isHittable` state before
starting XCTest's polling waits. The same three assertions and five-second
fallback waits remain: the real open panel must exist, its scoped OK button must
exist, and that button must be hittable. Export still uses the native button after
Go to Folder keyboard navigation and path entry; no pasteboard shortcut, seeded
panel location, or programmatic export replaces that interaction.

Each check is a short-circuiting `exists || waitForExistence(...)` (or the
`isHittable` equivalent), so an already-ready control skips the wait call and a
delayed or missing control reaches the same bounded wait and failure. It is a
candidate optimization, not a guaranteed duration reduction: XCTest's waits also
evaluate readiness when they start, and the extra accessibility query adds cost
when readiness is delayed. Use the identical eight-phase markers and matched-run
protocol above to determine its effect. A single candidate CI run versus a
historical baseline is diagnostic; it cannot establish a reproducible improvement
or quantify workflow savings.
Loading