Exemplo n.º 1
0
class TestPhoneSelectToolbars(GaiaImageCompareTestCase):

    def setUp(self):
        GaiaImageCompareTestCase.setUp(self)
        self.phone = Phone(self.marionette)
        self.phone.launch()

    def test_phone_select_toolbars(self):

        # Screen reader activated call log button click.
        self.phone.a11y_click_call_log_toolbar_button()

        # Keypad is hidden from the screen reader.
        self.assertTrue(self.accessibility.is_hidden(self.marionette.find_element(
            *self.phone._keypad_toolbar_locator)))
        # Contacts is hidden from the screen reader.
        self.assertTrue(self.accessibility.is_hidden(self.marionette.find_element(
            *self.phone._contacts_toolbar_locator)))
        # Call log is visible to the screen reader.
        self.assertFalse(self.accessibility.is_hidden(self.marionette.find_element(
            *self.phone._call_log_toolbar_locator)))

        self.take_screenshot()

        # Screen reader activated contacts button click.
        self.phone.a11y_click_contacts()
        self.apps.switch_to_displayed_app()

        # Keypad is hidden from the screen reader.
        self.assertTrue(self.accessibility.is_hidden(self.marionette.find_element(
            *self.phone._keypad_toolbar_locator)))
        # Contacts is visible to the screen reader.
        self.assertFalse(self.accessibility.is_hidden(self.marionette.find_element(
            *self.phone._contacts_toolbar_locator)))
        # Call log is hidden from the screen reader.
        self.assertTrue(self.accessibility.is_hidden(self.marionette.find_element(
            *self.phone._call_log_toolbar_locator)))
        self.take_screenshot()

        # Screen reader activated keypad button click.
        self.phone.a11y_click_keypad_toolbar_button()

        # Keypad is visible to the screen reader.
        self.assertFalse(self.accessibility.is_hidden(self.marionette.find_element(
            *self.phone._keypad_toolbar_locator)))
        # Contacts is hidden from the screen reader.
        self.assertTrue(self.accessibility.is_hidden(self.marionette.find_element(
            *self.phone._contacts_toolbar_locator)))
        # Call log is hidden from the screen reader.
        self.assertTrue(self.accessibility.is_hidden(self.marionette.find_element(
            *self.phone._call_log_toolbar_locator)))
        self.take_screenshot()
Exemplo n.º 2
0
class TestAccessibilityPhoneEditContact(GaiaTestCase):
    def setUp(self):
        # Start application in Phone App
        GaiaTestCase.setUp(self)
        self.phone = Phone(self.marionette)
        self.phone.launch()

    def test_a11y_phone_edit_contact(self):

        # Add a random contact
        contacts = self.phone.a11y_click_contacts()

        # Add new contact
        new_contact_form = contacts.a11y_click_new_contact()

        # Enter data into fields
        contact = MockContact()
        new_contact_form.type_given_name(contact['givenName'])

        # Save new contact
        new_contact_form.a11y_click_done()
        self.wait_for_condition(lambda m: len(contacts.contacts) == 1)

        # Edit the contact
        contact_item = contacts.contact(contact['givenName'])
        contact_item_detail = contact_item.a11y_click()
        contact_item_edit = contact_item_detail.a11y_click_edit()

        self.apps.switch_to_displayed_app()
        # Now check if toolbar is visible by Screen Reader

        # Keypad is hidden from the screen reader.
        self.assertTrue(
            self.accessibility.is_hidden(
                self.marionette.find_element(
                    *self.phone._keypad_toolbar_button_locator)))
        # Contacts is visible to the screen reader.
        self.assertTrue(
            self.accessibility.is_hidden(
                self.marionette.find_element(
                    *self.phone._contacts_view_locator)))
        # Call log is hidden from the screen reader.
        self.assertTrue(
            self.accessibility.is_hidden(
                self.marionette.find_element(
                    *self.phone._call_log_toolbar_button_locator)))
Exemplo n.º 3
0
class TestAccessibilityPhoneEditContact(GaiaTestCase):

    def setUp(self):
        # Start application in Phone App
        GaiaTestCase.setUp(self)
        self.phone = Phone(self.marionette)
        self.phone.launch()

    def test_a11y_phone_edit_contact(self):

        # Add a random contact
        contacts = self.phone.a11y_click_contacts()

        # Add new contact
        new_contact_form = contacts.a11y_click_new_contact()

        # Enter data into fields
        contact = MockContact()
        new_contact_form.type_given_name(contact['givenName'])

        # Save new contact
        new_contact_form.a11y_click_done()
        self.wait_for_condition(lambda m: len(contacts.contacts) == 1)

        # Edit the contact
        contact_item = contacts.contact(contact['givenName'])
        contact_item_detail = contact_item.a11y_click()
        contact_item_edit = contact_item_detail.a11y_click_edit()

        self.apps.switch_to_displayed_app()
        # Now check if toolbar is visible by Screen Reader

        # Keypad is hidden from the screen reader.
        self.assertTrue(self.accessibility.is_hidden(self.marionette.find_element(
            *self.phone._keypad_toolbar_button_locator)))
        # Contacts is visible to the screen reader.
        self.assertTrue(self.accessibility.is_hidden(self.marionette.find_element(
            *self.phone._contacts_view_locator)))
        # Call log is hidden from the screen reader.
        self.assertTrue(self.accessibility.is_hidden(self.marionette.find_element(
            *self.phone._call_log_toolbar_button_locator)))
Exemplo n.º 4
0
class TestAccessibilityPhoneSelectToolbars(GaiaTestCase):
    def setUp(self):
        GaiaTestCase.setUp(self)
        self.phone = Phone(self.marionette)
        self.phone.launch()

    def test_phone_select_toolbars(self):

        # Screen reader activated call log button click.
        call_log = self.phone.a11y_click_call_log_toolbar_button()

        # Keypad is hidden from the screen reader.
        self.assertTrue(
            self.accessibility.is_hidden(
                self.marionette.find_element(
                    *self.phone._keypad_toolbar_locator)))
        # Contacts is hidden from the screen reader.
        self.assertTrue(
            self.accessibility.is_hidden(
                self.marionette.find_element(
                    *self.phone._contacts_toolbar_locator)))
        # Call log is visible to the screen reader.
        self.assertTrue(
            self.accessibility.is_visible(
                self.marionette.find_element(
                    *self.phone._call_log_toolbar_locator)))

        # Screen reader activated contacts button click.
        self.phone.a11y_click_contacts()
        self.apps.switch_to_displayed_app()

        # Keypad is hidden from the screen reader.
        self.assertTrue(
            self.accessibility.is_hidden(
                self.marionette.find_element(
                    *self.phone._keypad_toolbar_locator)))
        # Contacts is visible to the screen reader.
        self.assertTrue(
            self.accessibility.is_visible(
                self.marionette.find_element(
                    *self.phone._contacts_toolbar_locator)))
        # Call log is hidden from the screen reader.
        self.assertTrue(
            self.accessibility.is_hidden(
                self.marionette.find_element(
                    *self.phone._call_log_toolbar_locator)))

        # Screen reader activated keypad button click.
        self.phone.a11y_click_keypad_toolbar_button()

        # Keypad is visible to the screen reader.
        self.assertTrue(
            self.accessibility.is_visible(
                self.marionette.find_element(
                    *self.phone._keypad_toolbar_locator)))
        # Contacts is hidden from the screen reader.
        self.assertTrue(
            self.accessibility.is_hidden(
                self.marionette.find_element(
                    *self.phone._contacts_toolbar_locator)))
        # Call log is hidden from the screen reader.
        self.assertTrue(
            self.accessibility.is_hidden(
                self.marionette.find_element(
                    *self.phone._call_log_toolbar_locator)))