Repository navigation
Test settings - #519
Test settings#519
Conversation
faff0af to
e3583e7
Compare
|
This needs all too long |
177feed to
a314cf9
Compare
26992b9 to
831bc23
Compare
53770bb to
f8cb789
Compare
da7ac98 to
217676d
Compare
|
@hannesa2 a few notes from going through this one, in case they help. The screenshot diffs look like noise. Since the PR only touches test
The two Settings tests don't seem to find the window. In the arm64 You can probably drop the |
- Drop the PBGitWindowWiringTests -view workaround: #702 already turns off PBShowStageView in -setUp, so -selectCurrentBranch runs synchronously and commitController is wired before -setUp returns. - Assert the Preferences window actually appears in both Settings screenshot tests, so they fail fast instead of silently passing without a screenshot when the window can not be found.
217676d to
18cdeb6
Compare
Asserting prefsWindow.exists (added in the previous commit) turned up a real bug: DBPrefsWindowController's window is an NSPanel with styleMask (Titled | Closable | Miniaturizable) and no Resizable bit. AppKit reports that combination to the accessibility API with subrole AXDialog, so XCUITest classifies it as XCUIElementTypeDialog rather than XCUIElementTypeWindow. It never showed up in `self.app.windows` no matter how long the tests waited, which is exactly why they previously "passed" after 118-125s without ever taking a screenshot. Switch testSettingsGeneralTabScreenshot and testSettingsIntegrationTabScreenshot (and their shared helpers) to look the panel up via `self.app.dialogs` instead of `self.app.windows`. Both tests now genuinely open the Preferences window, click the right tab, and capture a real screenshot in ~38s.
|
@goneng |
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Ensure missing tabs cause test failure before clicking or capturing screenshots.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 1
Open (1)
What changed in this PR
Adds UI screenshot coverage for the Preferences window’s General and Integration panes.
Changes:
- Opens Preferences via menu with keyboard fallback.
- Adds dialog and toolbar-tab discovery helpers.
- Captures pane-specific screenshots.
The tab lookup must fail or wait when tabs are absent; otherwise the default pane may be captured under the wrong name.
| File | Summary |
|---|---|
GitXUITests/GitXScreenshotTests.m |
Adds Preferences navigation, tab selection, and screenshot tests. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| XCUIElement *btn = [self findPrefsTabButton:@"General" inWindow:prefsWindow]; | ||
| if (btn.exists) { | ||
| [btn click]; | ||
| [NSThread sleepForTimeInterval:0.6]; | ||
| // Re-fetch — title changed to "General" after click | ||
| prefsWindow = self.app.dialogs.firstMatch; | ||
| } else { | ||
| NSLog(@"[GitXScreenshotTests] General toolbar button not found"); |
53f50dd to
71b13f2
Compare
Reach the Preferences window by pressing Command-, rather than walking the GitX menu, the same way the view switching moved to Command-1 and Command-2. - Drop the menu walk: the item is named "Settings..." on current macOS, so the lookup for "Preferences..." always ran out its 5 second wait, and each menu query took 5-15 seconds on the CI runner, about 75 seconds per test in all. - Keep the Command-, the walk already fell back to as the only path.
Make a missing General or Integration toolbar button fail the test instead of saving whichever pane is showing under that pane's name. - Wait up to 5 seconds for the button, then assert it exists before clicking it. - This matters because the Preferences window reopens on the pane it last showed, so once the Integration test has run, the General test would otherwise capture the Integration pane.
Let the UI tests pin the date the General pane's date-format sample shows, so its screenshot stops changing every minute and flagging every later pull request as a screenshot difference. - Read GITX_UITEST_NOW, in seconds since 1970, in place of the current time when building the sample, next to the existing GITX_UITEST_REPO hook. - Set it to 2026-01-01 12:00 UTC for every screenshot test launch.
|
@hannesa2 thanks, I pushed three small commits on top:
The two Settings tests went from 99s and 117s to 26s and 25s, and |




No description provided.