Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Commit

Permalink
Merge pull request #15765 from zacc/bug_964722
Browse files Browse the repository at this point in the history
Bug 964722 - Refactor and reenable test_dialer_add_contact.py for desktop and device r=bebe
  • Loading branch information
bebef1987 committed Jan 29, 2014
2 parents 672f7c0 + 817525d commit 7193b1a
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 10 deletions.
Expand Up @@ -2,6 +2,8 @@
# 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.by import By
from gaiatest.apps.base import Base

Expand Down Expand Up @@ -167,8 +169,13 @@ def __init__(self, marionette):
done = self.marionette.find_element(*self._done_button_locator)
self.wait_for_condition(lambda m: done.location['y'] == 0)

def tap_done(self):
def tap_done(self, return_contacts=True):
# NewContact can be opened as an Activity from other apps. In this scenario we don't return Contacts
self.marionette.find_element(*self._done_button_locator).tap()
self.wait_for_element_not_displayed(*self._done_button_locator)
from gaiatest.apps.contacts.app import Contacts
return Contacts(self.marionette)
if return_contacts:
self.wait_for_element_not_displayed(*self._done_button_locator)
from gaiatest.apps.contacts.app import Contacts
return Contacts(self.marionette)
else:
# Bug 947317 Marionette exception after tap closes a frame
time.sleep(2)
Expand Up @@ -12,9 +12,6 @@ skip-if = device == "desktop"
skip-if = device == "desktop"

[test_dialer_add_contact.py]
skip-if = device == "desktop"
expected = fail
disabled = Bug 947317 - MarionetteException after a tap() closes a frame

[test_call_log_all_calls.py]
skip-if = device == "desktop"
Expand Down
Expand Up @@ -37,11 +37,10 @@ def test_dialer_add_contact(self):
new_contact.type_given_name(self.contact['givenName'][0])
new_contact.type_family_name(self.contact['familyName'][0])

# Click Done button
new_contact.tap_done()
# Click Done button, don't return Contacts because we return to Dialer
new_contact.tap_done(return_contacts=False)

# Switch back to keypad-view
self.wait_for_condition(lambda m: self.apps.displayed_app.name == self.phone.name)
self.apps.switch_to_displayed_app()

#Go to Contact list and Verify result
Expand Down
Expand Up @@ -30,6 +30,7 @@ disabled = Bug 946130
[functional/contacts/test_sort_contacts.py]
[functional/contacts/test_delete_contact.py]
[functional/contacts/test_add_contact_to_favorites.py]
[functional/dialer/test_dialer_add_contact.py]
[functional/everythingme/test_everythingme_launch_packaged_app.py]
[functional/homescreen/test_homescreen_edit_mode.py]
[functional/homescreen/test_homescreen_move_app.py]
Expand Down

0 comments on commit 7193b1a

Please sign in to comment.