当前位置: 首页>>代码示例>>Python>>正文


Python Email.tap_manual_setup方法代码示例

本文整理汇总了Python中gaiatest.apps.email.app.Email.tap_manual_setup方法的典型用法代码示例。如果您正苦于以下问题:Python Email.tap_manual_setup方法的具体用法?Python Email.tap_manual_setup怎么用?Python Email.tap_manual_setup使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在gaiatest.apps.email.app.Email的用法示例。


在下文中一共展示了Email.tap_manual_setup方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: TestSetupManualEmail

# 需要导入模块: from gaiatest.apps.email.app import Email [as 别名]
# 或者: from gaiatest.apps.email.app.Email import tap_manual_setup [as 别名]
class TestSetupManualEmail(GaiaTestCase):

    def setUp(self):
        GaiaTestCase.setUp(self)
        self.connect_to_network()

        self.email = Email(self.marionette)
        self.email.launch()

    def test_setup_imap_email(self):
        # setup IMAP account

        setup = self.email.tap_manual_setup()
        setup.type_name(self.testvars['email']['IMAP']['name'])
        setup.type_email(self.testvars['email']['IMAP']['email'])
        setup.type_password(self.testvars['email']['IMAP']['password'])

        setup.select_account_type('IMAP+SMTP')

        setup.type_imap_hostname(self.testvars['email']['IMAP']['imap_hostname'])
        setup.type_imap_name(self.testvars['email']['IMAP']['imap_name'])
        setup.type_imap_port(self.testvars['email']['IMAP']['imap_port'])

        setup.type_smtp_hostname(self.testvars['email']['IMAP']['smtp_hostname'])
        setup.type_smtp_name(self.testvars['email']['IMAP']['smtp_name'])
        setup.type_smtp_port(self.testvars['email']['IMAP']['smtp_port'])

        setup.tap_next()
        setup.wait_for_setup_complete()
        setup.tap_continue()
        self.email.wait_for_header_area()

        # check header area
        self.assertTrue(self.email.header.is_compose_visible)
        self.assertTrue(self.email.header.is_menu_visible)
        self.assertEqual(self.email.header.label, 'Inbox')

        # check toolbar area
        self.assertTrue(self.email.toolbar.is_edit_visible)
        self.assertTrue(self.email.toolbar.is_refresh_visible)

        # check account has emails
        self.email.wait_for_emails_to_sync()
        self.assertGreater(len(self.email.mails), 0)

    def tearDown(self):
        GaiaTestCase.tearDown(self)
开发者ID:malini,项目名称:gaia-ui-tests-1,代码行数:49,代码来源:test_setup_imap_email.py

示例2: TestSetupAndSendIMAPEmail

# 需要导入模块: from gaiatest.apps.email.app import Email [as 别名]
# 或者: from gaiatest.apps.email.app.Email import tap_manual_setup [as 别名]
class TestSetupAndSendIMAPEmail(GaiaImageCompareTestCase):
    def setUp(self):
        if not GaiaTestEnvironment(self.testvars).email.get('imap'):
            raise SkipTest('IMAP account details not present in test variables.')
        if not GaiaTestEnvironment(self.testvars).email.get('smtp'):
            raise SkipTest('SMTP account details not present in test variables.')

        GaiaImageCompareTestCase.setUp(self)
        self.connect_to_local_area_network()

        self.email = Email(self.marionette)
        self.email.launch()

    def test_setup_and_send_imap_email(self):
        """Verify the Appearance of email app is proper.

        Refer to:
        https://moztrap.mozilla.org/manage/case/6113/
        https://moztrap.mozilla.org/manage/case/6114/
        """
        # setup IMAP account
        self.setup_IMAP_email(self.environment.email['imap'],
                              self.environment.email['smtp'])

        # take picture of the menu
        Wait(self.marionette).until(lambda m: self.email.header.is_menu_visible)
        self.email.wait_for_emails_to_sync()
        
        _subject = 'Testing Images'
        _body = 'The quick brown fox jumps over the lazy dog [email protected]#$#%^&*)(_+ <>?,./:";[]{}\\'
        Wait(self.marionette).until(lambda m: self.email.header.is_compose_visible)
        new_email = self.email.header.tap_compose()
        self.take_screenshot()

        new_email.type_to(self.environment.email['imap']['email'])
        new_email.type_subject(_subject)
        new_email.type_body(_body)
        self.take_screenshot()

        # Commented out due to Bug 1131095
        # Exit to homescreen
        # self.device.touch_home_button()
        # self.email.launch()

        self.email = new_email.tap_send()

        # wait for the email to be sent before we tap refresh
        self.email.wait_for_email(_subject)
        
        read_email = self.email.tap_email_subject(_subject)
        Wait(self.marionette, timeout = 20).until(
            lambda m: _subject == read_email.subject)

        read_email.tap_move_button()
        self.take_screenshot()
        read_email.cancel_move()

        read_email.tap_reply_button()
        self.take_screenshot()
        read_email.cancel_reply()

        # delete the message to avoid using stale message in future runs
        read_email.tap_delete_button()
        self.take_screenshot()
        read_email.approve_delete()

    # moved from SetupEmail to embed screenshot commands
    def setup_IMAP_email(self, imap, smtp):
        basic_setup = SetupEmail(self.marionette)
        basic_setup.type_name('IMAP account')
        basic_setup.type_email(imap['email'])

        setup = self.email.tap_manual_setup()
        self.take_screenshot()
        setup.select_account_type('IMAP+SMTP')

        setup.type_imap_hostname(imap['hostname'])
        setup.type_imap_name(imap['username'])
        setup.type_imap_password(imap['password'])
        setup.type_imap_port(imap['port'])

        setup.type_smtp_hostname(smtp['hostname'])
        setup.type_smtp_name(smtp['username'])
        setup.type_smtp_password(smtp['password'])
        setup.type_smtp_port(smtp['port'])
        self.take_screenshot()
        setup.tap_next()
        self.take_screenshot()
        setup.check_for_emails_interval('20000')

        setup.tap_account_prefs_next()
        self.take_screenshot()
        setup.wait_for_setup_complete()
        setup.tap_continue()
        self.email.wait_for_message_list()
开发者ID:Archaeopteryx,项目名称:gaia,代码行数:97,代码来源:test_setup_and_send_receive_imap_email.py

示例3: setupEmailAccount

# 需要导入模块: from gaiatest.apps.email.app import Email [as 别名]
# 或者: from gaiatest.apps.email.app.Email import tap_manual_setup [as 别名]
    def setupEmailAccount(self):
        # setup IMAP account
        email = Email(self.marionette)
        email.launch()

        m = self.marionette
        
        # setup email account
        imap = self.testvars['email']['IMAP']
        basic_setup = SetupEmail(self.marionette)

        name_field = m.find_element(By.CSS_SELECTOR, 'section.card-setup-account-info input.sup-info-name')
        name_field.send_keys(imap['name'])

        time.sleep(1)
        email_field = m.find_element(By.CSS_SELECTOR, 'section.card-setup-account-info input.sup-info-email')
        email_field.tap()
        email.keyboard.send(imap['email'])

        # setup mail server information
        setup = email.tap_manual_setup()
        setup.type_imap_hostname(imap['imap_hostname'])
        setup.type_imap_name(imap['imap_name'])
        setup.type_imap_port(imap['imap_port'])
        
        _imap_password_locator = m.find_element(By.CSS_SELECTOR, 'section.card-setup-manual-config .sup-manual-composite-password')
        _imap_password_locator.clear()
        _imap_password_locator.send_keys(imap['password'])

        setup.type_smtp_hostname(imap['smtp_hostname'])
        setup.type_smtp_name(imap['smtp_name'])
        setup.type_smtp_port(imap['smtp_port'])
        _smtp_hostname_locator = m.find_element(By.CSS_SELECTOR, 'section.card-setup-manual-config .sup-manual-smtp-password')
        _smtp_hostname_locator.clear()
        _smtp_hostname_locator.send_keys(imap['password'])

        setup.tap_next()
        
        # setup remind frequency
        manual = m.find_element("css selector",'li[class="syncinterval-setting select-item"] > span[class="button icon icon-dialog"]')
        manual.tap()
        self.marionette.switch_to_frame()
        options = self.marionette.find_elements(By.CSS_SELECTOR, 'ol[class="value-selector-options-container"] > li')
        
        for li in options:
            if li.text == 'Every 5 minutes':
                li.tap()
                break
        
        for item in m.find_elements(By.CSS_SELECTOR, 'button.value-option-confirm'):
            if item.is_displayed() == True:
                item.tap()
                break
        self.apps.switch_to_displayed_app()

        setup.tap_account_prefs_next()
        setup.wait_for_setup_complete()
        setup.tap_continue()
        email.wait_for_message_list()

        # wait for sync to complete
        email.wait_for_emails_to_sync()
开发者ID:gerrycfchang,项目名称:ActOnLock,代码行数:64,代码来源:test_open_email_notification.py


注:本文中的gaiatest.apps.email.app.Email.tap_manual_setup方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。