Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
# Generated by the windmill services transformer
from windmill.authoring import WindmillTestClient
import time
from windmill.server import proxy
proxy.first_forward_domains.append('www.sandbox-freebase.com')
from windmill.server import add_forward_condition
from urllib import urlencode
def test_recordingSuite0():
client = WindmillTestClient(__name__)
#create unique topic names
ts = time.time()
flag_me = "flag_me_%s" % ts
merge_me = "merge_me_%s" % ts
client.open(url=u'http://www.freebase-sandbox.com/signin/login?'+urlencode([('mw_cookie_scope', 'domain',), ('onsignin', 'http://branch.qa.metaweb.com/',)]))
client.waits.forPageLoad(timeout=u'8000')
client.type(text=u'watir1', id=u'signin-username')
client.type(text=u'watirw0rd', id=u'signin-password')
client.click(id=u'signin-submit')
client.waits.forPageLoad(timeout=u'20000')
client.open(url=u'http://www.freebase-sandbox.com/view/book/book')
client.waits.forPageLoad(timeout=u'8000')
client.click(xpath=u"//a[@id='link-add-data']")
#the following line should type into the newly opened Name field,
#instead, its opening a new window containing a 500 error (whether ran as a whole script or line by line).
client.type(text=flag_me, name=u'e\x01p=/type/type/instance\x01new=ID1001')
client.click(xpath=u"//div[@id='fbs_list']/div/div/button")
client.click(xpath=u"//div[@id='overlay-dialog']/div/div/div/form/div[2]/div[2]/button")
client.type(text=merge_me, name=u'e\x01p=/type/type/instance\x01new=ID1001')
client.click(xpath=u"//div[@id='fbs_list']/div/div/button")
client.waits.forElement(xpath=u"//div[@id='overlay-dialog']/div/div/div/form/div[3]/div[2]/button", timeout=u'8000')
client.click(xpath=u"//div[@id='overlay-dialog']/div/div/div/form/div[3]/div[2]/button")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment