Created
August 11, 2009 13:29
-
-
Save admc/165816 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def setup_module(module): | |
client = WindmillTestClient(__name__) | |
# precondition: set the locale to English | |
client.waits.forElement(timeout=u'60000', id=u'locale_selector_dialog_onclick') | |
#client.execJS(js=u'intl_locale_selector_dialog("http://www.facebook.com/");') | |
client.click(xpath=u"//div[@id='locale_selector_dialog_onclick']/a") | |
try: | |
client.waits.forElement(link=u'English (US)', timeout=u'60000') | |
client.click(link=u'English (US)') | |
client.waits.forPageLoad(timeout=u'60000') | |
except: | |
client.waits.forElement(name=u'close', timeout=u'60000') | |
client.click(name=u'close') | |
client.waits.forElement(id=u'email', timeout=u'30000') | |
client.click(id=u'email') | |
client.type(text=functest.registry['email'], id=u'email') | |
client.waits.forElement(id=u'pass', timeout=u'30000') | |
client.type(text=functest.registry['password'], id=u'pass') | |
client.click(value=u"Login") | |
client.waits.forPageLoad(timeout=u'60000') | |
def teardown_module(module): | |
client = WindmillTestClient(__name__) | |
client.waits.forElement(link=u'Home', timeout=u'100000') | |
client.click(link=u'Home') | |
client.waits.forPageLoad(timeout=u'100000') | |
client.waits.forElement(timeout=u'100000', id=u'q') | |
client.waits.forElement(link=u'Logout', timeout=u'100000') | |
fstestutils.fs_add_forward_condition(lambda e: 'facebook.com' not in e['reconstructed_url']) | |
client.click(link=u'Logout') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment