Publish Vulpes Preview 15 sources for desktop, Android and Tundra
Share Gaia assets and adapters, keep private profiles and development documents local, and update both public READMEs.
This commit is contained in:
parent
93e3a48004
commit
b38dea0597
25901 changed files with 9982925 additions and 369 deletions
0
gaia/tests/python/gaia-ui-tests/gaiatest/apps/cost_control/__init__.py
Executable file
0
gaia/tests/python/gaia-ui-tests/gaiatest/apps/cost_control/__init__.py
Executable file
82
gaia/tests/python/gaia-ui-tests/gaiatest/apps/cost_control/app.py
Executable file
82
gaia/tests/python/gaia-ui-tests/gaiatest/apps/cost_control/app.py
Executable file
|
|
@ -0,0 +1,82 @@
|
|||
# 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.form_controls.binarycontrol import GaiaBinaryControl
|
||||
|
||||
|
||||
class CostControl(Base):
|
||||
|
||||
name = 'Usage'
|
||||
|
||||
_usage_app_main_locator = (By.ID, 'datausage-tab')
|
||||
_usage_app_title_locator = (By.CSS_SELECTOR, 'h1[data-l10n-id="usage"]')
|
||||
_settings_button_locator = (By.CSS_SELECTOR, 'button.settings-button')
|
||||
|
||||
_mobile_data_item_locator = (By.ID, 'mobileItem')
|
||||
_mobile_data_tracking_locator = (By.ID, 'mobileCheck')
|
||||
_mobile_data_label_locator = (By.CSS_SELECTOR, '#mobileItem label')
|
||||
_mobile_data_usage_figure_locator = (By.ID, 'mobileOverview')
|
||||
_wifi_data_item_locator = (By.ID, 'mobileItem')
|
||||
_wifi_data_tracking_locator = (By.ID, 'wifiCheck')
|
||||
_wifi_data_label_locator = (By.CSS_SELECTOR, '#wifiItem label')
|
||||
_wifi_data_usage_figure_locator = (By.ID, 'wifiOverview')
|
||||
|
||||
# FTE
|
||||
_ftu_frame_locator = (By.ID, 'fte_view')
|
||||
_ftu_section_locator = (By.ID, 'firsttime-view')
|
||||
|
||||
@property
|
||||
def is_mobile_data_tracking_on(self):
|
||||
return self._mobile_tracking_switch.is_checked
|
||||
|
||||
def disable_mobile_data_tracking(self):
|
||||
self._mobile_tracking_switch.disable()
|
||||
|
||||
@property
|
||||
def _mobile_tracking_switch(self):
|
||||
return GaiaBinaryControl(self.marionette, self._mobile_data_tracking_locator)
|
||||
|
||||
@property
|
||||
def is_wifi_data_tracking_on(self):
|
||||
return self._wifi_tracking_switch.is_checked
|
||||
|
||||
def enable_wifi_data_tracking(self):
|
||||
self._wifi_tracking_switch.enable()
|
||||
|
||||
@property
|
||||
def _wifi_tracking_switch(self):
|
||||
return GaiaBinaryControl(self.marionette, self._wifi_data_tracking_locator)
|
||||
|
||||
@property
|
||||
def mobile_data_usage_figure(self):
|
||||
return self.marionette.find_element(*self._mobile_data_usage_figure_locator).text
|
||||
|
||||
@property
|
||||
def wifi_data_usage_figure(self):
|
||||
return self.marionette.find_element(*self._wifi_data_usage_figure_locator).text
|
||||
|
||||
def run_ftu_accepting_defaults(self):
|
||||
"""Complete the 3 steps of the Usage app's FTU accepting all default values."""
|
||||
from gaiatest.apps.cost_control.regions.ftu_step1 import FTUStep1
|
||||
ftu_step1 = FTUStep1(self.marionette)
|
||||
ftu_step2 = ftu_step1.tap_next()
|
||||
ftu_step3 = ftu_step2.tap_next()
|
||||
ftu_step3.tap_lets_go()
|
||||
|
||||
def tap_settings(self):
|
||||
settings = Wait(self.marionette).until(
|
||||
expected.element_present(*self._settings_button_locator))
|
||||
Wait(self.marionette).until(expected.element_displayed(settings))
|
||||
settings.tap()
|
||||
from gaiatest.apps.cost_control.regions.settings import Settings
|
||||
return Settings(self.marionette)
|
||||
|
||||
def switch_to_ftu(self):
|
||||
ftu_iframe = self.marionette.find_element(*self._ftu_frame_locator)
|
||||
Wait(self.marionette).until(
|
||||
lambda m: 'non-ready' not in ftu_iframe.get_attribute('class') and
|
||||
ftu_iframe.is_displayed())
|
||||
self.marionette.switch_to_frame(ftu_iframe)
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
# 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/.
|
||||
|
||||
import time
|
||||
|
||||
from marionette_driver import expected, By, Wait
|
||||
from gaiatest.apps.base import Base
|
||||
from gaiatest.apps.cost_control.regions.ftu_step2 import FTUStep2
|
||||
|
||||
|
||||
class FTUStep1(Base):
|
||||
|
||||
_welcome_title_locator = (By.CSS_SELECTOR, 'h1[data-l10n-id="fte-welcome-title"]')
|
||||
_next_button_locator = (By.CSS_SELECTOR, '#step-1 button[data-l10n-id="next"]')
|
||||
|
||||
def __init__(self, marionette):
|
||||
Base.__init__(self, marionette)
|
||||
title = self.marionette.find_element(*self._welcome_title_locator)
|
||||
Wait(self.marionette).until(lambda m: title.location['x'] == 0)
|
||||
|
||||
def tap_next(self):
|
||||
# TODO Remove the sleep when Bug 1013249 is fixed
|
||||
time.sleep(2)
|
||||
next = Wait(self.marionette).until(
|
||||
expected.element_present(*self._next_button_locator))
|
||||
Wait(self.marionette).until(expected.element_displayed(next))
|
||||
next.tap()
|
||||
return FTUStep2(self.marionette)
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
# 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 By, Wait
|
||||
|
||||
from gaiatest.apps.cost_control.app import CostControl
|
||||
from gaiatest.apps.cost_control.regions.ftu_step3 import FTUStep3
|
||||
|
||||
|
||||
class FTUStep2(CostControl):
|
||||
|
||||
_view_locator = (By.ID, 'non-vivo-step-1')
|
||||
_reset_report_period_select_locator = (By.CSS_SELECTOR, '#non-vivo-step-1 gaia-select')
|
||||
_next_button_locator = (By.CSS_SELECTOR, '#non-vivo-step-1 button[data-l10n-id="next"]')
|
||||
|
||||
def __init__(self, marionette):
|
||||
CostControl.__init__(self, marionette)
|
||||
view = self.marionette.find_element(*self._view_locator)
|
||||
Wait(self.marionette).until(lambda m: view.location['x'] == 0)
|
||||
|
||||
def select_reset_report_value(self, value):
|
||||
self.marionette.find_element(
|
||||
*self._reset_report_period_select_locator).tap()
|
||||
self.select(value)
|
||||
self.switch_to_ftu()
|
||||
|
||||
def tap_next(self):
|
||||
self.marionette.find_element(*self._next_button_locator).tap()
|
||||
return FTUStep3(self.marionette)
|
||||
|
|
@ -0,0 +1,75 @@
|
|||
# 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/.
|
||||
|
||||
import time
|
||||
|
||||
from marionette_driver import expected, By, Wait
|
||||
from gaiatest.apps.cost_control.app import CostControl
|
||||
from gaiatest.form_controls.binarycontrol import GaiaBinaryControl
|
||||
|
||||
|
||||
class FTUStep3(CostControl):
|
||||
|
||||
_view_locator = (By.ID, 'non-vivo-step-2')
|
||||
_data_alert_switch_locator = (By.CSS_SELECTOR, '#non-vivo-step-2 gaia-switch[data-option="dataLimit"]')
|
||||
_data_alert_selector_locator = (By.CSS_SELECTOR, '#non-vivo-step-2 button[data-widget-type="data-limit"]')
|
||||
|
||||
# Data limit popup for changing limit volume and unit
|
||||
_data_limit_view_locator = (By.ID, 'data-limit-dialog')
|
||||
_data_limit_dialog_input_locator = (By.ID, 'data-limit-input')
|
||||
_data_limit_dialog_done_locator = (By.ID, 'data-usage-done-button')
|
||||
_data_limit_switch_unit_locator = (By.CSS_SELECTOR, '#data-limit-dialog .switch-unit-button')
|
||||
|
||||
_go_button_locator = (By.CSS_SELECTOR, '#non-vivo-step-2 button.recommend')
|
||||
|
||||
def __init__(self, marionette):
|
||||
CostControl.__init__(self, marionette)
|
||||
view = self.marionette.find_element(*self._view_locator)
|
||||
Wait(self.marionette).until(lambda m: view.rect['x'] == 0)
|
||||
|
||||
def enable_data_alert(self):
|
||||
self._data_alert_switch.enable()
|
||||
# Wait for Usage section to hide/display as required
|
||||
Wait(self.marionette).until(expected.element_displayed(*self._data_alert_selector_locator))
|
||||
|
||||
@property
|
||||
def is_data_alert_switch_checked(self):
|
||||
return self._data_alert_switch.is_checked
|
||||
|
||||
@property
|
||||
def _data_alert_switch(self):
|
||||
return GaiaBinaryControl(self.marionette, self._data_alert_switch_locator)
|
||||
|
||||
def select_when_use_is_above_unit_and_value(self, unit, value):
|
||||
self.marionette.find_element(*self._data_alert_selector_locator).tap()
|
||||
|
||||
data_limit_view = self.marionette.find_element(
|
||||
*self._data_limit_view_locator)
|
||||
Wait(self.marionette).until(lambda m: data_limit_view.location['y'] == 0)
|
||||
|
||||
current_unit = Wait(self.marionette).until(
|
||||
expected.element_present(*self._data_limit_switch_unit_locator))
|
||||
Wait(self.marionette).until(expected.element_displayed(current_unit))
|
||||
|
||||
if current_unit.text != unit:
|
||||
current_unit.tap()
|
||||
Wait(self.marionette).until(lambda m: current_unit.text == unit)
|
||||
|
||||
# clear the original assigned value and set it to the new value
|
||||
self.marionette.find_element(*self._data_limit_dialog_input_locator).clear()
|
||||
self.keyboard.send(value)
|
||||
self.switch_to_ftu()
|
||||
self.marionette.find_element(*self._data_limit_dialog_done_locator).tap()
|
||||
|
||||
data_limit_view = self.marionette.find_element(
|
||||
*self._data_limit_view_locator)
|
||||
Wait(self.marionette).until(lambda m: int(data_limit_view.location['y']) == int(data_limit_view.size['height']))
|
||||
|
||||
def tap_lets_go(self):
|
||||
self.marionette.find_element(*self._go_button_locator).tap()
|
||||
Wait(self.marionette).until(expected.element_not_displayed(*self._ftu_frame_locator))
|
||||
self.apps.switch_to_displayed_app()
|
||||
|
||||
# TODO Some wait for Usage to fully initialize
|
||||
time.sleep(2)
|
||||
108
gaia/tests/python/gaia-ui-tests/gaiatest/apps/cost_control/regions/settings.py
Executable file
108
gaia/tests/python/gaia-ui-tests/gaiatest/apps/cost_control/regions/settings.py
Executable file
|
|
@ -0,0 +1,108 @@
|
|||
# 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.form_controls.binarycontrol import GaiaBinaryControl
|
||||
|
||||
|
||||
class Settings(Base):
|
||||
_settings_iframe_locator = (By.ID, 'settings-view-placeholder')
|
||||
_settings_title_locator = (By.CSS_SELECTOR, 'section#settings-view h1')
|
||||
|
||||
_data_alert_switch_locator = (By.CSS_SELECTOR, 'gaia-switch[data-option="dataLimit"]')
|
||||
_when_use_is_above_button_locator = (By.CSS_SELECTOR, 'button[data-widget-type="data-limit"]')
|
||||
_unit_button_locator = (By.CSS_SELECTOR, '#data-limit-dialog form button')
|
||||
_size_input_locator = (By.CSS_SELECTOR, '#data-limit-dialog form input')
|
||||
_usage_done_button_locator = (By.ID, 'data-usage-done-button')
|
||||
|
||||
_reset_button_locator = (By.ID, 'reset-data-usage')
|
||||
_reset_dialog_locator = (By.ID, 'reset-data-dialog')
|
||||
_reset_wifi_usage_button_locator = (By.ID, 'reset-wifi-data-usage')
|
||||
_reset_mobile_usage_button_locator = (By.ID, 'reset-mobile-data-usage')
|
||||
_done_button_locator = (By.ID, 'close-settings')
|
||||
_confirm_reset_button_locator = (By.CSS_SELECTOR, '#reset-dialog button.danger')
|
||||
|
||||
def __init__(self, marionette):
|
||||
Base.__init__(self, marionette)
|
||||
self.switch_to_settings_iframe()
|
||||
|
||||
def switch_to_settings_iframe(self):
|
||||
# go into iframe of usage app settings
|
||||
frame = Wait(self.marionette).until(expected.element_present(
|
||||
*self._settings_iframe_locator))
|
||||
Wait(self.marionette).until(expected.element_displayed(frame))
|
||||
self.marionette.switch_to_frame(frame)
|
||||
|
||||
Wait(self.marionette).until(expected.element_displayed(
|
||||
Wait(self.marionette).until(expected.element_present(
|
||||
*self._settings_title_locator))))
|
||||
|
||||
def enable_data_alert_switch(self):
|
||||
GaiaBinaryControl(self.marionette, self._data_alert_switch_locator).enable()
|
||||
|
||||
@property
|
||||
def is_data_alert_switch_checked(self):
|
||||
return GaiaBinaryControl(self.marionette, self._data_alert_switch_locator).is_checked
|
||||
|
||||
def select_when_use_is_above_unit_and_value(self, unit, value):
|
||||
when_use_is_above_button = self.marionette.find_element(*self._when_use_is_above_button_locator)
|
||||
Wait(self.marionette).until(lambda m: when_use_is_above_button.get_attribute('disabled') == 'false')
|
||||
when_use_is_above_button.tap()
|
||||
|
||||
current_unit = Wait(self.marionette).until(
|
||||
expected.element_present(*self._unit_button_locator))
|
||||
Wait(self.marionette).until(expected.element_displayed(current_unit))
|
||||
if current_unit.text != unit:
|
||||
current_unit.tap()
|
||||
# We need to wait for the javascript to do its stuff
|
||||
Wait(self.marionette).until(lambda m: current_unit.text == unit)
|
||||
|
||||
# clear the original assigned value and set it to the new value
|
||||
size = Wait(self.marionette).until(expected.element_present(*self._size_input_locator))
|
||||
Wait(self.marionette).until(expected.element_displayed(size))
|
||||
size.clear()
|
||||
size.send_keys(value)
|
||||
self.marionette.find_element(*self._usage_done_button_locator).tap()
|
||||
|
||||
def tap_confirm_reset(self):
|
||||
confirm_reset_button = Wait(self.marionette).until(
|
||||
expected.element_present(*self._confirm_reset_button_locator))
|
||||
Wait(self.marionette).until(expected.element_displayed(confirm_reset_button))
|
||||
|
||||
self.tap_element_from_system_app(confirm_reset_button)
|
||||
|
||||
# go back to iframe of usage app settings
|
||||
self.apps.switch_to_displayed_app()
|
||||
self.switch_to_settings_iframe()
|
||||
|
||||
def reset_wifi_usage(self):
|
||||
self.marionette.find_element(*self._reset_button_locator).tap()
|
||||
|
||||
reset_wifi_usage = Wait(self.marionette).until(
|
||||
expected.element_present(*self._reset_wifi_usage_button_locator))
|
||||
Wait(self.marionette).until(expected.element_displayed(reset_wifi_usage))
|
||||
reset_dialog = self.marionette.find_element(*self._reset_dialog_locator)
|
||||
reset_wifi_usage.tap()
|
||||
|
||||
self.tap_confirm_reset()
|
||||
|
||||
|
||||
def reset_mobile_usage(self):
|
||||
self.marionette.find_element(*self._reset_button_locator).tap()
|
||||
reset_mobile_usage = Wait(self.marionette).until(
|
||||
expected.element_present(*self._reset_mobile_usage_button_locator))
|
||||
Wait(self.marionette).until(expected.element_displayed(reset_mobile_usage))
|
||||
reset_dialog = self.marionette.find_element(*self._reset_dialog_locator)
|
||||
reset_mobile_usage.tap()
|
||||
|
||||
self.tap_confirm_reset()
|
||||
|
||||
def tap_done(self):
|
||||
done_button = Wait(self.marionette).until(
|
||||
expected.element_present(*self._done_button_locator))
|
||||
Wait(self.marionette).until(expected.element_displayed(done_button))
|
||||
done_button.tap()
|
||||
# Switch back to Cost Control app frame
|
||||
self.apps.switch_to_displayed_app()
|
||||
Loading…
Reference in a new issue