web/test/windmill/test_creation.py
changeset 5675 4535f8e57580
child 5905 ed66f5a8d48a
equal deleted inserted replaced
5674:9378d13e9ac4 5675:4535f8e57580
       
     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(val=u'4', id=u'in_group-subject:A')
       
    30     client.waits.forPageLoad(timeout=u'20000')
       
    31     client.click(id=u'adduse_email:Alink')
       
    32     client.waits.forPageLoad(timeout=u'20000')
       
    33     client.type(text=u'myuser@logilab.fr', id=u'address-subject:B')
       
    34     client.waits.forPageLoad(timeout=u'20000')
       
    35     client.click(value=u'button_ok')
       
    36     client.waits.forPageLoad(timeout=u'20000')
       
    37     client.asserts.assertJS(js=u'$(\'.message\').text() == "entity created"')
       
    38     client.open(url=u'/?rql=Any U WHERE U is CWUser, U login "myuser"')
       
    39     client.asserts.assertJS(js=u'$(\'#contentmain h1\').text() == "myuser"')
       
    40     client.waits.forPageLoad(timeout=u'8000')
       
    41     client.open(url=u'/cwuser/myuser?vid=sameetypelist')
       
    42     client.waits.forPageLoad(timeout=u'8000')
       
    43     client.asserts.assertJS(js=u'$(\'#contentmain a\').text() == "myuser"')
       
    44     client.open(url=u'/cwuser/myuser?vid=text')
       
    45     client.waits.forPageLoad(timeout=u'8000')
       
    46     client.asserts.assertJS(js=u'$(\'#contentmain\').text() == "\\nmyuser"')
       
    47     client.open(url=u'/cwuser/myuser?vid=deleteconf')
       
    48     client.waits.forElement(timeout=u'8000', value=u'button_delete')
       
    49     client.click(value=u'button_delete')
       
    50     client.waits.forPageLoad(timeout=u'8000')
       
    51     client.open(url=u'/cwuser/myuser')
       
    52     client.asserts.assertJS(js=u'$(\'#contentmain h1\').text() == "this resource does not exist"')
       
    53     client.open(url=u'/?rql=Any U WHERE U is CWUser, U login "myuser"')
       
    54     client.asserts.assertJS(js=u'$(\'.searchMessage strong\').text() == "No result matching query"')
       
    55