本文整理汇总了Python中gaiatest.apps.ui_tests.app.UiTests.tap_api_button方法的典型用法代码示例。如果您正苦于以下问题:Python UiTests.tap_api_button方法的具体用法?Python UiTests.tap_api_button怎么用?Python UiTests.tap_api_button使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gaiatest.apps.ui_tests.app.UiTests
的用法示例。
在下文中一共展示了UiTests.tap_api_button方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_persona_standard_sign_in
# 需要导入模块: from gaiatest.apps.ui_tests.app import UiTests [as 别名]
# 或者: from gaiatest.apps.ui_tests.app.UiTests import tap_api_button [as 别名]
def test_persona_standard_sign_in(self):
"""
Test standard sign in to UI tests app
"""
uitests = UiTests(self.marionette)
uitests.launch()
uitests.tap_api_button()
uitests.tap_mozId_button()
persona = uitests.launch_standard_sign_in()
persona.login(self.user.email, self.user.password)
uitests.switch_to_mozId_frame()
uitests.wait_for_login_event()
uitests.tap_logout_button()
uitests.wait_for_logout_event()
assertion = uitests.get_assertion()
assertionUtil = AssertionUtil()
unpacked = assertionUtil.unpackAssertion(assertion)
self.assertEqual(AUDIENCE, unpacked['payload']['aud'])
self.assertEqual(self.user.email, unpacked['claim']['principal']['email'])
verified = assertionUtil.verifyAssertion(assertion, AUDIENCE, VERIFIER_URL)
self.assertEqual(verified['status'], 'okay')
self.assertEqual(verified['email'], self.user.email)
self.assertEqual(verified['audience'], AUDIENCE)
示例2: test_persona_standard_sign_in
# 需要导入模块: from gaiatest.apps.ui_tests.app import UiTests [as 别名]
# 或者: from gaiatest.apps.ui_tests.app.UiTests import tap_api_button [as 别名]
def test_persona_standard_sign_in(self):
uitests = UiTests(self.marionette)
uitests.launch()
uitests.tap_api_button()
moz_id = uitests.tap_moz_id_button()
moz_id.switch_to_frame()
persona = moz_id.tap_standard_sign_in()
persona.login(self.user.email, self.user.password)
moz_id.switch_to_frame()
moz_id.wait_for_login_event()
moz_id.tap_logout_button()
moz_id.wait_for_logout_event()
assertion = moz_id.get_assertion()
assertionUtil = AssertionUtil()
unpacked = assertionUtil.unpackAssertion(assertion)
self.assertIn(AUDIENCE, unpacked["payload"]["aud"], "expected app://uitest.gaiamobile.org in the result")
self.assertEqual(self.user.email, unpacked["claim"]["principal"]["email"])
verified = assertionUtil.verifyAssertion(assertion, AUDIENCE, VERIFIER_URL)
self.assertEqual(verified["status"], "okay")
self.assertEqual(verified["email"], self.user.email)
self.assertEqual(verified["audience"], AUDIENCE)