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 #13692 from qba73/emailkeyboard
Browse files Browse the repository at this point in the history
Bug 938577 - Adding email keyboard test.
  • Loading branch information
Zac committed Nov 14, 2013
2 parents 5760037 + 7fe4e5f commit 603f7e0
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 0 deletions.
Expand Up @@ -9,6 +9,7 @@
class KeyboardPage(Base):
_number_input_locator = (By.CSS_SELECTOR, 'input[type="number"]')
_text_input_locator = (By.CSS_SELECTOR, 'input[type="text"]')
_email_input_locator = (By.CSS_SELECTOR, 'input[type="email"]')
_frame_locator = (By.CSS_SELECTOR, "#test-iframe[src*='keyboard']")

def __init__(self, marionette):
Expand Down Expand Up @@ -37,3 +38,14 @@ def tap_text_input(self):
@property
def text_input(self):
return self.marionette.find_element(*self._text_input_locator).get_attribute('value')

def tap_email_input(self):
self.marionette.find_element(*self._email_input_locator).tap()
from gaiatest.apps.keyboard.app import Keyboard

return Keyboard(self.marionette)

@property
def email_input(self):
return self.marionette.find_element(*self._email_input_locator).get_attribute('value')

Expand Up @@ -6,3 +6,5 @@ b2g = true
[test_number_keyboard.py]

[test_keyboard_predictive_key.py]

[test_email_keyboard.py]
@@ -0,0 +1,36 @@
# -*- coding: iso-8859-15 -*-
# 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 gaiatest import GaiaTestCase
from gaiatest.apps.ui_tests.app import UiTests


class TestEmailKeyboard(GaiaTestCase):

def test_basic_email_keyboard(self):
self.ui_tests = UiTests(self.marionette)
self.ui_tests.launch()
self.ui_tests.tap_ui_button()

keyboard_page = self.ui_tests.tap_keyboard_option()
keyboard_page.switch_to_frame()

keyboard = keyboard_page.tap_email_input()
keyboard.switch_to_keyboard()
keyboard.send('post')
self.marionette.switch_to_frame()
self.marionette.switch_to_frame(self.ui_tests.app.frame)

keyboard_page.switch_to_frame()
keyboard_page.tap_email_input()
keyboard.switch_to_keyboard()
keyboard._tap('@')
keyboard.send('mydomain.com')
self.marionette.switch_to_frame()
self.marionette.switch_to_frame(self.ui_tests.app.frame)

keyboard_page.switch_to_frame()
typed_email_adress = keyboard_page.email_input
self.assertEqual(typed_email_adress, u'post@mydomain.com')

0 comments on commit 603f7e0

Please sign in to comment.