This repository has been archived by the owner on Nov 3, 2021. It is now read-only.
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 #20694 from zacc/bug_1000037
Bug 1000037 - Refactor and re-enable test_import_contacts_gmail.py
- Loading branch information
Showing
5 changed files
with
41 additions
and
26 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
31 changes: 31 additions & 0 deletions
31
tests/python/gaia-ui-tests/gaiatest/apps/contacts/regions/contact_import_picker.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.apps.base import Base | ||
|
||
class ContactImportPicker(Base): | ||
|
||
_contact_import_picker_frame_locator = (By.ID, 'fb-extensions') | ||
_import_button_locator = (By.ID, 'import-action') | ||
|
||
def __init__(self, marionette): | ||
Base.__init__(self, marionette) | ||
self.wait_for_element_displayed(*self._contact_import_picker_frame_locator) | ||
select_contacts = self.marionette.find_element(*self._contact_import_picker_frame_locator) | ||
self.marionette.switch_to_frame(select_contacts) | ||
|
||
def tap_import_button(self): | ||
self.marionette.execute_script('window.wrappedJSObject.importer.ui.importAll()', special_powers=True) | ||
# TODO uncomment this when Bug 932804 is resolved | ||
# self.marionette.find_element(*self._import_button_locator).tap() | ||
self.apps.switch_to_displayed_app() | ||
self.wait_for_element_not_displayed(*self._contact_import_picker_frame_locator) | ||
from gaiatest.apps.contacts.regions.settings_form import SettingsForm | ||
return SettingsForm(self.marionette) | ||
|
||
def tap_select_all(self): | ||
# TODO replace this with proper tap when Bug 932804 is resolved | ||
self.marionette.execute_script('window.wrappedJSObject.importer.ui.selectAll()', special_powers=True) | ||
self.wait_for_condition(lambda m : m.find_element(*self._import_button_locator).is_enabled()) |
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