Skip to content
Draft
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 3 additions & 2 deletions eng/pipelines/ci-uitests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,9 @@ parameters:
- name: macosPoolPublic
type: object
default:
name: Azure Pipelines
vmImage: macOS-14
name: AcesShared
demands:
- ImageOverride -equals ACES_VM_SharedPool_Tahoe

stages:

Expand Down
64 changes: 48 additions & 16 deletions eng/scripts/disable-notification-center.sh
Original file line number Diff line number Diff line change
@@ -1,22 +1,54 @@
#!/bin/sh
#!/bin/sh

export PATH=/usr/bin:/bin:/usr/sbin:/sbin
# Suppress macOS system dialogs and notifications that interfere with UI tests.
# This script runs before MacCatalyst UI tests in CI to prevent system-level
# windows (e.g., Apple Sign-In, Setup Assistant, onboarding tips) from blocking
# app interaction and appearing in screenshots.

currentUser=$( echo "show State:/Users/ConsoleUser" | scutil | awk '/Name :/ { print $3 }' )
export PATH=/usr/bin:/bin:/usr/sbin:/sbin

if [ -z "$currentUser" -o "$currentUser" = "loginwindow" ]; then
echo "no user logged in, cannot proceed"
exit 1
fi
set +e # Don't exit on individual command failures

uid=$(id -u "$currentUser")
echo "=== Dismissing macOS system dialogs ==="

runAsUser() {
if [ "$currentUser" != "loginwindow" ]; then
launchctl asuser "$uid" sudo -u "$currentUser" "$@"
else
echo "no user logged in"
fi
}
# 1. Kill Setup Assistant (shows "Sign In to Apple Account" dialog)
if pgrep -x "Setup Assistant" > /dev/null 2>&1; then
echo "Found Setup Assistant running, terminating..."
killall "Setup Assistant" 2>/dev/null
echo "Setup Assistant terminated"
else
echo "Setup Assistant not running"
fi

runAsUser launchctl unload -w /System/Library/LaunchAgents/com.apple.notificationcenterui.plist
# 2. Prevent Setup Assistant from reappearing
defaults write com.apple.SetupAssistant DidSeeCloudSetup -bool true 2>/dev/null
defaults write com.apple.SetupAssistant LastSeenCloudProductVersion -string "15.0" 2>/dev/null
echo "Setup Assistant preferences updated"

# 3. Enable Do Not Disturb to suppress notification banners
# Uses defaults write (works without elevated permissions, unlike launchctl unload)
defaults write com.apple.ncprefs dnd_prefs -data 62706C6973743030D60102030405060708080A08085B646E644D6972726F7265645F100F646E64446973706C6179536C6565705F101E72657065617465644661636574696D6543616C6C73427265616B73444E445E646E64446973706C61794C6F636B5F10136661636574696D6543616E427265616B444E4409080808 2>/dev/null && echo "Do Not Disturb enabled" || echo "Do Not Disturb: defaults write not supported on this version"

# 4. Suppress macOS onboarding tips and "What's new" banners (macOS 26 Tahoe+)
# These appear as notification banners (e.g., "See what's new in macOS Tahoe")
# and interfere with full-screen screenshot tests.
defaults write com.apple.tipsd ShouldShowTips -bool false 2>/dev/null && echo "Tips disabled (tipsd)" || echo "Tips: defaults write not supported"
defaults write com.apple.tipsd LastTipShownTimestamp -date "$(date -u +%Y-%m-%dT%H:%M:%SZ)" 2>/dev/null
# Also suppress Tips via the Notification Center preferences
defaults write com.apple.tips ShouldShowTips -bool false 2>/dev/null
# Kill the tips daemon so changes take effect immediately
if pgrep -x "tipsd" > /dev/null 2>&1; then
echo "Terminating tipsd..."
killall "tipsd" 2>/dev/null
fi

# 5. Also try killing any other system dialogs that might interfere
for proc in "UserNotificationCenter" "CoreServicesUIAgent"; do
if pgrep -x "$proc" > /dev/null 2>&1; then
echo "Terminating $proc..."
killall "$proc" 2>/dev/null
fi
done

echo "=== System dialog suppression complete ==="
exit 0
31 changes: 15 additions & 16 deletions eng/scripts/enable-notification-center.sh
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
#!/bin/sh
export PATH=/usr/bin:/bin:/usr/sbin:/sbin
#!/bin/sh

currentUser=$( echo "show State:/Users/ConsoleUser" | scutil | awk '/Name :/ { print $3 }' )
# Re-enable macOS notifications after UI tests complete.
# Counterpart to disable-notification-center.sh.

if [ -z "$currentUser" -o "$currentUser" = "loginwindow" ]; then
echo "no user logged in, cannot proceed"
exit 1
fi
export PATH=/usr/bin:/bin:/usr/sbin:/sbin

uid=$(id -u "$currentUser")
set +e

runAsUser() {
if [ "$currentUser" != "loginwindow" ]; then
launchctl asuser "$uid" sudo -u "$currentUser" "$@"
else
echo "no user logged in"
fi
}
echo "=== Re-enabling macOS notifications ==="

runAsUser launchctl load -w /System/Library/LaunchAgents/com.apple.notificationcenterui.plist
# Disable Do Not Disturb
defaults delete com.apple.ncprefs dnd_prefs 2>/dev/null && echo "Do Not Disturb disabled" || echo "Do Not Disturb: already disabled or not supported"

# Re-enable tips
defaults delete com.apple.tipsd ShouldShowTips 2>/dev/null && echo "Tips re-enabled (tipsd)" || echo "Tips: already enabled or not supported"
defaults delete com.apple.tips ShouldShowTips 2>/dev/null

echo "=== Notifications re-enabled ==="
exit 0
3 changes: 2 additions & 1 deletion src/Controls/tests/TestCases.HostApp/Issues/Issue32416.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ protected override void Init()
{
Items.Add(new MenuItem
{
Text = $"Item {i}"
Text = $"Item {i}",
AutomationId = $"Item {i}"
});
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/Controls/tests/TestCases.HostApp/Issues/Issue32477.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ protected override void Init()
{
Items.Add(new MenuItem
{
Text = $"Item {i}"
Text = $"Item {i}",
AutomationId = $"Item {i}"
});
}
}
Expand Down
6 changes: 6 additions & 0 deletions src/Controls/tests/TestCases.HostApp/MauiProgram.cs
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,12 @@ class App : Application

public App()
{
#if MACCATALYST
// Force light mode for consistent screenshots on macOS 26+
// where CI VMs default to dark mode. Info.plist UIUserInterfaceStyle
// is not respected by Mac Catalyst on macOS 26.
UserAppTheme = AppTheme.Light;
#endif
}

public static bool PreloadTestCasesIssuesList { get; set; } = true;
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/Controls/tests/TestCases.Mac.Tests/snapshots/mac/BarBgBlue.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/Controls/tests/TestCases.Mac.Tests/snapshots/mac/BarBgRed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading