QA/Push Notifications
Test Plan (Overview) 
SUMMARY
- The purpose of this wiki is to serve as a general testplan for verifying desktop Push notifications.
OWNERSHIP
- Manual tests will be defined / outlined and executed by the Cloud Services QA Team
- Manual testing will be handed off to Firefox Quality Engineering Team
- Automated E2E smoke tests will be created by the Cloud Services QA Team
- Any further feature automation is TBD (by Firefox Quality Engineering Team)
TEST RESULTS
- Test results will be posted in Bugzilla (component: TBD).
SIGNOFF CRITERIA
Cloud Services QA team will verify that:
- Desktop push notifications are working properly in FF Nightly.
- Interaction between push-service (autopush[3]), ServiceWorkers[1], and desktop UI is working as expected.
Testplan (Overview)
REFERENCE
- [1] http://www.w3.org/TR/service-workers/
- [2] http://www.w3.org/TR/push-api/
- [3] autopush: https://github.com/mozilla-services/autopush/
- [4] push-service: https://github.com/mozilla-services/push-service
Test Cases
NOTIFICATIONS API
Common
Shared steps between Notifications tests:
setup()
- Open https://pdehaan.github.io/push-notification-test/
- Click pop Notification button.
teardown()
- Click on lock icon in the address bar.
- Set Show Notifications permission to "Always Ask".
Tests
Notes: Manual/Automation: Test will be conducted manually Browser Window: Test will be conducted in standard browser window and Private browser windows Platforms: 32bit/64 bit Windows 7, Vista, 8, 8.1, 10; Ubuntu 14.04 (x64) and Mac OS X 10.9.5.
Name: Doorhanger default state test
Description: Verify the doorhanger reports if the site has requested any notification permissions.
Steps:
- Click the lock icon in the address bar.
- Verify the permissisons section says "You have not granted this site any special permissions."
Name: Notification: Pop-up Dialog
Description: Verify that trying to display a notification causes a dialog to appear.
Steps:
setup()
- Click the "close" button in the upper right corner of the notifications doorhanger.
- Click "pop Notification" button.
- Verify the notification doorhanger appears again and requests permissions.
Name: Notification: Close Dialog by External Means / Non-Close Button
Description: Verify clicking outside of a notification dismisses it automatically (OS X only).
Steps:
setup()
- Click outside of the notifications doorhanger.
- Verify the notifications doorhanger is dismissed.
Name: Notification: Learn More Link
Description: Verify clicking on the "Learn more" link opens the target page.
Steps:
setup()
- Click the "Learn more..." link in the notifications doorhanger.
- Verify the browser redirects to https://www.mozilla.org/en-US/firefox/push/ (in a new tab).
Name: Notification: Auto Close (Timeout)
Description: Verify that a notification is auto-closed after X seconds.
Steps:
setup()
- Select "Always Show Notifications" from the notifications doorhanger.
- Verify the notification appears and auto-dismisses after X seconds.
teardown()
Name: Notification: Blocking Notifications
Description: Verify that blocking notifications prevents notifications from displaying.
Steps:
setup()
- Select "Always Block Notifications" from the notifications doorhanger.
- Verify no notification appears.
- Click "pop Notification" button.
- Verify no notification appears.
teardown()
Name: Notification: Not Now
Description: Verify clicking "Not Now" from the notification permissions doorhanger causes the permissions popup to appear again.
Steps:
setup()
- Select "Not Now" from the notifications doorhanger.
- Verify no notification appears.
- Click "pop Notification" button.
- Verify notification doorhanger appears again.
teardown()
Name: Notification: Permission Changes
Description: Verify changing notification permissions in the address bar causes the notification permissions screen to reappear.
Steps:
setup()
- Select "Always Show Notifications" from the notifications doorhanger.
- Verify notification appears and auto-dismisses after X seconds.
- Click the lock button in the address bar.
- Change notification permissions to "Always Ask".
- Click "pop Notification" button.
- Verify notification doorhanger appears again.
- Select "Always Show Notifications" from the notifications doorhanger.
- Verify notification appears.
- Click the lock button in the address bar.
- Change notification permissions to "Block".
- Click "pop Notification" button.
- Verify no notification appears.
- Click the lock button in the address bar.
- Change notification permissions to "Allow".
- Click "pop Notification" button appears.
- Verify notification appears.
teardown()
Name: Notification: Programmatic Close
Description: Verify programmatically closing a notification causes it to immediately disappear.
Steps:
setup()
- Select "Always Show Notifications" from the notifications doorhanger.
- Verify notification appears.
- Click "closeNotification" button.
- Verify notification is immediately dismissed.
teardown()
Name: Notification: Title Characters & Numbers
Description: Verify title can contain special characters like % or /.
Steps:
- Open https://pdehaan.github.io/push-notification-test/
- Set "Title Text"to a a long string which contains special characters like %.
- Click "pop Notification" button.
- Verify the title text is accurately displayed.
teardown()
Name: Notification: Swipe to Close
Description: Verify notification can be manually dismissed by swiping it (OS X only).
Steps:
setup()
- Select "Always Show Notifications" from the notifications doorhanger.
- Click and drag notification to dismiss it.
teardown()
Name: Push: Register Service Worker
Description: Verify registering a service worker causes it to appear in about:serviceworkers..
Steps:
setup()
- Verify HTML output is:
registering service worker registered service worker. scope: https://pdehaan.github.io/push-notification-test/
- Click "Check Service Worker" button.
- Verify HTML output is:
checking service worker Service worker active
teardown()
Name: Notification: Require Interaction = True
Description: Verify setting `requireInteraction` to true causes the notification to remain open until explicitly closed (OS X only).
Steps:
setup()
- Select "Always Show Notifications" from the notifications doorhanger.
- Set "requireInteraction" dropdown to `true`.
- Click "pop Notification" button.
- Verify that the notification persists until explicitly closed.
teardown()
Name: Notification: Require Interaction = False
Description: Verify setting `requireInteraction` to false (default) causes the notification to auto-close after X seconds.
Steps:
setup()
- Select "Always Show Notifications" from the notifications doorhanger.
- Set "requireInteraction" dropdown to `false`.
- Click "pop Notification" button.
- Verify the notification auto dismisses after X seconds.
teardown()
Name: Notification: Redirection = New Tab
Description: Verify clicking on a notification opens a specified URL.
Steps:
setup()
- Select "Always Show Notifications" from the notifications doorhanger.
- Click on the notification.
- Verify that https://www.mozilla.org/en-US/ opens in a new tab.
teardown()
Name: Notification: Redirection = Current Tab
Description: Verify setting target opens specified URL in the specified window.
Steps:
- Open https://pdehaan.github.io/push-notification-test/
- Set "target" to `_top`.
- Click "pop Notification" button.
- Select "Always Show Notifications" from the notifications doorhanger.
- Verify that https://www.mozilla.org/en-US/ opens in the current tab.
teardown()
Name: Notification: Redirection = Same Window New Tab
Description: Verify setting a target causes a notification to open in the same window.
Steps:
- Open https://pdehaan.github.io/push-notification-test/
- Set "target" to `foobar`.
- Click "pop Notification" button.
- Select "Always Show Notifications" from the notifications doorhanger.
- Verify that https://www.mozilla.org/en-US/ opens in a new tab.
- Click "pop Notification" button.
- Verify that https://www.mozilla.org/en-US/ opens in the same tab as step 5.
teardown()
Name: Notification: Target = _blank
Description: Verify setting a _blank target causes a notification to open in the new window.
Steps:
- Open https://pdehaan.github.io/push-notification-test/
- Set "target" to `_blank` (default).
- Click "pop Notification" button.
- Select "Always Show Notifications" from the notifications doorhanger.
- Verify that https://www.mozilla.org/en-US/ opens in a new tab.
- Click "pop Notification" button.
- Verify that https://www.mozilla.org/en-US/ opens in a new tab.
teardown()
Name: Notification: Multi/Repeat Message (Stacking)
Description: Verify clicking the pop Notification button causes the notification to display multiple times.
Steps:
setup()
- Select "Always Show Notifications" from the notifications doorhanger.
- Click "pop Notification" button 10 times.
- Verify the notification only appears once (and says "9 new notifications").
- Verify there are 11 notifications in the OSX notifications tray.
teardown()
Name: Notification: Hover Over Notification
Description: Verify the notification is not dismissed when hovering over the notification.
Steps:
setup()
- Select "Always Show Notifications" from the notifications doorhanger.
- Hover over the notification and make sure the notification is not auto-dismissed.
- Move mouse off of notification.
- Verify that the notification disappears after X seconds.
teardown()
Name: Notification: Hover Over Submenu
Description: Verify the notification is not dismissed when hovering over an item in the submenu (OS X only).
Steps:
setup()
- Select "Always Show Notifications" from the notifications doorhanger.
- Hover over the notification and click the "..." button in the lower-right corner.
- Click "Disable notifications from this site" menu option.
- Click "pop Notification" button.
- Verify notification doorhanger appears.
teardown()
Name: Notification Settings: Preferences - Blocking
Description: Verify clicking Notification Settings in the notification causes the preferences page to appear.
Steps:
setup()
- Select "Always Show Notifications" from the notifications doorhanger.
- Hover over the notification and click the "..." button in the lower-right corner.
- Click "Notification settings" menu option.
- Verify that about:preferences#content opens in a new tab.
teardown()
Name: Notification: Preferences - Choose
Description: Verify allowing notifications reports correctly in about:preferences#content
Steps:
setup()
- Select "Always Show Notifications" from the notifications doorhanger.
- Open about:preferences#content
- Click "Choose" button.
- Verify that https://pdehaan.github.io/ appears in site list and it's status is set to "Allow".
teardown()
Name: Notification: Preferences - Blocking
Description: Verify blocking notifications reports correctly in about:preferences#content
Steps:
setup()
- Select "Always Block Notifications" from the notifications doorhanger.
- Open about:preferences#content
- Click "Choose" button.
- Verify that https://pdehaan.github.io/ appears in site list and it's status is set to "Block".
teardown()
Name: Notification: Title > Size and Text Wrapping
Description: Verify a long "Title" doesn't cause the notification to resize.
Steps:
- Open https://pdehaan.github.io/push-notification-test/
- Set "Title"to a a long string.
- Click "pop Notification" button.
- Verify the title text truncates and doesn't re-size notification popup. Width remains static, length may adjust.
teardown()
Name: Notification: Body > Size ant Text Wrapping
Description: Verify a long "Body Text" doesn't cause the notification to resize.
Steps:
- Open https://pdehaan.github.io/push-notification-test/
- Set "Body Text"to a a long string.
- Click "pop Notification" button.
- Verify the body text truncates and doesn't re-size notification popup. Width remains static, length may adjust.
teardown()
Name: Notification: Title Characters & Numbers
Description: Verify title can contain special characters like % or /.
Steps:
- Open https://pdehaan.github.io/push-notification-test/
- Set "Title Text"to a a long string which contains special characters like %.
- Click "pop Notification" button.
- Verify the title text is accurately displayed.
teardown()
Name: Notification: Body Text Characters & Numbers
Description: Verify body can contain special characters like % or /.
Steps:
- Open https://pdehaan.github.io/push-notification-test/
- Set "Body Text"to a a long string which contains special characters like % or an emoji like :D
- Click "pop Notification" button.
- Verify the body text is accurately displayed.
teardown()
Name: Push: Register Service Worker
Description: Verify registering a service worker causes it to appear in about:serviceworkers.
Steps:
- setup()
- Verify HTML output is:
registering service worker registered service worker. scope: https://pdehaan.github.io/push-notification-test/
- Click "Check Service Worker" button.
- Verify HTML output is:
checking service worker Service worker active
- Open about:serviceworkers
- Verify service worker is registered to https://pdehaan.github.io/ origin.
- Go back to https://pdehaan.github.io/push-notification-test/
- Click "Unregister Service Worker" button.
- Open about:serviceworkers
- Verify "No Service Workers registered." message (refresh page if it was previously open tab).
- teardown()
Name: Push: Service Worker
Description: Verify sending a message to a service worker causes it to echo the message.
Steps:
- setup()
- Click "subscribe to push" button.
- Click "sendMsgToSW" button.
- Verify "messageChannel.port1.onmessage: SW echo: HelloWorld" output on page.
- Change text box value to "999".
- Click "sendMsgToSW" button.
- Verify "messageChannel.port1.onmessage: SW echo: 999" output on page.
- teardown()
Sign off
Criteria All the test cases must be executed. All the blocker, critical, major bugs have been fixed.
PUSH API
Common
Shared steps between Push API tests:
setup()
- Open https://pdehaan.github.io/push-notification-test/
- Click "register Service Worker" button.
teardown()
- Click "Unregister Service Worker" button.
Tests
Name: TBD
Description: Verify registering a service worker causes it to appear in about:serviceworkers.
Steps:
setup()
- Verify HTML output is:
registering service worker
registered service worker. scope: https://pdehaan.github.io/push-notification-test/
- Click "Check Service Worker" button.
- Verify HTML output is:
checking service worker
Service worker active
- Open about:serviceworkers
- Verify service worker is registered to https://pdehaan.github.io/ origin.
- Go back to https://pdehaan.github.io/push-notification-test/
- Click "Unregister Service Worker" button.
- Open about:serviceworkers
- Verify "No Service Workers registered." message (refresh page if it was previously open tab).
teardown()
Name: TBD
Description: Verify sending a message to a service worker causes it to echo the message.
Steps:
setup()
- Click "subscribe to push" button.
- Click "sendMsgToSW" button.
- Verify "messageChannel.port1.onmessage: SW echo: HelloWorld" output on page.
- Change text box value to "999".
- Click "sendMsgToSW" button.
- Verify "messageChannel.port1.onmessage: SW echo: 999" output on page.
teardown()
TODO
Test's for:
- Quota, the limit of silent push messages that a user agent (UA) can receive when off web site before UA is unsubscribed from push for that domain. Approximately 30 messages if send every five minutes when off site, less for longer duration.
- Restart browser and off site behaviors
- TTL - time which a message will be dropped if UA is is not online. For example: if TTL=60 and a UA is offline for 59 seconds, they should receive the push message when they come online. If online after 61 seconds, message will be dropped, and UA will not receive message.
- Test different browser modes: e10s/Multi-process mode, Private browsing mode (ServiceWorkers don't work in that mode)
- Test unregistering service worker and verify notifications were not sent.
- Test disable push events should block any push message communication to device.
- Test Do Not Disturb till Fx is restarted.
- Test edge case - multiple browser profiles and multiple tabs doing SW/push subscription.
PUSH API - REFERENCE
Push WebSocket Endpoints:
source: | https://mana.mozilla.org/wiki/display/SVCOPS/SimplePush#SimplePush-Deployments |
PUSH ENDPOINTS - STAGE:
Production: | wss://push.services.mozilla.com/ |
Production: | wss://updates.push.services.mozilla.com/ |
Staging: | wss://autopush.stage.mozaws.net/ |
Staging: | wss://updates-autopush.stage.mozaws.net/ |
Dev: | wss://autopush.dev.mozaws.net/ |
STATUS / HEALTH:
Production: | https://updates.push.services.mozilla.com/health |
Production: | https://updates.push.services.mozilla.com/status |
Staging: | https://updates-autopush.stage.mozaws.net/health |
CONTACTS
- pdehaan@mozilla
- rpappalardo@mozilla
- ryanvm@mozilla