# 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_driver import expected, By, Wait
from gaiatest.apps.base import Base
from gaiatest.apps.base import PageRegion
[docs]class SleepScreen(Base):
_sleep_menu_locator = (By.ID, "sleep-menu")
_menu_items_locator = (By.CSS_SELECTOR, "#sleep-menu-container > section > ul > li")
_cancel_button_locator = (By.CSS_SELECTOR, "#sleep-menu-container > gaia-buttons > button")
@property
def is_menu_visible(self):
return self.is_element_displayed(*self._sleep_menu_locator)
@property
def menu_items(self):
return [self.MenuItem(self.marionette, item)
for item in self.marionette.find_elements(*self._menu_items_locator)]