title: XCTest how to toggle Notification Switch in OS Settings?
body: <p>I'm trying to Enable / Disable the OS Notification Switch for the app I'm testing and I'm unable to.  I get as far as the Settings &gt; Notifications &gt; App screen itself but the switch doesn't seem to have a button I can interact with.</p>
  <p>This is how far I get:</p>
  <pre><code>let settingsApp = XCUIApplication(bundleIdentifier: &quot;com.apple.Preferences&quot;)
          settingsApp.launch()
          
  settingsApp.tables.cells.staticTexts[&quot;Notifications&quot;].tap()
  settingsApp.tables.cells.staticTexts[&quot;app_name&quot;].tap()
  </code></pre>
  <p>So far so good but here the button list is returned like this:</p>
  <pre><code>Failed to get matching snapshot: No matches found for Element at index 7 from input {(
      Button,
      Button, identifier: 'Lock Screen', Selected,
      Button, identifier: 'Notification Center',
      Button, identifier: 'Banners',
      Button, Disabled,
      Button, Disabled
  )}
  </code></pre>
  <p>I've tried <code>settingsApp.buttons.element(boundBy: 0).tap()</code> but that ends up being the back button and boundBy: 1 ends up being the 'Lock Screen' button.</p>
  <p>Is the 'Allow Notifications' toggle un-tappable? :)</p>