Uh oh!
There was an error while loading. Please reload this page.
Stabilize Project Navigator UI tests - #2183
Conversation
There was a problem hiding this comment.
Pull request overview
This PR focuses on stabilizing Project Navigator UI tests by improving how tests locate and wait for navigator elements, and by introducing a DEBUG-only app launch mode that opens an isolated temporary workspace created by CodeEdit.
Changes:
- Added more resilient UI-test queries and explicit wait helpers for navigator row discovery and row-count changes.
- Updated Project Navigator UI tests to wait for expected rows/row-count transitions instead of relying on short timing windows.
- Added a DEBUG-only launch argument path for CodeEdit to create/open an isolated temp workspace for UI tests.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| CodeEditUITests/Query.swift | Adds add-button lookup, row query helpers, and polling-based wait utilities used by UI tests. |
| CodeEditUITests/ProjectPath.swift | Adds helper to generate a temp workspace identifier for app-created workspaces. |
| CodeEditUITests/Features/NavigatorArea/ProjectNavigator/ProjectNavigatorUITests.swift | Hardens folder open/close assertions using explicit waits and row-count checks. |
| CodeEditUITests/Features/NavigatorArea/ProjectNavigator/ProjectNavigatorFileManagementUITests.swift | Stabilizes “Add File” flow by waiting for navigator growth, expected row, and editor/tab evidence. |
| CodeEditUITests/App.swift | Adds launchWithAppWritableTempDir() to launch CodeEdit in a workspace created by the app. |
| CodeEdit/Features/NavigatorArea/ProjectNavigator/ProjectNavigatorToolbarBottom.swift | Makes the “Add” control more reliably discoverable by UI tests via an explicit label and sizing. |
| CodeEdit/AppDelegate.swift | Adds DEBUG-only support for --codeedit-uitest-open-temp-workspace and consolidates workspace opening logic. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Summary
Why
While preparing the Project Navigator UI-test stabilization work, release-readiness review found
testCreateNewFilescould still race file creation by relying on a short selected-row/row lookup after choosing Add File. This hardens that path so creation waits for observable navigator growth, the expected titled row, and tab/editor evidence before continuing.Validation
DEVELOPER_DIR=/Applications/Xcode-26.6-RC2.app/Contents/Developer xcodebuild -version-> Xcode 26.6 (17F113)xcodebuild -project CodeEdit.xcodeproj -scheme CodeEdit -configuration Debug -derivedDataPath /tmp/apple-appdev-deriveddata/codeedit-baseline-ui-tests-pr-20260702-xcode26 -destination 'platform=macOS' -skipPackagePluginValidation build-> passed (** BUILD SUCCEEDED **)xcodebuild ... -only-testing:CodeEditUITests/ProjectNavigatorFileManagementUITests/testCreateNewFiles -only-testing:CodeEditUITests/ProjectNavigatorUITests/testNavigatorOpenFilesAndFolder test-> passed (** TEST SUCCEEDED **, 2 tests)xcodebuild ... -only-testing:CodeEditUITests/ProjectNavigatorFileManagementUITests test-> passed (** TEST SUCCEEDED **, 2 tests)xcodebuild ... -only-testing:CodeEditUITests/ProjectNavigatorUITests test-> passed (** TEST SUCCEEDED **, 1 test)git diff --check upstream/main...HEAD-> cleanNotes
The build/test runs still print SwiftLint package-plugin command-report noise after success, for example
The following build commands failed: Running SwiftLint ..., whilexcodebuildexits 0 and prints the final build/test success marker. I did not find a branch-attributable warning from these UI-test changes.My active default Xcode is currently Xcode 27 beta; that toolchain fails unrelated base code in
EditorTabsOverflowShadow.swiftwithambiguous use of 'opacity'. I used Xcode 26.6 for this PR's freshness validation.