Skip to content

Instantly share code, notes, and snippets.

@edwindotcom
Created July 31, 2013 22:58
Show Gist options
  • Save edwindotcom/6126978 to your computer and use it in GitHub Desktop.
Save edwindotcom/6126978 to your computer and use it in GitHub Desktop.
quick and dirty ui test for b2g
# 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.browser.app import Browser
from gaiatest.apps.persona.app import Persona
from gaiatest.mocks.persona_test_user import PersonaTestUser
class TestPersonaUI(GaiaTestCase):
def setUp(self):
GaiaTestCase.setUp(self)
self.connect_to_network()
# Generate unverified PersonaTestUser account
# self.user = PersonaTestUser().create_user(
# verified=True, env={"browserid": "firefoxos.persona.org", "verifier": "firefoxos.123done.org"}
# )
def test_persona_ui(self):
"""
Smoketest of cookie handling/Persona integration
Log in with Persona user
After refreshing 123done should still be logged in (cookie retained)
"""
self.app = self.apps.launch('UI tests')
print dir(self.app)
self.marionette.switch_to_frame()
self.marionette.switch_to_frame(self.app.frame)
# print self.marionette.page_source()
# launch the nav.id tests
# self._bid_tests_locator = ('link text', 'navigator.mozId tests')
# # launch the nav.id tests
print self.marionette.page_source.encode('utf-8')
# foo = self.marionette.find_elements('css selector', 'a')
# # print foo
# for li in foo:
# # print dir(li)
# print 'FOO LI:', li.LINK_TEXT
# self.wait_for_element_displayed(*self._bid_tests_locator)
# bid_btn = self.marionette.find_element(*self._bid_tests_locator)
# bid_btn.tap()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment