Skip to content

Stabilize Project Navigator UI tests#2183

Open
jkaunert wants to merge 3 commits into
CodeEditApp:mainfrom
jkaunert:fix/project-navigator-ui-test-stability
Open

Stabilize Project Navigator UI tests#2183
jkaunert wants to merge 3 commits into
CodeEditApp:mainfrom
jkaunert:fix/project-navigator-ui-test-stability

Conversation

@jkaunert

@jkaunert jkaunert commented Jul 3, 2026

Copy link
Copy Markdown

Summary

  • Launch Project Navigator UI tests with isolated temporary workspaces that CodeEdit creates when needed.
  • Harden Project Navigator row queries with explicit waits for row-count growth and named rows.
  • Stabilize add-button discovery plus folder expansion/collapse assertions used by the Project Navigator UI tests.

Why

While preparing the Project Navigator UI-test stabilization work, release-readiness review found testCreateNewFiles could 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 -> clean

Notes

The build/test runs still print SwiftLint package-plugin command-report noise after success, for example The following build commands failed: Running SwiftLint ..., while xcodebuild exits 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.swift with ambiguous use of 'opacity'. I used Xcode 26.6 for this PR's freshness validation.

Copilot AI review requested due to automatic review settings July 3, 2026 05:10

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread CodeEditUITests/Query.swift
Comment thread CodeEdit/AppDelegate.swift

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Comment thread CodeEditUITests/App.swift
Comment thread CodeEdit/AppDelegate.swift
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants