Exemplo n.º 1
0
def test_manage_setting_of_price_calculator():
    client = WindmillTestClient(__name__)
    client.open(url="/product/chocolate")
    client.waits.forPageLoad(timeout=u'20000')

    # check that product includes vat
    client.asserts.assertText(xpath=u"//form[@id='product-form']/div[5][@class='prices']/div[2][@class='price-disclaimer']", validator=u'*inc. VAT')

    # open the manage interface
    client.open(url="/manage/")
    client.waits.forPageLoad(timeout=u'20000')
    client.type(text=u'admin', id=u'id_username')
    client.type(text=u'admin', id=u'id_password')
    client.click(xpath=u"//div[@id='content']/div/div[1]/form/button")
    client.waits.forPageLoad(timeout=u'20000')
    client.waits.forElement(link=u'Products', timeout=u'8000')
    client.click(link=u'Products')
    client.waits.forPageLoad(timeout=u'20000')
    client.click(link="Chocolate")
    client.waits.forPageLoad(timeout=u'20000')
    client.waits.forElement(timeout=u'8000', id=u'id_price_calculator')
    client.click(id=u'id_price_calculator')
    client.select(option=u'Price excludes tax', id=u'id_price_calculator')
    client.click(xpath=u"//form[@id='product-data-form']/fieldset[4]/div[4]/div[2]")
    client.click(value=u'Save Data')

    # Check that price excludes vat now
    client.open(url="/product/chocolate")
    client.waits.forPageLoad(timeout=u'20000')

    # check that product includes vat
    client.asserts.assertText(xpath=u"//form[@id='product-form']/div[5][@class='prices']/div[2][@class='price-disclaimer']", validator=u'*exc. VAT')
Exemplo n.º 2
0
def test_ajax_forms():
    client = WindmillTestClient(__name__)

    client.waits.forElement(link=u'Login', timeout=u'8000')
    client.click(link=u'Login')
    client.click(id=u'id_username')
    client.type(text=u'admin', id=u'id_username')
    client.type(text=u'admin', id=u'id_password')
    client.click(value=u'login')
    client.waits.forPageLoad(timeout=u'20000')

    client.click(link=u'Edit')
    client.waits.forPageLoad(timeout=u'20000')

    # change birthdate
    client.waits.forElement(timeout=u'8000', id=u'id_birth')
    client.click(id=u'id_birth')
    client.waits.sleep(milliseconds=1000)
    client.waits.forElement(
        xpath=u"//div[@id='ui-datepicker-div']/div/div/select[2]",
        id=u'id_birth')
    client.select(classname=u'ui-datepicker-month', val=u'10')
    client.select(classname=u'ui-datepicker-year', val=u'1986')
    client.click(link=u'10')
    client.click(name=u'save')
    client.asserts.assertText(id="message", validator="Done. Reloading...")
    client.waits.forPageLoad(timeout=u'20000')

    # test wrong date
    client.click(timeout=u'8000', id=u'id_birth')
    client.type(text=u'1987-12-1122', id=u'id_birth')
    client.click(name=u'save')
    client.waits.forElement(id="birth_error")
    client.asserts.assertText(id="birth_error",
                              validator="Enter a valid date.")
Exemplo n.º 3
0
def setup_module(module):
    "Login and create three lists"
    client = WindmillTestClient(__name__)

    client.asserts.assertNode(id=u"id_username")
    client.type(text=u'visa', id=u'id_username')
    client.asserts.assertNode(id=u"id_password")
    client.type(text=u'salakala', id=u'id_password')
    client.click(value=u'login')
    client.waits.forPageLoad(timeout=u'20000')

    client.asserts.assertText(xpath=u"//div[@id='user-tools']/a",
                              validator=u'Log out')
    client.execJS(js='window.autorefresh_freq = -1;')

    def create_list(i):
        name = 'test list ' + str(i)
        client.asserts.assertNotNode(id=u"subscription_" + str(i))
        client.asserts.assertNode(id=u"create_list_nameinput")
        client.type(id=u'create_list_nameinput', text=name)
        client.keyUp(id=u'create_list_nameinput',
                     options='13,false,false,false,false,false')
        client.waits.forElement(id=u"subscription_" + str(i), timeout=u'20000')

    client.asserts.assertJS(js=u"$('#listmenu_listlist').is(':hidden')")
    client.asserts.assertNode(id=u"lists_button")
    client.click(id=u"lists_button")  # show list menu
    client.waits.sleep(milliseconds=u'500')
    client.asserts.assertNotJS(js=u"$('#listmenu_listlist').is(':hidden')")
    for i in [1, 2, 3]:
        create_list(i)
    client.click(id=u"lists_button")  # hide list menu
Exemplo n.º 4
0
def setup_module(module):
    "Login and create three lists"
    client = WindmillTestClient(__name__)

    client.asserts.assertNode(id=u"id_username")
    client.type(text=u'visa', id=u'id_username')
    client.asserts.assertNode(id=u"id_password")
    client.type(text=u'salakala', id=u'id_password')
    client.click(value=u'login')
    client.waits.forPageLoad(timeout=u'20000')

    client.asserts.assertText(xpath=u"//div[@id='user-tools']/a", validator=u'Log out')
    client.execJS(js='window.autorefresh_freq = -1;')

    def create_list(i):
        name = 'test list '+str(i)
        client.asserts.assertNotNode(id=u"subscription_"+str(i))
        client.asserts.assertNode(id=u"create_list_nameinput")
        client.type(id=u'create_list_nameinput', text=name)
        client.keyUp(id=u'create_list_nameinput', options='13,false,false,false,false,false')
        client.waits.forElement(id=u"subscription_"+str(i), timeout=u'20000')

    client.asserts.assertJS(js=u"$('#listmenu_listlist').is(':hidden')")
    client.asserts.assertNode(id=u"lists_button")
    client.click(id=u"lists_button") # show list menu
    client.waits.sleep(milliseconds=u'500')
    client.asserts.assertNotJS(js=u"$('#listmenu_listlist').is(':hidden')")
    for i in [1,2,3]:
        create_list(i)
    client.click(id=u"lists_button") # hide list menu
Exemplo n.º 5
0
def test_get_submit():
    client = WindmillTestClient(__name__)
    client.open(url=u'http://tutorial.getwindmill.com/windmill-unittests/domain_switcher.html')
    client.type(text=u'simpletest', name=u'q')
    client.click(name=u'btnG')
    client.waits.forPageLoad(timeout=20000)
    client.waits.forElement(link=u'SimpleTest - Unit Testing for PHP', timeout=u'8000')
Exemplo n.º 6
0
def test_manage_setting_of_price_calculator():
    client = WindmillTestClient(__name__)
    client.open(url="/product/chocolate")
    client.waits.forPageLoad(timeout=u'20000')

    # check that product includes vat
    client.asserts.assertText(xpath=u"//form[@id='product-form']/div[5][@class='prices']/div[2][@class='price-disclaimer']", validator=u'*inc. VAT')

    # open the manage interface
    client.open(url="/manage/")
    client.waits.forPageLoad(timeout=u'20000')
    client.type(text=u'admin', id=u'id_username')
    client.type(text=u'admin', id=u'id_password')
    client.click(xpath=u"//div[@id='content']/div/div[1]/form/button")
    client.waits.forPageLoad(timeout=u'20000')
    client.waits.forElement(link=u'Products', timeout=u'8000')
    client.click(link=u'Products')
    client.waits.forPageLoad(timeout=u'20000')
    client.click(link="Chocolate")
    client.waits.forPageLoad(timeout=u'20000')
    client.waits.forElement(timeout=u'8000', id=u'id_price_calculator')
    client.click(id=u'id_price_calculator')
    client.select(option=u'Price excludes tax', id=u'id_price_calculator')
    client.click(xpath=u"//form[@id='product-data-form']/fieldset[4]/div[4]/div[2]")
    client.click(value=u'Save Data')

    # Check that price excludes vat now
    client.open(url="/product/chocolate")
    client.waits.forPageLoad(timeout=u'20000')

    # check that product includes vat
    client.asserts.assertText(xpath=u"//form[@id='product-form']/div[5][@class='prices']/div[2][@class='price-disclaimer']", validator=u'*exc. VAT')
Exemplo n.º 7
0
def test_post_submit():
    client = WindmillTestClient(__name__)
    client.open(url=u'http://tutorial.getwindmill.com/windmill-unittests/domain_switcher.html')
    client.type(text=u'simpletest', name=u'search_theme_form')
    client.click(name=u'op')
    client.waits.forPageLoad(timeout=20000)
    client.waits.forElement(xpath="//div[@id='squeeze']/h1", timeout=8000)
    client.asserts.assertJS(js=u"windmill.testWin().document.title == 'Search | drupal.org'")
Exemplo n.º 8
0
def setup_module(module):
    client = WindmillTestClient('setup_module_login')

    client.type(text='test_admin', id='id_username')
    client.type(text='test_admin', id='id_password')
    client.click(value='Ok')
    client.waits.forPageLoad(timeout='20000')
    client.asserts.assertNode(link='Visual Map')
    client.asserts.assertNode(link='Textual')
Exemplo n.º 9
0
def test_createForm():
    client = WindmillTestClient(__name__)

    client.click(xpath=u"//dl[@id='plone-contentmenu-factories']/dt/a/span[1]")
    client.click(xpath=u"//a[@id='plominoform']/span")
    client.waits.forPageLoad(timeout=u'20000')
    client.waits.forElement(timeout=u'8000', id=u'id')
    client.type(text=u'testform', id=u'id')
    client.type(text=u'testform', id=u'title')
    client.click(name=u'form.button.save')
    client.waits.forPageLoad(timeout=u'20000')
Exemplo n.º 10
0
def test_createForm():
    client = WindmillTestClient(__name__)

    client.click(xpath=u"//dl[@id='plone-contentmenu-factories']/dt/a/span[1]")
    client.click(xpath=u"//a[@id='plominoform']/span")
    client.waits.forPageLoad(timeout=u'20000')
    client.waits.forElement(timeout=u'8000', id=u'id')
    client.type(text=u'testform', id=u'id')
    client.type(text=u'testform', id=u'title')
    client.click(name=u'form.button.save')
    client.waits.forPageLoad(timeout=u'20000')
Exemplo n.º 11
0
def test_login_logout():
    client = WindmillTestClient(__name__)

    client.type(text=u'ivan', id=u'id_username')
    client.click(id=u'id_password')
    client.type(text=u'passwd', id=u'id_password')
    client.click(value=u'\u0412\u043e\u0439\u0442\u0438')
    client.waits.forPageLoad(timeout=u'20000')
    client.waits.forElement(link=u'Exit', timeout=u'8000')
    client.click(link=u'Exit')
    client.waits.forPageLoad(timeout=u'20000')
Exemplo n.º 12
0
def test_google_switch_to_yahoo():
    client = WindmillTestClient(__name__)
    client.open(url=u'http://www.google.com/intl/en/')
    client.waits.forElement(timeout=u'', name=u'q')
    client.click(name=u'q')
    client.type(text=u'wikipedia', name=u'q')
    client.click(name=u'btnG')
    client.waits.forElement(link=u'Wikipedia', timeout=u'8000')
    client.click(link=u'Wikipedia')
    client.waits.forPageLoad(timeout=u'20000')
    client.asserts.assertJS(
        js=u"windmill.testWin().document.title == 'Wikipedia'")
Exemplo n.º 13
0
def test_google_switch_to_yahoo():
    client = WindmillTestClient(__name__)
    client.open(url=u'http://www.google.com/intl/en/')
    client.waits.forElement(timeout=u'', name=u'q')
    client.click(name=u'q')
    client.type(text=u'wikipedia', name=u'q')
    client.click(name=u'btnG')
    client.waits.forElement(link=u'Wikipedia', timeout=u'8000')
    client.click(link=u'Wikipedia')
    client.waits.forPageLoad(timeout=u'20000')
    client.asserts.assertJS(js=u"windmill.testWin().document.title == 'Wikipedia'")
    
Exemplo n.º 14
0
def test_set_item_url():
    client = WindmillTestClient(__name__)

    # set item 1 url (press enter)
    client.asserts.assertJS(js=u"$('#link_button').is(':hidden')")
    client.check(xpath=u"//li[@id='item_1']/input[@type='checkbox']")
    client.asserts.assertChecked(
        xpath=u"//li[@id='item_1']/input[@type='checkbox']")
    client.asserts.assertJS(js=u"$('#link_button').is(':visible')")
    client.asserts.assertJS(js=u"$('#url_input_container').is(':hidden')")
    client.asserts.assertJS(js=u"$('#item_1_link').is(':hidden')")
    client.click(id=u'link_button')
    client.waits.sleep(milliseconds=u'100')
    client.asserts.assertJS(js=u"$('#url_input_container').is(':visible')")
    client.type(id=u'url_input', text=u'http://google.com/')
    client.keyDown(id=u'url_input',
                   options=u'13,false,false,false,false,false')
    client.waits.sleep(milliseconds=u'500')
    client.asserts.assertJS(js=u"$('#item_1_link').is(':visible')")
    client.asserts.assertJS(
        js=u"$('#item_1_link').attr('href') == 'http://google.com/'")
    client.asserts.assertJS(js=u"$('#link_button').is(':hidden')")

    # unset item 1 url (click submit button)
    client.check(xpath=u"//li[@id='item_1']/input[@type='checkbox']")
    client.asserts.assertChecked(
        xpath=u"//li[@id='item_1']/input[@type='checkbox']")
    client.asserts.assertJS(js=u"$('#url_input_container').is(':hidden')")
    client.asserts.assertJS(js=u"$('#item_1_link').is(':visible')")
    client.click(id=u'link_button')
    client.waits.sleep(milliseconds=u'100')
    client.asserts.assertJS(js=u"$('#url_input_container').is(':visible')")
    client.asserts.assertJS(
        js=u"$('#url_input').val() == 'http://google.com/'")
    client.type(id=u'url_input', text=u'')
    client.click(id=u'url_submit')
    client.waits.sleep(milliseconds=u'500')
    client.asserts.assertJS(js=u"$('#url_input_container').is(':hidden')")
    client.asserts.assertJS(js=u"$('#item_1_link').is(':hidden')")
    client.asserts.assertJS(js=u"$('#item_1_link').attr('href') == ''")

    # test canceling by unchecking while editing
    client.check(xpath=u"//li[@id='item_1']/input[@type='checkbox']")
    client.asserts.assertChecked(
        xpath=u"//li[@id='item_1']/input[@type='checkbox']")
    client.asserts.assertJS(js=u"$('#url_input_container').is(':hidden')")
    client.click(id=u'link_button')
    client.waits.sleep(milliseconds=u'100')
    client.asserts.assertJS(js=u"$('#url_input_container').is(':visible')")
    client.check(xpath=u"//li[@id='item_1']/input[@type='checkbox']")
    client.asserts.assertNotChecked(
        xpath=u"//li[@id='item_1']/input[@type='checkbox']")
    client.asserts.assertJS(js=u"$('#url_input_container').is(':hidden')")
Exemplo n.º 15
0
def test_login():
    """Some parameters must be modified (user, password, Plone URL).
    """
    client = WindmillTestClient(__name__)

    client.click(link=u'View your Plone site.')
    client.waits.forPageLoad(timeout=u'20000')
    client.waits.forElement(timeout=u'8000', id=u'__ac_name')
    client.type(text=u'admin', id=u'__ac_name') # To replace with the corrects username and password
    client.type(text=u'password', id=u'__ac_password')
    client.click(name=u'submit')
    client.waits.forPageLoad(timeout=u'20000')
Exemplo n.º 16
0
def test_birth_datepicker():
    client = WindmillTestClient(__name__)

    client.click(link=u"Edit contacts page")
    client.waits.forPageLoad(timeout=u"20000")
    client.type(text=u"brabadu", id=u"id_username")
    client.type(text=u"190888", id=u"id_password")
    client.click(value=u"login")
    client.waits.forPageLoad(timeout=u"20000")
    client.waits.forElement(timeout=u"8000", id=u"id_birth_date")
    client.click(id=u"id_birth_date")
    client.asserts.assertNode(id=u"ui-datepicker-div")
Exemplo n.º 17
0
def test_createField():
    client = WindmillTestClient(__name__)

    client.click(link=u'Edit')
    client.waits.forPageLoad(timeout=u'20000')
    client.waits.forElement(xpath=u"//body[@id='content']", timeout=u'8000')
    client.click(xpath=u"//body[@id='content']")
    client.click(id=u'FormLayout_plominofield')
    client.waits.forElement(timeout=u'5000', id=u'plominoFieldId')
    client.type(text=u'field1', id=u'plominoFieldId')
    client.click(id=u'insert')
    client.click(name=u'form.button.save')
    client.waits.forPageLoad(timeout=u'20000')
Exemplo n.º 18
0
def test_createField():
    client = WindmillTestClient(__name__)

    client.click(link=u'Edit')
    client.waits.forPageLoad(timeout=u'20000')
    client.waits.forElement(xpath=u"//body[@id='content']", timeout=u'8000')
    client.click(xpath=u"//body[@id='content']")
    client.click(id=u'FormLayout_plominofield')
    client.waits.forElement(timeout=u'5000', id=u'plominoFieldId')
    client.type(text=u'field1', id=u'plominoFieldId')
    client.click(id=u'insert')
    client.click(name=u'form.button.save')
    client.waits.forPageLoad(timeout=u'20000')
def test_Tutorial():
    client = WindmillTestClient(__name__)

    client.highlight(descStep=u'<p>Folders are one of the most fundamental content types in Plone. You can use a folder to organize your documents much like you already do on your desktop computer. You can also use folders to create new sections of your website.</p>', nameStep=u'Create_a_new_folder', url=u'http://*****:*****@id='plone-contentmenu-factories']/dt/a/span[1]", nameStep=u'Create_a_new_folder', description=u'Click the [Add new...] drop-down menu.')
    client.click(xpath=u"//a[@id='folder']/span", nameStep=u'Create_a_new_folder', description=u'Select [Folder] from the menu.')
    client.waits.forPageLoad(nameStep=u'Create_a_new_folder', timeout=u'20000', description=u'')
    client.type(descStep=u'', nameStep=u'Fill_out_the_fields', url=u'http://*****:*****@id='plone-contentmenu-workflow']/dt/a/span[2]", descStep=u'<p>You have now created a Folder for your Plone website. Before this folder can be viewed by anonymous site visitors, you must publish it.</p>', nameStep=u'publish_folder', url=u'http://*****:*****@id='plone-contentmenu-factories']/dt/a/span[1]", descStep=u"<p>Now you'll create a new Page and publish it on your Plone-powered website.</p>", nameStep=u'Add_and_publish_a_Page', url=u'http://*****:*****@id='document']/span", nameStep=u'Add_and_publish_a_Page', description=u'Select [Page] from the menu.')
    client.waits.forPageLoad(nameStep=u'Add_and_publish_a_Page', timeout=u'20000', description=u'')
    client.type(descStep=u'<p>Now that you selected the Page content type, you need to supply some information about it.</p>', nameStep=u'Add_a_Page', url=u'http://*****:*****@id='plone-contentmenu-workflow']/dt/a", descStep=u'<p>You have now created a Page for your Plone website. Before this page can be viewed by anonymous site visitors, you must publish it.</p>', nameStep=u'Publish_the_page', url=u'http://localhost:8080/Plone/new-folder/new-page', titleTut=u'Add publish page&folder', description=u'Click the [State] drop-down menu.')
    client.click(description=u'Select [Publish] from the menu.', nameStep=u'Publish_the_page', id=u'workflow-transition-publish')
Exemplo n.º 20
0
def test_recordingSuite0():
    client = WindmillTestClient(__name__)
    now = unicode(datetime.today())

    client.click(link=u'Igor Bestuzhev')
    client.waits.forPageLoad(timeout=u'20000')
    client.waits.forElement(link=u'Login here', timeout=u'8000')
    client.click(link=u'Login here')
    client.waits.forPageLoad(timeout=u'20000')
    client.type(text=u'igor', id=u'id_username')
    client.type(text=u'wrong', id=u'id_password')
    client.click(value=u'login')
    client.waits.forPageLoad(timeout=u'20000')
    client.type(text=u'123', id=u'id_password')
    client.click(value=u'Login')
    client.waits.forPageLoad(timeout=u'20000')
    client.waits.forElement(link=u'Edit profile for Igor Bestuzhev', timeout=u'8000')
    client.click(link=u'Edit profile for Igor Bestuzhev')
    client.waits.forPageLoad(timeout=u'20000')
    client.waits.forElement(timeout=u'8000', id=u'id_biography')
    client.click(id=u'id_biography')
    client.type(text=u'Some text about me\nLast edit %s'%now, id=u'id_biography')
    client.click(value=u'Save')
    client.waits.forPageLoad(timeout=u'20000')
    client.asserts.assertTextIn(validator=now, tagname=u'table')
    client.click(link=u'logout from igor')
Exemplo n.º 21
0
def test_login():
    """Some parameters must be modified (user, password, Plone URL).
    """
    client = WindmillTestClient(__name__)

    client.click(link=u'View your Plone site.')
    client.waits.forPageLoad(timeout=u'20000')
    client.waits.forElement(timeout=u'8000', id=u'__ac_name')
    client.type(
        text=u'admin',
        id=u'__ac_name')  # To replace with the corrects username and password
    client.type(text=u'password', id=u'__ac_password')
    client.click(name=u'submit')
    client.waits.forPageLoad(timeout=u'20000')
Exemplo n.º 22
0
Arquivo: fold.py Projeto: PKRG/jpoker
def test_fold():
    client = WindmillTestClient(__name__)

    client.waits.forElement(classname='jpoker_table')
    client.click(classname=u'jpoker_login_name')
    client.type(classname='jpoker_login_name', text=u'user%s' % md5(str(time())).hexdigest())
    client.click(classname=u'jpoker_login_password')
    client.type(classname=u'jpoker_login_password', text=u'password')
    client.click(classname=u'jpoker_login_submit')
    client.waits.forElement(classname='jpoker_logout')
    client.click(classname=u'jpoker_tablepicker_submit')
    for i in range(100):
        client.waits.forElement(jquery=u'(".jpoker_ptable_fold:visible")[0]', timeout=u'60000')
        client.click(classname=u'jpoker_ptable_fold')
        client.waits.forElement(jquery=u'(".jpoker_ptable_fold:hidden")[0]', timeout=u'60000')
Exemplo n.º 23
0
def test_createHidewhen():
    client = WindmillTestClient(__name__)

    client.click(link=u'Edit')
    client.waits.forPageLoad(timeout=u'20000')
    client.waits.forElement(xpath=u"//body[@id='content']", timeout=u'8000')
    client.click(xpath=u"//body[@id='content']")
    client.click(id=u'FormLayout_plominohidewhen')
    client.waits.forElement(timeout=u'5000', id=u'hidewhenid')
    client.type(text=u'hidewhen1', id=u'hidewhenid')
    client.waits.forElement(timeout=u'5000', id=u'hidewhenFormula')
    client.type(text=u'False', id=u'hidewhenFormula')
    client.click(id=u'insert')
    client.click(name=u'form.button.save')
    client.waits.forPageLoad(timeout=u'20000')
Exemplo n.º 24
0
def test_createAction():
    client = WindmillTestClient(__name__)

    client.waits.forElement(link=u'Edit', timeout=u'8000')
    client.click(link=u'Edit')
    client.waits.forPageLoad(timeout=u'20000')
    client.waits.forElement(xpath=u"//body[@id='content']", timeout=u'8000')
    client.click(xpath=u"//body[@id='content']/p")
    client.click(xpath=u"//a[@id='FormLayout_plominoaction']/img")
    client.waits.forElement(timeout=u'5000', id=u'actionid')
    client.type(text=u'action1', id=u'actionid')
    client.select(val=u'CLOSE', id=u'actionTypesList')
    client.click(id=u'insert')
    client.click(name=u'form.button.save')
    client.waits.forPageLoad(timeout=u'20000')
Exemplo n.º 25
0
def test_createAction():
    client = WindmillTestClient(__name__)

    client.waits.forElement(link=u'Edit', timeout=u'8000')
    client.click(link=u'Edit')
    client.waits.forPageLoad(timeout=u'20000')
    client.waits.forElement(xpath=u"//body[@id='content']", timeout=u'8000')
    client.click(xpath=u"//body[@id='content']/p")
    client.click(xpath=u"//a[@id='FormLayout_plominoaction']/img")
    client.waits.forElement(timeout=u'5000', id=u'actionid')
    client.type(text=u'action1', id=u'actionid')
    client.select(val=u'CLOSE', id=u'actionTypesList')
    client.click(id=u'insert')
    client.click(name=u'form.button.save')
    client.waits.forPageLoad(timeout=u'20000')
Exemplo n.º 26
0
def test_createHidewhen():
    client = WindmillTestClient(__name__)

    client.click(link=u'Edit')
    client.waits.forPageLoad(timeout=u'20000')
    client.waits.forElement(xpath=u"//body[@id='content']", timeout=u'8000')
    client.click(xpath=u"//body[@id='content']")
    client.click(id=u'FormLayout_plominohidewhen')
    client.waits.forElement(timeout=u'5000', id=u'hidewhenid')
    client.type(text=u'hidewhen1', id=u'hidewhenid')
    client.waits.forElement(timeout=u'5000', id=u'hidewhenFormula')
    client.type(text=u'False', id=u'hidewhenFormula')
    client.click(id=u'insert')
    client.click(name=u'form.button.save')
    client.waits.forPageLoad(timeout=u'20000')
Exemplo n.º 27
0
def test_edit_list_name():
    client = WindmillTestClient(__name__)

    client.asserts.assertNode(id=u'item_1_text')
    client.asserts.assertText(validator=u'test item 1', id=u'item_1_text')
    client.click(id=u'item_1_text')
    client.type(text=u'pim pom', name=u'text')
    client.keyPress(options=u'13,false,false,false,false,false', name=u'text')
    client.waits.sleep(milliseconds=u'500')
    client.asserts.assertText(validator=u'pim pom', id=u'item_1_text')
    client.click(id=u'item_1_text')
    client.type(text=u'test item 1', name=u'text')
    client.keyPress(options=u'13,false,false,false,false,false', name=u'text')
    client.waits.sleep(milliseconds=u'500')
    client.asserts.assertText(validator=u'test item 1', id=u'item_1_text')
Exemplo n.º 28
0
def test_edit_list_name():
    client = WindmillTestClient(__name__)

    client.asserts.assertNode(id=u'subscription_1_listname')
    client.asserts.assertText(validator=u'test list 1', id=u'subscription_1_listname')
    client.click(id=u'subscription_1_listname')
    client.type(text=u'shagalaga', name=u'text')
    client.keyPress(options=u'13,false,false,false,false,false', name=u'text')
    client.waits.sleep(milliseconds=u'500')
    client.asserts.assertText(validator=u'shagalaga', id=u'subscription_1_listname')
    client.click(id=u'subscription_1_listname')
    client.type(text=u'test list 1', name=u'text')
    client.keyPress(options=u'13,false,false,false,false,false', name=u'text')
    client.waits.sleep(milliseconds=u'500')
    client.asserts.assertText(validator=u'test list 1', id=u'subscription_1_listname')
Exemplo n.º 29
0
def logged_in_client(test_url='http://localhost:5001/login', username=u'shon', passwd=u'x', client=None):

    if client is None:
        client = WindmillTestClient(__name__)
    
    client.open(url=test_url)
    client.click(id=u'username')
    client.type(text=username, id=u'username')
    # client.type(text=functest.registry['username'], id=u'username')
    client.click(id=u'password')
    client.type(text=passwd, id=u'password')
    # client.type(text=functest.registry['passwd'], id=u'password')
    client.click(id=u'login-btn')

    return client
Exemplo n.º 30
0
def setup_module(module):
    client = WindmillTestClient(__name__)

    #client.open(url='http://www.qq.com/')
    client.open(url='http://zc.qq.com/')
    client.waits.forPageLoad()

    client.click(xpath="//a[@href='http://zc.qq.com/']")

    client.waits.forElement(xpath="//form[@method='post']", timeout=5)

    client.type(text='', xpath="//input[@id='nick']")

    print 'before click'
    clickResult = client.click(xpath=u"//a[@class='button'][name(..)='div']")
    print 'type(clickResult): ', type(clickResult)
Exemplo n.º 31
0
def test_set_item_url():
    client = WindmillTestClient(__name__)

    # set item 1 url (press enter)
    client.asserts.assertJS(js=u"$('#link_button').is(':hidden')")
    client.check(xpath=u"//li[@id='item_1']/input[@type='checkbox']")
    client.asserts.assertChecked(xpath=u"//li[@id='item_1']/input[@type='checkbox']")
    client.asserts.assertJS(js=u"$('#link_button').is(':visible')")
    client.asserts.assertJS(js=u"$('#url_input_container').is(':hidden')")
    client.asserts.assertJS(js=u"$('#item_1_link').is(':hidden')")
    client.click(id=u'link_button')
    client.waits.sleep(milliseconds=u'100')
    client.asserts.assertJS(js=u"$('#url_input_container').is(':visible')")
    client.type(id=u'url_input', text=u'http://google.com/')
    client.keyDown(id=u'url_input', options=u'13,false,false,false,false,false')
    client.waits.sleep(milliseconds=u'500')
    client.asserts.assertJS(js=u"$('#item_1_link').is(':visible')")
    client.asserts.assertJS(js=u"$('#item_1_link').attr('href') == 'http://google.com/'")
    client.asserts.assertJS(js=u"$('#link_button').is(':hidden')")

    # unset item 1 url (click submit button)
    client.check(xpath=u"//li[@id='item_1']/input[@type='checkbox']")
    client.asserts.assertChecked(xpath=u"//li[@id='item_1']/input[@type='checkbox']")
    client.asserts.assertJS(js=u"$('#url_input_container').is(':hidden')")
    client.asserts.assertJS(js=u"$('#item_1_link').is(':visible')")
    client.click(id=u'link_button')
    client.waits.sleep(milliseconds=u'100')
    client.asserts.assertJS(js=u"$('#url_input_container').is(':visible')")
    client.asserts.assertJS(js=u"$('#url_input').val() == 'http://google.com/'")
    client.type(id=u'url_input', text=u'')
    client.click(id=u'url_submit')
    client.waits.sleep(milliseconds=u'500')
    client.asserts.assertJS(js=u"$('#url_input_container').is(':hidden')")
    client.asserts.assertJS(js=u"$('#item_1_link').is(':hidden')")
    client.asserts.assertJS(js=u"$('#item_1_link').attr('href') == ''")

    # test canceling by unchecking while editing
    client.check(xpath=u"//li[@id='item_1']/input[@type='checkbox']")
    client.asserts.assertChecked(xpath=u"//li[@id='item_1']/input[@type='checkbox']")
    client.asserts.assertJS(js=u"$('#url_input_container').is(':hidden')")
    client.click(id=u'link_button')
    client.waits.sleep(milliseconds=u'100')
    client.asserts.assertJS(js=u"$('#url_input_container').is(':visible')")
    client.check(xpath=u"//li[@id='item_1']/input[@type='checkbox']")
    client.asserts.assertNotChecked(xpath=u"//li[@id='item_1']/input[@type='checkbox']")
    client.asserts.assertJS(js=u"$('#url_input_container').is(':hidden')")
Exemplo n.º 32
0
def test_datepicker():
    client = WindmillTestClient(__name__)

    client.click(link=u"Edit user's info")
    client.waits.forPageLoad(timeout=u'20000')
    client.type(text=AUTH_USERNAME, id='id_username')
    client.type(text=AUTH_PASSWORD, id=u'id_password')
    client.click(value=u'ok')
    client.waits.forPageLoad(timeout=u'20000')
    client.waits.forElement(timeout=u'8000', id=u'id_birthday')
    client.click(id=u'id_birthday')
    client.click(link=u'5')
    client.click(name=u'submit')
    client.waits.forPageLoad(timeout=u'20000')
    client.waits.forElement(link=u'Log out', timeout=u'8000')
    client.click(link=u'Log out')
    client.waits.forPageLoad(timeout=u'20000')
Exemplo n.º 33
0
def setup_module(module):
    client = WindmillTestClient(__name__)
    
    #client.open(url='http://www.qq.com/')
    client.open(url='http://zc.qq.com/')
    client.waits.forPageLoad()

    client.click(xpath="//a[@href='http://zc.qq.com/']")
        
    client.waits.forElement(xpath="//form[@method='post']",timeout=5)

    client.type(text='', xpath="//input[@id='nick']")
    
    
    print 'before click'
    clickResult = client.click(xpath=u"//a[@class='button'][name(..)='div']")
    print 'type(clickResult): ', type(clickResult)
Exemplo n.º 34
0
def test_edit_list_name():
    client = WindmillTestClient(__name__)

    client.asserts.assertNode(id=u'subscription_1_listname')
    client.asserts.assertText(validator=u'test list 1',
                              id=u'subscription_1_listname')
    client.click(id=u'subscription_1_listname')
    client.type(text=u'shagalaga', name=u'text')
    client.keyPress(options=u'13,false,false,false,false,false', name=u'text')
    client.waits.sleep(milliseconds=u'500')
    client.asserts.assertText(validator=u'shagalaga',
                              id=u'subscription_1_listname')
    client.click(id=u'subscription_1_listname')
    client.type(text=u'test list 1', name=u'text')
    client.keyPress(options=u'13,false,false,false,false,false', name=u'text')
    client.waits.sleep(milliseconds=u'500')
    client.asserts.assertText(validator=u'test list 1',
                              id=u'subscription_1_listname')
Exemplo n.º 35
0
def test_fold():
    client = WindmillTestClient(__name__)

    client.waits.forElement(classname='jpoker_table')
    client.click(classname=u'jpoker_login_name')
    client.type(classname='jpoker_login_name',
                text=u'user%s' % md5(str(time())).hexdigest())
    client.click(classname=u'jpoker_login_password')
    client.type(classname=u'jpoker_login_password', text=u'password')
    client.click(classname=u'jpoker_login_submit')
    client.waits.forElement(classname='jpoker_logout')
    client.click(classname=u'jpoker_tablepicker_submit')
    for i in range(100):
        client.waits.forElement(jquery=u'(".jpoker_ptable_fold:visible")[0]',
                                timeout=u'60000')
        client.click(classname=u'jpoker_ptable_fold')
        client.waits.forElement(jquery=u'(".jpoker_ptable_fold:hidden")[0]',
                                timeout=u'60000')
Exemplo n.º 36
0
def test_template_tag():
    client = WindmillTestClient(__name__)

    client.click(id=u'id_username')
    client.type(text=u'ivan', id=u'id_username')
    client.type(text=u'passwd', id=u'id_password')
    client.click(value=u'\u0412\u043e\u0439\u0442\u0438')
    client.waits.forPageLoad(timeout=u'20000')
    client.waits.forElement(link=u'Edit in admin', timeout=u'8000')
    client.click(link=u'Edit in admin')
    client.waits.forPageLoad(timeout=u'20000')
    client.waits.forElement(xpath=u"//a[@id='calendarlink0']/img", timeout=u'8000')
    client.click(xpath=u"//a[@id='calendarlink0']/img")
    client.click(link=u'<')
    client.click(name=u'_save')
    client.waits.forPageLoad(timeout=u'20000')
    client.waits.forElement(link=u'                                 \u0412\u044b\u0439\u0442\u0438', timeout=u'8000')
    client.click(link=u'                                 \u0412\u044b\u0439\u0442\u0438')
    client.waits.forPageLoad(timeout=u'20000')
Exemplo n.º 37
0
def test_recordingSuite1():
    client = WindmillTestClient(__name__)

    client.open(url=u"/admin/")
    client.waits.forPageLoad(timeout=u"8000")
    client.type(text=u"admin", id=u"id_username")
    client.type(text=u"admin", id=u"id_password")
    client.click(value=u"Log in")
    client.waits.forPageLoad(timeout=u"20000")
    client.open(url=u"/")
    client.waits.forPageLoad(timeout=u"8000")
    client.waits.forElement(link=u"Edit (admin)", timeout=u"8000")
    client.click(link=u"Edit (admin)")
    client.waits.forPageLoad(timeout=u"20000")
    client.waits.forElement(timeout=u"8000", name=u"_save")
    client.click(name=u"_save")
    client.waits.forPageLoad(timeout=u"20000")

    client.open(url=u"/admin/logout/")
    client.waits.forPageLoad(timeout=u"8000")
Exemplo n.º 38
0
def logged_in_client(user='******', passwd='test', client=None):
  """
  Opens up the root URL.  If user is not logged in, logs him in.
  """
  if client is None:
    client = WindmillTestClient(__name__)
  client.open(url=windmill.settings['TEST_URL'] + '?clearSession=true')
  client.waits.forPageLoad()
  client.waits.forElement(classname='hue-loaded')
  if client.execJS(js="!!$('hue-login')")["output"]:
    client.waits.forElement(classname='hue-username')
    client.click(jquery='(".hue-username")[0]')
    client.type(classname='hue-username', text=user)
    client.click(classname='hue-password')
    client.type(classname='hue-password', text=passwd)
    client.click(classname='hue-continue')
  # Health dashboard launches at login; ideally we'd have a 
  # better "ready" notification.
  time.sleep(2.0) # TODO: Hacky sleep!
  client.waits.forElement(classname='loggedIn', timeout='20000')
  return client
Exemplo n.º 39
0
def test_loginForm():
    client = WindmillTestClient(__name__)

    client.asserts.assertNode(id=u'anon-personalbar')
    client.asserts.assertNode(jquery=u'("#anon-personalbar a.link-overlay")[0]')
    client.click(jquery=u'("#anon-personalbar a.link-overlay")[0]')
    client.waits.forElement(jquery=u'("div.pb-ajax #login_form")[0]', timeout=u'1000')
    client.click(id=u'exposeMask')
    client.waits.sleep(milliseconds=u'500')
    client.asserts.assertNotNode(jquery=u'("div.pb-ajax #login_form")[0]')
    client.asserts.assertNode(id=u'anon-personalbar')
    client.asserts.assertNode(jquery=u'("#anon-personalbar a.link-overlay")[0]')
    client.click(jquery=u'("#anon-personalbar a.link-overlay")[0]')
    client.waits.forElement(jquery=u'("div.pb-ajax #login_form")[0]', timeout=u'1000')
    client.click(name=u'submit')
    client.waits.forElement(jquery=u"('div.pb-ajax dl .portalMessage .error dt')", timeout=u'1000')
    client.type(text=u'admin', id=u'__ac_name')
    client.type(text=u'admin', id=u'__ac_password')
    client.click(name=u'submit')
    client.waits.forPageLoad(timeout=u'20000')
    client.asserts.assertNode(id=u'edit-bar')
Exemplo n.º 40
0
def logged_in_client(user='******', passwd='test', client=None):
    """
  Opens up the root URL.  If user is not logged in, logs him in.
  """
    if client is None:
        client = WindmillTestClient(__name__)
    client.open(url=windmill.settings['TEST_URL'] + '?clearSession=true')
    client.waits.forPageLoad()
    client.waits.forElement(classname='hue-loaded')
    if client.execJS(js="!!$('hue-login')")["output"]:
        client.waits.forElement(classname='hue-username')
        client.click(jquery='(".hue-username")[0]')
        client.type(classname='hue-username', text=user)
        client.click(classname='hue-password')
        client.type(classname='hue-password', text=passwd)
        client.click(classname='hue-continue')
    # Health dashboard launches at login; ideally we'd have a
    # better "ready" notification.
    time.sleep(2.0)  # TODO: Hacky sleep!
    client.waits.forElement(classname='loggedIn', timeout='20000')
    return client
Exemplo n.º 41
0
def test_RecolteTotale():
    client = WindmillTestClient(__name__)

    client.open(url=u'http://declaration.dev.vinsdalsace.fr/civa_dev.php/')
    client.waits.forPageLoad(timeout=u'8000')
    client.click(id=u'recoltant_cvi')
    client.type(text=u'6823700100', id=u'recoltant_cvi')
    client.click(name=u'boutons[valider]')
    client.waits.forPageLoad(timeout=u'8000')
    client.click(link=u'Ann\xe9es pr\xe9c\xe9dentes')
    client.click(
        xpath=
        u"//div[@id='precedentes_declarations']/div/ul/li[2]/ul/li/ul/li/a")
    client.waits.forPageLoad(timeout=u'20000')
    client.waits.forElement(link=u'R\xe9colte totale', timeout=u'8000')
    client.click(link=u'R\xe9colte totale')
    client.click(xpath=u"//div[@id='appelations']/table/tbody/tr[4]/td[1]")
    client.asserts.assertText(
        xpath=u"//div[@id='appelations']/table/thead/tr/th[2]/span",
        validator=u'AOC')
    client.open(url=u'http://declaration.dev.vinsdalsace.fr/civa_dev.php/')
    client.waits.forPageLoad(timeout=u'8000')
    client.click(name=u'boutons[next]')
    client.click(xpath=u"//div[@id='presentation_infos']/div/a/img")
    client.waits.forPageLoad(timeout=u'20000')
    client.waits.forElement(name=u'boutons[next]', timeout=u'8000')
    client.click(xpath=u"//div[@id='presentation_infos']/div/a/img")
    client.waits.forElement(
        timeout=u'8000', xpath=u"//div[@id='modification_infos']/div[7]/input")
    client.click(xpath=u"//div[@id='modification_infos']/div[7]/input")
    client.waits.forPageLoad(timeout=u'80000')
    client.waits.forElement(timeout=u'8000', name=u'boutons[next]')
    client.click(name=u'boutons[next]')
    client.waits.forElement(timeout=u'8000', name=u'boutons[next]')
    client.click(name=u'boutons[next]')
    client.waits.forPageLoad(timeout=u'20000')
    client.waits.forElement(timeout=u'8000', id=u'exploitation_autres_lies')
    client.click(id=u'exploitation_autres_lies')
    client.type(text=u'18', id=u'exploitation_autres_lies')
    client.type(text=u'99', id=u'exploitation_autres_jeunes_vignes')
    client.click(name=u'boutons[next]')
    client.waits.forPageLoad(timeout=u'20000')
    client.waits.forElement(timeout=u'8000', name=u'boutons[next]')
    client.click(name=u'boutons[next]')
    client.waits.forPageLoad(timeout=u'20000')
    client.waits.forElement(timeout=u'8000', name=u'boutons[next]')
    client.click(name=u'boutons[next]')
    client.waits.forPageLoad(timeout=u'20000')
    client.waits.forElement(
        xpath=u"//div[@id='confirmation_fin_declaration']/h2", timeout=u'8000')
    client.click(xpath=u"//div[@id='confirmation_fin_declaration']/h2")
    client.asserts.assertText(
        xpath=u"//div[@id='confirmation_fin_declaration']/h2",
        validator=u'Confirmation')
    client.click(link=u'Deconnexion')
    client.asserts.assertText(validator=u'Connexion', link=u'Connexion')
Exemplo n.º 42
0
def test():
    client = WindmillTestClient(__name__)

    client.click(id=u'viewNavCenterRight')
    client.waits.sleep(milliseconds=2000)
    client.doubleClick(id=u'hourDiv1-1200')
    client.waits.sleep(milliseconds=2000)
    client.type(text=u'Properties Test', id=u'noteTitle')
    client.type(text=u'9:00', id=u'startTime')
    client.type(text=u'4:00', id=u'endTime')
    client.radio(id=u'startMeridianAM')
    client.radio(id=u'endMeridianPM')
    client.select(id=u'eventStatus', option=u'Tentative')
    client.type(text=u'A description for the properties test', id=u'noteDescription')
    if client.execJS(js='1 == 0')['output']:
        pass
##    if client.execJS(js=''lookupNode({id: 'a_node_id'}).innerHTML")['output'] == "some test":
##       pass
    client.keyPress(id=u'some_id', options='a,true,false,false,false,false')
Exemplo n.º 43
0
def setup_module(module):
    client = WindmillTestClient(__name__)

    client.type(text=u'cms/tests/CMSMainTest.yml', id=u'fixture-file')
    client.click(id=u'start-session')

    client.waits.forPageLoad(timeout=u'20000')
    client.click(id=u'admin-link')
    client.waits.forPageLoad(timeout=u'20000')

    client.type(text=u'*****@*****.**', id=u'MemberLoginForm_LoginForm_Email')
    client.type(text=u'ZXXlkwecxz2390232233', id=u'MemberLoginForm_LoginForm_Password')
    client.click(id=u'MemberLoginForm_LoginForm_action_dologin')
    client.waits.forPageLoad(timeout=u'300000')
Exemplo n.º 44
0
def test_edit_ajaxform():
    client = WindmillTestClient(__name__)

    client.click(link=u"Edit user's info")
    client.waits.forPageLoad(timeout=u'20000')
    client.type(text=AUTH_USERNAME, id='id_username')
    client.type(text=AUTH_PASSWORD, id=u'id_password')
    client.click(value=u'ok')
    client.waits.forPageLoad(timeout=u'20000')
    client.waits.forElement(timeout=u'8000', id=u'id_last_name')
    client.click(id=u'id_last_name')
    client.type(text=u'', id=u'id_last_name')
    client.click(name=u'submit')
    client.asserts.assertTextIn(validator=u'Fix errors and submit again:',
                                id=u'form-output')
    client.asserts.assertTextIn(
                        validator=u'"last_name": This field is required.',
                        id=u'form-output')
    client.click(id=u'id_last_name')
    client.type(text=u'eeeeeeeeeee', id=u'id_last_name')
    client.click(name=u'submit')
    client.asserts.assertText(validator=u'Form saved.', id=u'form-output')
Exemplo n.º 45
0
def setup_module(module):
    client = WindmillTestClient(__name__)

    client.type(text=u'cms/tests/CMSMainTest.yml', id=u'fixture-file')
    client.click(id=u'start-session')

    client.waits.forPageLoad(timeout=u'20000')
    client.click(id=u'admin-link')
    client.waits.forPageLoad(timeout=u'20000')

    client.type(text=u'*****@*****.**',
                id=u'MemberLoginForm_LoginForm_Email')
    client.type(text=u'ZXXlkwecxz2390232233',
                id=u'MemberLoginForm_LoginForm_Password')
    client.click(id=u'MemberLoginForm_LoginForm_action_dologin')
    client.waits.forPageLoad(timeout=u'300000')
Exemplo n.º 46
0
def test_profile_change():
    client = WindmillTestClient(__name__)

    client.click(id=u'id_username')
    client.type(text=u'ivan', id=u'id_username')
    client.type(text=u'passwd', id=u'id_password')
    client.click(value=u'\u0412\u043e\u0439\u0442\u0438')
    client.waits.forPageLoad(timeout=u'20000')
    client.waits.forElement(link=u'Edit profile', timeout=u'8000')
    client.click(link=u'Edit profile')
    client.waits.forPageLoad(timeout=u'20000')
    client.waits.forElement(timeout=u'8000', id=u'id_contacts')
    client.click(id=u'id_contacts')
    client.type(text=u'*****@*****.**', id=u'id_contacts')
    client.click(xpath=u'/html/body/form/p[1]')
    client.click(value=u'\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c')
    client.waits.forPageLoad(timeout=u'20000')
    client.waits.forElement(link=u'Exit', timeout=u'8000')
    client.click(link=u'Exit')
    client.waits.forPageLoad(timeout=u'20000')
Exemplo n.º 47
0
def test_openid_authentication():
    client = WindmillTestClient(__name__)
    client.open(url='https://www.hampr.com/')
    client.waits.forPageLoad(timeout=20000)
    client.waits.forElement(xpath="//div[@id='hamprTitle']", timeout=8000)
    client.click(link='OpenID Login')
    client.waits.forPageLoad(timeout=20000)
    client.waits.forElement(xpath="//div[@id='pageContainer']/p[7]/b",
                            timeout=8000)
    client.click(xpath=u"//div[@id='pageContainer']/form/input")
    client.type(text='http://openid.claimid.com/windmilltest',
                xpath="//div[@id='pageContainer']/form/input")
    client.click(xpath="//div[@id='pageContainer']/form/input[2]")
    client.waits.forPageLoad(timeout=20000)
    client.waits.forElement(xpath="//div[@id='content']/form/fieldset/label",
                            timeout=28000)
    client.click(xpath="//div[@id='content']/form/fieldset/label")
    client.click(id='username')
    client.type(text='windmillTest', id='username')
    client.type(text='test_windmill', id='password')
    client.click(value='Login')
    client.waits.forPageLoad(timeout=20000)
Exemplo n.º 48
0
def test():
    client = WindmillTestClient(__name__)

    client.click(link=u'Security')
    client.waits.forPageLoad(timeout=u'20000')
    client.click(xpath=u"/html/body/div[@id='left']/div[@id='treepanes']/ul[@id='TreeActions']/li[@id='addgroup']/button")
    client.waits.sleep(milliseconds=u'5000')

    client.asserts.assertText(validator=u'New Group', id=u'record-2')
    client.asserts.assertValue(validator=u'New Group', id=u'Form_EditForm_Title')

    client.click(id=u'Form_EditForm_Title')
    client.type(text=u'Test Group', id=u'Form_EditForm_Title')
    client.click(id=u'Form_EditForm_action_save')
    client.waits.sleep(milliseconds=u'5000')

    client.asserts.assertText(validator=u'Test Group', id=u'record-2')

    client.click(id=u'Form_AddRecordForm_FirstName')
    client.type(text=u'Test', id=u'Form_AddRecordForm_FirstName')
    client.type(text=u'Person', id=u'Form_AddRecordForm_Surname')
    client.type(text=u'*****@*****.**', id=u'Form_AddRecordForm_Email')
    client.click(id=u'Form_AddRecordForm_action_addtogroup')
def test_create_certificate():
    client = WindmillTestClient(__name__)

    client.open(url=u'http://127.0.0.1:8000/admin/logout/')
    client.waits.forPageLoad(timeout=u'8000')
    client.open(url=u'http://127.0.0.1:8000/admin/')
    client.waits.forPageLoad(timeout=u'8000')
    client.waits.forElement(timeout=u'8000', id=u'id_username')
    client.click(id=u'id_username')
    client.type(text=u'admin', id=u'id_username')
    client.type(text=u'admin', id=u'id_password')
    client.click(value=u'Log in')
    client.waits.forPageLoad(timeout=u'20000')
    client.waits.forElement(link=u'Certificates', timeout=u'8000')
    client.click(link=u'Certificates')
    client.waits.forPageLoad(timeout=u'20000')
    client.waits.forElement(link=u'              Add certificate             ', timeout=u'8000')
    client.click(link=u'              Add certificate             ')
    client.waits.forPageLoad(timeout=u'20000')
    client.waits.forElement(timeout=u'8000', id=u'id_description')
    client.click(id=u'id_description')
    client.type(text=u'srv1', id=u'id_description')
    client.type(text=u'srv1.mycompany.com', id=u'id_common_name')
    client.click(id=u'id_state')
    client.type(text=u'Bavaria', id=u'id_state')
    client.type(text=u'Munich', id=u'id_locality')
    client.type(text=u'My Company', id=u'id_organization')
    client.type(text=u'Datacenter', id=u'id_OU')
    client.click(id=u'id_email')
    client.type(text=u'*****@*****.**', id=u'id_email')
    client.click(id=u'id_subjaltname')
    client.type(text=u'DNS:*.mycompany.com', id=u'id_subjaltname')
    client.click(id=u'id_key_length')
    client.select(option=u'', id=u'id_key_length')
    client.click(value=u'1024')
    client.click(id=u'id_cert_extension')
    client.select(option=u'', id=u'id_cert_extension')
    client.click(value=u'v3_server_cert')
    client.click(id=u'id_valid_days')
    client.type(text=u'365', id=u'id_valid_days')
    client.click(id=u'id_parent')
    client.select(option=u'', id=u'id_parent')
    client.click(value=u'2')
    client.click(id=u'id_parent_passphrase')
    client.type(text=u'1234567890', id=u'id_parent_passphrase')
    client.click(xpath=u"//form[@id='certificate_form']/div[2]/div[2]/input[1]")
    client.waits.forPageLoad(timeout=u'20000')
    client.asserts.assertTextIn(xpath=u"//div[@id='container']/ul/li", validator=u'The certificate "srv1.mycompany.com" was added successfully.')
Exemplo n.º 50
0
def test_wmunti1():
    client = WindmillTestClient(__name__, assertions=False)

    assert client.open(
        url=
        u'http://tutorial.getwindmill.com/windmill-unittests/unit_tester.html'
    )['result']
    assert client.click(id=u'subBtn')['result']

    # Tests that sleeps actually wait for long enough
    start = datetime.now()
    assert client.waits.sleep(milliseconds=u'3000')['result']
    end = datetime.now()
    print(end - start)
    assert (end - start).seconds >= 3
    assert client.asserts.assertText(validator=u'', id=u'sleeper')['result']

    # Tests that an 8 second sleep actually waits long enough
    start = datetime.now()
    assert client.waits.sleep(milliseconds=u'8000')['result']
    end = datetime.now()
    print(end - start)
    assert (end - start).seconds >= 8

    #execIDEJS and storeURL test
    assert client.storeURL(link='AwesomeLink')
    assert client.execIDEJS(
        js=
        'windmill.varRegistry.items["{$AwesomeLink}"] = windmill.varRegistry.items["{$AwesomeLink}"].replace(\'http\', \'abcd\');'
    )
    assert client.asserts.assertJS(
        js="'{$AwesomeLink}' == 'abcd://www.awesome.com/';")
    #unit tests for select by value
    assert client.select(val='d', id='flavor')['result']
    assert client.asserts.assertSelected(validator='d', id='flavor')['result']

    assert client.asserts.assertText(validator=u'Slept',
                                     id=u'sleeper')['result']
    assert client.type(text=u'my test text', id=u'junkfield')['result']
    assert client.asserts.assertValue(validator=u'my test text',
                                      id=u'junkfield')['result']
    assert client.radio(id=u'cougar')['result']
    assert client.asserts.assertChecked(id=u'cougar')['result']
    assert client.radio(id=u'duck')['result']
    assert client.asserts.assertChecked(id=u'duck')['result']
    assert client.check(id=u'Smallpox')['result']
    assert client.asserts.assertChecked(id=u'Smallpox')['result']
    assert not client.asserts.assertChecked(id=u'Mumps')['result']
    assert not client.asserts.assertChecked(id=u'Dizziness')['result']
    assert client.check(id=u'Mumps')['result']
    assert client.asserts.assertChecked(id=u'Mumps')['result']
    assert not client.asserts.assertChecked(id=u'Dizziness')['result']
    assert client.check(id=u'Dizziness')['result']
    assert client.asserts.assertChecked(id=u'Dizziness')['result']
    assert client.type(text=u'The text area tester', name=u'story')['result']
    assert client.asserts.assertValue(validator=u'The text area tester',
                                      id=u'story')['result']
    assert client.select(option=u'Strawberry', id=u'flavor')['result']
    assert client.asserts.assertSelected(validator=u'b',
                                         id=u'flavor')['result']
    assert client.select(option=u'Rum and Raisin', id=u'flavor')['result']
    assert client.asserts.assertSelected(validator=u'c',
                                         id=u'flavor')['result']
    assert not client.asserts.assertSelected(validator=u'd',
                                             id=u'flavor')['result']
    assert client.select(option=u'Peach and Orange', id=u'flavor')['result']
    assert client.asserts.assertSelected(validator=u'd',
                                         id=u'flavor')['result']
    assert client.click(id=u'clickme')['result']
    assert client.asserts.assertText(validator=u'Clicked',
                                     id=u'clickme')['result']
    assert client.doubleClick(id=u'dblclickme')['result']
    assert client.asserts.assertText(validator=u'Double Clicked',
                                     id=u'dblclickme')['result']
    assert client.mouseDown(id=u'mousedownme')['result']
    assert client.asserts.assertText(validator=u'mouse downed',
                                     id=u'mousedownme')['result']
    assert client.mouseUp(id=u'mouseupme')['result']
    assert client.mouseOver(id=u'mouseoverme')['result']
    assert client.asserts.assertText(validator=u'mouse overred',
                                     id=u'mouseoverme')['result']
    assert client.mouseOut(id=u'mouseoverme')['result']
    assert client.asserts.assertText(validator=u'mouseouted',
                                     id=u'mouseoverme')['result']
    assert client.asserts.assertText(validator=u'mouse upped',
                                     id=u'mouseupme')['result']
    assert client.asserts.assertNode(id=u'amIhere')['result']
    assert client.asserts.assertProperty(validator=u'style.height|50px',
                                         id=u'amIhere')['result']
    assert not client.asserts.assertNode(id=u'doesntExist')['result']
    assert not client.asserts.assertNode(id=u'created')['result']
    assert client.click(id=u'wfeBtn')['result']
    assert client.waits.forElement(id=u'created', timeout=u'40000')['result']
    assert client.asserts.assertNode(id=u'created')['result']
    assert client.asserts.assertJS(
        js=u'window.document.title == "windmill_js_unit"')
    assert client.asserts.assertIDEJS(
        js=u'window.document.title == "Windmill IDE"')
    assert client.execJS(js=u'window.awesome = true;')
    assert client.asserts.assertJS(js=u'window.awesome == true;')
    assert client.execIDEJS(js=u'window.awesome = false;')
    assert client.asserts.assertIDEJS(js=u'window.awesome == false;')
Exemplo n.º 51
0
def test_AddRootCA():
    client = WindmillTestClient(__name__)

    client.open(url=u'http://127.0.0.1:8000/admin/')
    client.waits.forPageLoad(timeout=u'8000')
    client.type(text=u'admin', id=u'id_username')
    client.type(text=u'admin', id=u'id_password')
    client.click(value=u'Log in')
    client.waits.forPageLoad(timeout=u'20000')
    client.waits.forElement(
        xpath=u"//div[@id='content-main']/div[2]/table/tbody/tr[1]/td[1]/a",
        timeout=u'8000')
    client.click(
        xpath=u"//div[@id='content-main']/div[2]/table/tbody/tr[1]/td[1]/a")
    client.waits.forPageLoad(timeout=u'20000')
    client.waits.forElement(timeout=u'8000', id=u'id_description')
    client.click(id=u'id_description')
    client.type(text=u'Windmill RootCA', id=u'id_description')
    client.click(id=u'id_common_name')
    client.type(text=u'Root CA', id=u'id_common_name')
    client.click(id=u'id_state')
    client.type(text=u'Bavaria', id=u'id_state')
    client.type(text=u'Munich', id=u'id_locality')
    client.click(id=u'id_organization')
    client.type(text=u'My Company', id=u'id_organization')
    client.click(id=u'id_email')
    client.type(text=u'*****@*****.**', id=u'id_email')
    client.click(id=u'id_valid_days')
    client.type(text=u'365', id=u'id_valid_days')
    client.click(id=u'id_passphrase')
    client.type(text=u'1234567890', id=u'id_passphrase')
    client.check(id=u'id_der_encoded')
    client.check(id=u'id_subcas_allowed')
    client.click(
        xpath=u"//form[@id='certificateauthority_form']/div[2]/div[2]/input[1]"
    )
    client.waits.forPageLoad(timeout=u'20000')
    client.asserts.assertTextIn(
        xpath=u"//div[@id='container']/ul/li",
        validator=u'The certificate authority "Root CA" was added successfully.'
    )
Exemplo n.º 52
0
def test_recordingSuite1():
    client = WindmillTestClient(__name__)

    client.open(url=u'http://127.0.0.1:8000/admin/')
    client.waits.forPageLoad(timeout=u'8000')
    client.waits.forElement(
        xpath=u"//div[@id='content-main']/div[2]/table/tbody/tr[1]/td[1]/a",
        timeout=u'8000')
    client.click(
        xpath=u"//div[@id='content-main']/div[2]/table/tbody/tr[1]/td[1]/a")
    client.waits.forPageLoad(timeout=u'20000')
    client.waits.forElement(timeout=u'8000', id=u'id_description')
    client.click(id=u'id_description')
    client.type(text=u'SubCA', id=u'id_description')
    client.type(text=u'SubCA', id=u'id_common_name')
    client.type(text=u'Bavaria', id=u'id_state')
    client.type(text=u'Munich', id=u'id_locality')
    client.type(text=u'My Company', id=u'id_organization')
    client.type(text=u'BackEnd', id=u'id_OU')
    client.type(text=u'*****@*****.**', id=u'id_email')
    client.type(text=u'122', id=u'id_valid_days')
    client.type(text=u'1234567890', id=u'id_passphrase')
    client.click(id=u'id_parent')
    client.select(option=u'', id=u'id_parent')
    client.click(value=u'1')
    client.click(id=u'id_parent_passphrase')
    client.type(text=u'1234567890', id=u'id_parent_passphrase')
    client.click(
        xpath=u"//form[@id='certificateauthority_form']/div[2]/div[2]/input[1]"
    )
    client.waits.forPageLoad(timeout=u'20000')
    client.asserts.assertTextIn(
        xpath=u"//div[@id='container']/ul/li",
        validator=u'The certificate authority "SubCA" was added successfully.')