web/test/windmill/test_creation.py
brancholdstable
changeset 7676 cc3987eb793c
parent 7388 dc319ece0bd6
parent 7670 6397a9051f65
child 7693 e2f75311d7be
equal deleted inserted replaced
7388:dc319ece0bd6 7676:cc3987eb793c
     1 from cubicweb.devtools import DEFAULT_SOURCES
       
     2 LOGIN, PASSWORD = DEFAULT_SOURCES['admin'].values()
       
     3 
       
     4 # Generated by the windmill services transformer
       
     5 from windmill.authoring import WindmillTestClient
       
     6 
       
     7 def test_creation():
       
     8     client = WindmillTestClient(__name__)
       
     9 
       
    10     client.open(url=u'/')
       
    11     client.waits.forPageLoad(timeout=u'8000')
       
    12     client.type(text=LOGIN, id=u'__login')
       
    13     client.type(text=PASSWORD, id=u'__password')
       
    14     client.click(value=u'log in')
       
    15     client.waits.forPageLoad(timeout=u'20000')
       
    16 
       
    17     # pre-condition
       
    18     client.open(url=u'/cwuser/myuser')
       
    19     client.asserts.assertJS(js=u'$(\'#contentmain h1\').text() == "this resource does not exist"')
       
    20     client.open(url=u'/?rql=Any U WHERE U is CWUser, U login "myuser"')
       
    21     client.asserts.assertJS(js=u'$(\'.searchMessage strong\').text() == "No result matching query"')
       
    22 
       
    23     client.open(url=u'/manage')
       
    24     client.open(url=u'/add/CWUser')
       
    25     client.type(text=u'myuser', id=u'login-subject:A')
       
    26     client.type(text=u'myuser', id=u'upassword-subject:A')
       
    27     client.type(text=u'myuser', name=u'upassword-subject-confirm:A')
       
    28     client.type(text=u'myuser', id=u'firstname-subject:A')
       
    29     client.select(option=u'managers', id=u'from_in_group-subject:A')
       
    30     client.click(id=u'cwinoutadd')
       
    31     client.waits.forPageLoad(timeout=u'20000')
       
    32     client.click(id=u'adduse_email:Alink')
       
    33     client.waits.forPageLoad(timeout=u'20000')
       
    34     client.type(text=u'myuser@logilab.fr', id=u'address-subject:B')
       
    35     client.waits.forPageLoad(timeout=u'20000')
       
    36     client.click(value=u'button_ok')
       
    37     client.waits.forPageLoad(timeout=u'20000')
       
    38     client.waits.sleep(milliseconds=u'5000')
       
    39     client.asserts.assertJS(js=u'$(\'.message\').text() == "entity created"')
       
    40     client.open(url=u'/?rql=Any U WHERE U is CWUser, U login "myuser"')
       
    41     client.waits.forPageLoad(timeout=u'20000')
       
    42     client.asserts.assertJS(js=u'$(\'#contentmain h1\').text() == "myuser"')
       
    43     client.waits.forPageLoad(timeout=u'8000')
       
    44     client.open(url=u'/cwuser/myuser?vid=sameetypelist')
       
    45     client.waits.forPageLoad(timeout=u'8000')
       
    46     client.asserts.assertJS(js=u'$(\'#contentmain a\').text() == "myuser"')
       
    47     client.open(url=u'/cwuser/myuser?vid=text')
       
    48     client.waits.forPageLoad(timeout=u'8000')
       
    49     client.asserts.assertJS(js=u'$(\'#contentmain\').text() == "\\nmyuser"')
       
    50     client.open(url=u'/cwuser/myuser?vid=deleteconf')
       
    51     client.waits.forElement(timeout=u'8000', value=u'button_delete')
       
    52     client.click(value=u'button_delete')
       
    53     client.waits.forPageLoad(timeout=u'8000')
       
    54     client.open(url=u'/cwuser/myuser')
       
    55     client.asserts.assertJS(js=u'$(\'#contentmain h1\').text() == "this resource does not exist"')
       
    56     client.open(url=u'/?rql=Any U WHERE U is CWUser, U login "myuser"')
       
    57     client.asserts.assertJS(js=u'$(\'.searchMessage strong\').text() == "No result matching query"')
       
    58