This repository has been archived by the owner on Nov 3, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20158 from yzen/bug-1018214
Bug 1018214, Bug 1021710 - utility tray gaia-ui tests with some tweaks to hopefully avoid intermittents.
- Loading branch information
Showing
10 changed files
with
160 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
tests/python/gaia-ui-tests/gaiatest/apps/system/regions/status_bar.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# This Source Code Form is subject to the terms of the Mozilla Public | ||
# License, v. 2.0. If a copy of the MPL was not distributed with this | ||
# file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
|
||
from marionette.by import By | ||
from gaiatest.apps.base import Base | ||
|
||
|
||
class StatusBar(Base): | ||
_status_bar_time_locator = (By.ID, 'statusbar-time') | ||
|
||
def a11y_wheel_status_bar_time(self): | ||
self.accessibility.wheel(self.marionette.find_element( | ||
*self._status_bar_time_locator), 'down') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
...gaia-ui-tests/gaiatest/tests/accessibility/system/test_a11y_utility_tray_notifications.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# This Source Code Form is subject to the terms of the Mozilla Public | ||
# License, v. 2.0. If a copy of the MPL was not distributed with this | ||
# file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
|
||
from marionette.by import By | ||
from gaiatest import GaiaTestCase | ||
from gaiatest.apps.system.app import System | ||
|
||
|
||
class TestUtilityTrayNotificationsAccessibility(GaiaTestCase): | ||
|
||
def setUp(self): | ||
GaiaTestCase.setUp(self) | ||
self.system = System(self.marionette) | ||
|
||
def test_a11y_utility_tray_notifications(self): | ||
self.system.wait_for_status_bar_displayed() | ||
|
||
utility_tray = self.system.open_utility_tray() | ||
utility_tray.wait_for_notification_container_displayed() | ||
|
||
self.marionette.execute_script('new Notification("Title", {body: "Body"});') | ||
# Assert there is one notification is listed in notifications-container | ||
notifications = utility_tray.notifications | ||
self.assertEqual(1, len(notifications), 'Expected one notification.') | ||
|
||
# Clear the notification by "Clear all" | ||
utility_tray.a11y_clear_all_notifications() | ||
|
||
# wait for the notifications to be cleared | ||
self.wait_for_condition(lambda m: len(utility_tray.notifications) == 0) |
24 changes: 24 additions & 0 deletions
24
...thon/gaia-ui-tests/gaiatest/tests/accessibility/system/test_a11y_utility_tray_settings.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# This Source Code Form is subject to the terms of the Mozilla Public | ||
# License, v. 2.0. If a copy of the MPL was not distributed with this | ||
# file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
|
||
from gaiatest import GaiaTestCase | ||
from gaiatest.apps.system.app import System | ||
|
||
|
||
class TestUtilityTraySettingsAccessibility(GaiaTestCase): | ||
|
||
def setUp(self): | ||
GaiaTestCase.setUp(self) | ||
self.system = System(self.marionette) | ||
|
||
def test_a11y_utility_tray_settings(self): | ||
self.system.wait_for_status_bar_displayed() | ||
|
||
utility_tray = self.system.open_utility_tray() | ||
utility_tray.wait_for_notification_container_displayed() | ||
|
||
settings = utility_tray.a11y_click_quick_settings_full_app() | ||
|
||
# Make sure that Settings is the currently displayed app. | ||
self.assertEquals(self.apps.displayed_app.name, settings.name) |
35 changes: 35 additions & 0 deletions
35
...on/gaia-ui-tests/gaiatest/tests/accessibility/system/test_a11y_utility_tray_visibility.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# This Source Code Form is subject to the terms of the Mozilla Public | ||
# License, v. 2.0. If a copy of the MPL was not distributed with this | ||
# file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
|
||
from gaiatest import GaiaTestCase | ||
from gaiatest.apps.system.app import System | ||
from gaiatest.apps.system.regions.status_bar import StatusBar | ||
from gaiatest.apps.system.regions.utility_tray import UtilityTray | ||
|
||
|
||
class TestUtilityTrayVisibilityAccessibility(GaiaTestCase): | ||
|
||
def setUp(self): | ||
GaiaTestCase.setUp(self) | ||
self.system = System(self.marionette) | ||
self.status_bar = StatusBar(self.marionette) | ||
self.utility_tray = UtilityTray(self.marionette) | ||
|
||
def test_a11y_utility_tray_visibility(self): | ||
self.system.wait_for_status_bar_displayed() | ||
|
||
utility_tray_container = self.marionette.find_element(*self.system._utility_tray_locator) | ||
|
||
# Utility tray is hidden by default. | ||
self.assertTrue(self.accessibility.is_hidden(utility_tray_container)) | ||
|
||
self.status_bar.a11y_wheel_status_bar_time() | ||
|
||
# Utility tray should now be visible. | ||
self.assertFalse(self.accessibility.is_hidden(utility_tray_container)) | ||
|
||
self.utility_tray.a11y_wheel_utility_tray_grippy() | ||
|
||
# Utility tray should now be hidden. | ||
self.assertTrue(self.accessibility.is_hidden(utility_tray_container)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters