Skip to content

Commit

Permalink
Disable Windows notifications
Browse files Browse the repository at this point in the history
Many of our tests fail because a 'Notification center' pop-up appears and the current window loses focus. This two registry keys will help prevent notifications to show up.
  • Loading branch information
Pablo Herranz Ramírez committed Nov 22, 2023
1 parent 041cfd9 commit e6b0f6a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/wsl/prepare_wsl.pm
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ sub run {

$self->open_powershell_as_admin;

# These two commands disable notifications that Windows shows randomly and
# make our windows lose focus
$self->run_in_powershell(cmd => 'reg add "HKLM\Software\Policies\Microsoft\Windows" /v Explorer');
$self->run_in_powershell(cmd => 'reg add "HKLM\Software\Policies\Microsoft\Windows\Explorer" /v DisableNotificationCenter /t REG_DWORD /d 1');
$self->run_in_powershell(cmd => 'reg add "HKLM\Software\Microsoft\Windows\CurrentVersion\PushNotifications" /v ToastEnabled /t REG_DWORD /d 0');


$self->power_configuration if (is_aarch64);

if (get_var('WSL2')) {
Expand Down

0 comments on commit e6b0f6a

Please sign in to comment.