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
68
gaia/tests/python/gaia-ui-tests/gaiatest/apps/calendar/regions/event.py
Executable file
68
gaia/tests/python/gaia-ui-tests/gaiatest/apps/calendar/regions/event.py
Executable file
|
|
@ -0,0 +1,68 @@
|
|||
# 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 datetime import datetime
|
||||
|
||||
from marionette_driver import expected, By, Wait
|
||||
|
||||
from gaiatest.apps.calendar.app import Calendar
|
||||
|
||||
|
||||
class NewEvent(Calendar):
|
||||
|
||||
_modify_event_view_locator = (By.ID, 'modify-event-view')
|
||||
_modify_event_header_locator = (By.ID, 'modify-event-header')
|
||||
_event_title_input_locator = (By.XPATH, "//input[@data-l10n-id='event-title']")
|
||||
_event_location_input_locator = (By.XPATH, "//input[@data-l10n-id='event-location']")
|
||||
_event_start_time_value_locator = (By.ID, "start-time-locale")
|
||||
_event_start_date_value_locator = (By.ID, "start-date-locale")
|
||||
_edit_event_button_locator = (By.CSS_SELECTOR, 'button.edit')
|
||||
_save_event_button_locator = (By.CSS_SELECTOR, 'button.save')
|
||||
|
||||
def wait_for_panel_to_load(self):
|
||||
Wait(self.marionette).until(expected.element_displayed(
|
||||
Wait(self.marionette).until(expected.element_present(
|
||||
*self._event_title_input_locator))))
|
||||
|
||||
def a11y_fill_event_title(self, title):
|
||||
self.accessibility.click(self.marionette.find_element(*self._event_title_input_locator))
|
||||
self.keyboard.send(title)
|
||||
self.keyboard.dismiss()
|
||||
|
||||
def fill_event_title(self, title):
|
||||
self.marionette.find_element(*self._event_title_input_locator).tap()
|
||||
self.keyboard.send(title)
|
||||
self.keyboard.dismiss()
|
||||
|
||||
def a11y_fill_event_location(self, location):
|
||||
self.accessibility.click(self.marionette.find_element(*self._event_location_input_locator))
|
||||
self.keyboard.send(location)
|
||||
self.keyboard.dismiss()
|
||||
|
||||
def fill_event_location(self, location):
|
||||
self.marionette.find_element(*self._event_location_input_locator).tap()
|
||||
self.keyboard.send(location)
|
||||
self.keyboard.dismiss()
|
||||
|
||||
def a11y_click_close_button(self):
|
||||
self.accessibility.execute_async_script(
|
||||
"Accessibility.click(arguments[0].shadowRoot.querySelector('button.action-button'));",
|
||||
[self.marionette.find_element(*self._modify_event_header_locator)])
|
||||
|
||||
def a11y_click_save_event(self):
|
||||
event_start_time = self.marionette.find_element(*self._event_start_time_value_locator).text
|
||||
event_start_date = self.marionette.find_element(*self._event_start_date_value_locator).text
|
||||
el = self.marionette.find_element(*self._modify_event_view_locator)
|
||||
self.accessibility.click(self.marionette.find_element(*self._save_event_button_locator))
|
||||
Wait(self.marionette).until(expected.element_not_displayed(el))
|
||||
return datetime.strptime(event_start_time + event_start_date, '%I:%M %p%m/%d/%Y')
|
||||
|
||||
def tap_save_event(self):
|
||||
date_str = self.marionette.find_element(*self._event_start_date_value_locator).get_attribute('data-date')
|
||||
el = self.marionette.find_element(*self._modify_event_view_locator)
|
||||
self.marionette.find_element(*self._save_event_button_locator).tap()
|
||||
Wait(self.marionette).until(expected.element_not_displayed(el))
|
||||
|
||||
date_list = date_str.split()
|
||||
return date_list[1] + ' ' + date_list[2]
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
# 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
|
||||
|
||||
from gaiatest.apps.base import Base
|
||||
|
||||
|
||||
class EventDetails(Base):
|
||||
|
||||
_event_header_locator = (By.ID, 'show-event-header')
|
||||
_title_locator = (By.CSS_SELECTOR, '.title .content')
|
||||
_location_locator = (By.CSS_SELECTOR, '.location .content')
|
||||
|
||||
def __init__(self, marionette):
|
||||
Base.__init__(self, marionette)
|
||||
|
||||
@property
|
||||
def title(self):
|
||||
return self.marionette.find_element(*self._title_locator).text
|
||||
|
||||
@property
|
||||
def location(self):
|
||||
return self.marionette.find_element(*self._location_locator).text
|
||||
Loading…
Reference in a new issue