Clear and suppress all OS notifications before running a test

NEW
Unassigned

Status

Infrastructure & Operations
RelOps
2 months ago
a month ago

People

(Reporter: mconley, Unassigned)

Tracking

(Blocks: 1 bug)

Details

Attachments

(1 attachment)

Created attachment 8930582 [details]
Example

We're using the mochitest framework for the screenshots tool that the Firefox team uses to catch unwanted changes in the UI.

See the attached for one of the screenshots we captured recently. There are some OS upgrade notices and a nag for trying out Safari that are adding noise to the screenshot. This will likely result in false positives when we're doing automated comparisons.

Is there any way to clear and suppress notifications like these when running our tests?

I'm not putting this under the MacOS platform specifically because I suspect we can get burned like this from Windows and Linux too.
To disable the "Try the new Safari" notification we can follow: https://apple.stackexchange.com/a/160074. It seems like this needs to be done before login.

To disable the "What's new in OS X …" notification, there are two solutions at https://www.jamf.com/jamf-nation/discussions/24198/can-the-what-s-new-in-mac-os-sierra-notification-be-suppressed-for-new-users

Rob, is this something you would be able to help with?
Assignee: nobody → relops
Component: Mochitest Chrome → RelOps
Flags: needinfo?(rthijssen)
Product: Testing → Infrastructure & Operations
QA Contact: klibby
Version: Version 3 → unspecified
apologies, i don't know my way around the osx test systems
Flags: needinfo?(rthijssen)
You're looking for kmoir, but you'll need to somehow make her forget that at least twice she's tried every googleable solution without success.
(In reply to Phil Ringnalda (:philor) from comment #3)
> You're looking for kmoir, but you'll need to somehow make her forget that at
> least twice she's tried every googleable solution without success.

OK, thanks! My solution in bug 1425502 seems to work for the current session if System Integrity Protection isn't enabled on the OS. Kim, did you try that approach?
Flags: needinfo?(kmoir)
(One detail I forgot about is that tests of our notification center integration may need the notification center UI service running so would need a way to restart it)

Comment 6

a month ago
I don't recall all the scenarios I tried, it was over a year ago.  If disabling the notification centre works in the test that's fine.  If it needs to be disabled all the time this is something we should setup in the config of the machines, not the test harness.
Flags: needinfo?(kmoir)
You need to log in before you can comment on or make changes to this bug.