Web UI integration tests: PEP8 fixes

Tests modified to comply with PEP8 rules with exception of rule E501 (long lines).
Done by autopep8 tool and 2 manual modifications.

https://fedorahosted.org/freeipa/ticket/3744
This commit is contained in:
Petr Vobornik 2013-07-24 13:24:02 +02:00
parent 8a3d8aeca3
commit 6ec5e5fec6
29 changed files with 176 additions and 186 deletions

View File

@ -25,11 +25,11 @@ DATA = {
'pkey': PKEY, 'pkey': PKEY,
'add': [ 'add': [
('textbox', 'cn', PKEY), ('textbox', 'cn', PKEY),
('textarea', 'description','test-group desc'), ('textarea', 'description', 'test-group desc'),
('radio', 'type','normal'), ('radio', 'type', 'normal'),
], ],
'mod': [ 'mod': [
('textarea', 'description','test-group desc modified'), ('textarea', 'description', 'test-group desc modified'),
], ],
} }
@ -38,33 +38,33 @@ DATA2 = {
'pkey': PKEY2, 'pkey': PKEY2,
'add': [ 'add': [
('textbox', 'cn', PKEY2), ('textbox', 'cn', PKEY2),
('textarea', 'description','test-group2 desc'), ('textarea', 'description', 'test-group2 desc'),
] ]
} }
PKEY3 = 'itest-group3' PKEY3 = 'itest-group3'
DATA3= { DATA3 = {
'pkey': PKEY3, 'pkey': PKEY3,
'add': [ 'add': [
('textbox', 'cn', PKEY3), ('textbox', 'cn', PKEY3),
('textarea', 'description','test-group3 desc'), ('textarea', 'description', 'test-group3 desc'),
] ]
} }
PKEY4 = 'itest-group4' PKEY4 = 'itest-group4'
DATA4= { DATA4 = {
'pkey': PKEY4, 'pkey': PKEY4,
'add': [ 'add': [
('textbox', 'cn', PKEY4), ('textbox', 'cn', PKEY4),
('textarea', 'description','test-group4 desc'), ('textarea', 'description', 'test-group4 desc'),
] ]
} }
PKEY5 = 'itest-group5' PKEY5 = 'itest-group5'
DATA5= { DATA5 = {
'pkey': PKEY5, 'pkey': PKEY5,
'add': [ 'add': [
('textbox', 'cn', PKEY5), ('textbox', 'cn', PKEY5),
('textarea', 'description','test-group5 desc'), ('textarea', 'description', 'test-group5 desc'),
] ]
} }

View File

@ -25,10 +25,10 @@ DATA = {
'pkey': PKEY, 'pkey': PKEY,
'add': [ 'add': [
('textbox', 'cn', PKEY), ('textbox', 'cn', PKEY),
('textarea', 'description','test-hostgroup desc'), ('textarea', 'description', 'test-hostgroup desc'),
], ],
'mod': [ 'mod': [
('textarea', 'description','test-hostgroup desc modified'), ('textarea', 'description', 'test-hostgroup desc modified'),
], ],
} }
@ -37,10 +37,10 @@ DATA2 = {
'pkey': PKEY2, 'pkey': PKEY2,
'add': [ 'add': [
('textbox', 'cn', PKEY2), ('textbox', 'cn', PKEY2),
('textarea', 'description','test-hostgroup2 desc'), ('textarea', 'description', 'test-hostgroup2 desc'),
], ],
'mod': [ 'mod': [
('textarea', 'description','test-hostgroup2 desc modified'), ('textarea', 'description', 'test-hostgroup2 desc modified'),
], ],
} }
@ -49,10 +49,10 @@ DATA3 = {
'pkey': PKEY3, 'pkey': PKEY3,
'add': [ 'add': [
('textbox', 'cn', PKEY3), ('textbox', 'cn', PKEY3),
('textarea', 'description','test-hostgroup3 desc'), ('textarea', 'description', 'test-hostgroup3 desc'),
], ],
'mod': [ 'mod': [
('textarea', 'description','test-hostgroup3 desc modified'), ('textarea', 'description', 'test-hostgroup3 desc modified'),
], ],
} }
@ -61,10 +61,10 @@ DATA4 = {
'pkey': PKEY4, 'pkey': PKEY4,
'add': [ 'add': [
('textbox', 'cn', PKEY4), ('textbox', 'cn', PKEY4),
('textarea', 'description','test-hostgroup4 desc'), ('textarea', 'description', 'test-hostgroup4 desc'),
], ],
'mod': [ 'mod': [
('textarea', 'description','test-hostgroup4 desc modified'), ('textarea', 'description', 'test-hostgroup4 desc modified'),
], ],
} }
@ -73,9 +73,9 @@ DATA5 = {
'pkey': PKEY5, 'pkey': PKEY5,
'add': [ 'add': [
('textbox', 'cn', PKEY5), ('textbox', 'cn', PKEY5),
('textarea', 'description','test-hostgroup5 desc'), ('textarea', 'description', 'test-hostgroup5 desc'),
], ],
'mod': [ 'mod': [
('textarea', 'description','test-hostgroup5 desc modified'), ('textarea', 'description', 'test-hostgroup5 desc modified'),
], ],
} }

View File

@ -34,8 +34,8 @@ DATA = {
('label', 'uid', PKEY), ('label', 'uid', PKEY),
], ],
'mod': [ 'mod': [
('textbox', 'givenname','OtherName'), ('textbox', 'givenname', 'OtherName'),
('textbox', 'sn','OtherSurname'), ('textbox', 'sn', 'OtherSurname'),
('multivalued', 'telephonenumber', [ ('multivalued', 'telephonenumber', [
('add', '123456789'), ('add', '123456789'),
('add', '987654321'), ('add', '987654321'),
@ -59,7 +59,7 @@ DATA2 = {
('textbox', 'sn', 'Surname2'), ('textbox', 'sn', 'Surname2'),
], ],
'mod': [ 'mod': [
('textbox', 'givenname','OtherName2'), ('textbox', 'givenname', 'OtherName2'),
('textbox', 'sn','OtherSurname2'), ('textbox', 'sn', 'OtherSurname2'),
], ],
} }

View File

@ -34,18 +34,6 @@ USER_GROUP_DATA = {
], ],
'mod': [ 'mod': [
('textarea', 'description', 'user group rule description'), ('textarea', 'description', 'user group rule description'),
#(
#'add_table_record',
#'automemberinclusiveregex',
#(
#'table-widget',
#{
#'fields': [
#('textbox', 'automemberinclusiveregex', 'testregex')
#]
#},
#)
#)
], ],
} }
@ -59,6 +47,7 @@ HOST_GROUP_DATA = {
], ],
} }
class test_automember(UI_driver): class test_automember(UI_driver):
def test_crud(self): def test_crud(self):

View File

@ -59,6 +59,7 @@ KEY_DATA = {
] ]
} }
class test_automount(UI_driver): class test_automount(UI_driver):
def test_crud(self): def test_crud(self):

View File

@ -25,6 +25,7 @@ from ipatests.test_webui.ui_driver import UI_driver
ENTITY = 'cert' ENTITY = 'cert'
class test_cert(UI_driver): class test_cert(UI_driver):
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
@ -33,7 +34,6 @@ class test_cert(UI_driver):
if not self.has_ca(): if not self.has_ca():
self.skip('CA not configured') self.skip('CA not configured')
def test_read(self): def test_read(self):
""" """
Basic read: cert Basic read: cert

View File

@ -27,18 +27,19 @@ ENTITY = 'config'
DATA = { DATA = {
'mod': [ 'mod': [
('textbox', 'ipasearchrecordslimit','200'), ('textbox', 'ipasearchrecordslimit', '200'),
('textbox', 'ipasearchtimelimit','3'), ('textbox', 'ipasearchtimelimit', '3'),
], ],
} }
DATA2 = { DATA2 = {
'mod': [ 'mod': [
('textbox', 'ipasearchrecordslimit','100'), ('textbox', 'ipasearchrecordslimit', '100'),
('textbox', 'ipasearchtimelimit','2'), ('textbox', 'ipasearchtimelimit', '2'),
], ],
} }
class test_config(UI_driver): class test_config(UI_driver):
def test_mod(self): def test_mod(self):

View File

@ -40,8 +40,8 @@ DATA = {
], ],
} }
class test_delegation(UI_driver):
class test_delegation(UI_driver):
def test_crud(self): def test_crud(self):
""" """

View File

@ -40,7 +40,7 @@ ZONE_DATA = {
('checkbox', 'force', ''), ('checkbox', 'force', ''),
], ],
'mod': [ 'mod': [
('checkbox', 'idnsallowsyncptr',''), ('checkbox', 'idnsallowsyncptr', ''),
], ],
} }
@ -62,10 +62,11 @@ RECORD_MOD_DATA = {
CONFIG_MOD_DATA = { CONFIG_MOD_DATA = {
'mod': [ 'mod': [
('checkbox', 'idnsallowsyncptr',''), ('checkbox', 'idnsallowsyncptr', ''),
], ],
} }
class test_dns(UI_driver): class test_dns(UI_driver):
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
@ -82,7 +83,7 @@ class test_dns(UI_driver):
# add and mod zone # add and mod zone
self.basic_crud(ZONE_ENTITY, ZONE_DATA, self.basic_crud(ZONE_ENTITY, ZONE_DATA,
default_facet=ZONE_DEFAULT_FACET , delete=False) default_facet=ZONE_DEFAULT_FACET, delete=False)
# add and mod record # add and mod record
self.navigate_to_record(ZONE_PKEY) self.navigate_to_record(ZONE_PKEY)
@ -97,7 +98,6 @@ class test_dns(UI_driver):
self.navigate_by_breadcrumb("DNS Zones") self.navigate_by_breadcrumb("DNS Zones")
self.delete_record(ZONE_PKEY) self.delete_record(ZONE_PKEY)
def test_config_crud(self): def test_config_crud(self):
""" """
Basic CRUD: dnsconfig Basic CRUD: dnsconfig

View File

@ -56,7 +56,7 @@ class test_group(UI_driver):
self.add_record(group.ENTITY, group.DATA, navigate=False) self.add_record(group.ENTITY, group.DATA, navigate=False)
self.navigate_to_record(group.PKEY) self.navigate_to_record(group.PKEY)
self.switch_to_facet('details') self.switch_to_facet('details')
self.facet_button_click('refresh')# workaround for BUG: #3702 self.facet_button_click('refresh') # workaround for BUG: #3702
self.make_external_action() self.make_external_action()
self.delete_action() self.delete_action()
@ -153,7 +153,6 @@ class test_group(UI_driver):
self.add_associations([group.PKEY], 'member_group') self.add_associations([group.PKEY], 'member_group')
self.add_associations([group.PKEY5], 'memberof_group') self.add_associations([group.PKEY5], 'memberof_group')
self.add_record(netgroup.ENTITY, netgroup.DATA) self.add_record(netgroup.ENTITY, netgroup.DATA)
self.navigate_to_record(netgroup.PKEY) self.navigate_to_record(netgroup.PKEY)
self.add_table_associations('memberuser_group', [group.PKEY4]) self.add_table_associations('memberuser_group', [group.PKEY4])

View File

@ -51,12 +51,12 @@ class test_hbac(UI_driver):
self.navigate_to_record(hbac.RULE_PKEY) self.navigate_to_record(hbac.RULE_PKEY)
tables = [ tables = [
['memberuser_user', ['admin'],], ['memberuser_user', ['admin'], ],
['memberuser_group', ['editors'],], ['memberuser_group', ['editors'], ],
['memberhost_host', [host_key],], ['memberhost_host', [host_key], ],
['memberhost_hostgroup', [hostgroup.PKEY],], ['memberhost_hostgroup', [hostgroup.PKEY], ],
['memberservice_hbacsvc', ['ftp'],], ['memberservice_hbacsvc', ['ftp'], ],
['memberservice_hbacsvcgroup', ['Sudo'],], ['memberservice_hbacsvcgroup', ['Sudo'], ],
] ]
categories = [ categories = [

View File

@ -30,6 +30,7 @@ import ipatests.test_webui.data_sudo as sudo
ENTITY = 'host' ENTITY = 'host'
class host_tasks(UI_driver): class host_tasks(UI_driver):
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
@ -75,7 +76,7 @@ class host_tasks(UI_driver):
'pkey': '%s.%s' % (host, domain), 'pkey': '%s.%s' % (host, domain),
'add': add_data, 'add': add_data,
'mod': [ 'mod': [
('textarea', 'description','Desc'), ('textarea', 'description', 'Desc'),
], ],
'del': del_data, 'del': del_data,
} }
@ -91,7 +92,7 @@ class host_tasks(UI_driver):
self.skip('FreeIPA Server IP address not configured') self.skip('FreeIPA Server IP address not configured')
ip = ip.split('.') ip = ip.split('.')
last = int(ip.pop()) last = int(ip.pop())
ip.append(str(last+1)) ip.append(str(last + 1))
return '.'.join(ip) return '.'.join(ip)
def load_csr(self, path): def load_csr(self, path):
@ -139,7 +140,7 @@ class test_host(host_tasks):
self.action_panel_action(panel, 'request_cert') self.action_panel_action(panel, 'request_cert')
self.fill_text('textarea.certificate', csr) self.fill_text('textarea.certificate', csr)
self.dialog_button_click('issue') self.dialog_button_click('issue')
self.wait_for_request(n=2,d=0.5) self.wait_for_request(n=2, d=0.5)
self.assert_visible("div[name='certificate-valid']") self.assert_visible("div[name='certificate-valid']")
# cert view # cert view

View File

@ -29,6 +29,7 @@ import ipatests.test_webui.data_hbac as hbac
import ipatests.test_webui.test_rbac as rbac import ipatests.test_webui.test_rbac as rbac
import ipatests.test_webui.data_sudo as sudo import ipatests.test_webui.data_sudo as sudo
class test_hostgroup(UI_driver): class test_hostgroup(UI_driver):
def test_crud(self): def test_crud(self):
@ -111,7 +112,6 @@ class test_hostgroup(UI_driver):
self.add_associations([hostgroup.PKEY], 'member_hostgroup') self.add_associations([hostgroup.PKEY], 'member_hostgroup')
self.add_associations([hostgroup.PKEY5], 'memberof_hostgroup') self.add_associations([hostgroup.PKEY5], 'memberof_hostgroup')
self.add_record(hbac.RULE_ENTITY, hbac.RULE_DATA) self.add_record(hbac.RULE_ENTITY, hbac.RULE_DATA)
self.navigate_to_record(hbac.RULE_PKEY) self.navigate_to_record(hbac.RULE_PKEY)
self.add_table_associations('memberhost_hostgroup', [hostgroup.PKEY4]) self.add_table_associations('memberhost_hostgroup', [hostgroup.PKEY4])

View File

@ -27,18 +27,19 @@ ENTITY = 'krbtpolicy'
DATA = { DATA = {
'mod': [ 'mod': [
('textbox', 'krbmaxrenewableage','599000'), ('textbox', 'krbmaxrenewableage', '599000'),
('textbox', 'krbmaxticketlife','79800'), ('textbox', 'krbmaxticketlife', '79800'),
], ],
} }
DATA2 = { DATA2 = {
'mod': [ 'mod': [
('textbox', 'krbmaxrenewableage','604800'), ('textbox', 'krbmaxrenewableage', '604800'),
('textbox', 'krbmaxticketlife','86400'), ('textbox', 'krbmaxticketlife', '86400'),
], ],
} }
class test_krbtpolicy(UI_driver): class test_krbtpolicy(UI_driver):
def test_mod(self): def test_mod(self):

View File

@ -60,6 +60,7 @@ ENTITIES = [
# TODO: add conditional # TODO: add conditional
] ]
class test_navigation(UI_driver): class test_navigation(UI_driver):
def test_url_navigation(self): def test_url_navigation(self):
@ -139,7 +140,6 @@ class test_navigation(UI_driver):
self.navigate_by_menu('ipaserver/trusts/trustconfig', False) self.navigate_by_menu('ipaserver/trusts/trustconfig', False)
self.navigate_by_menu('ipaserver/config', False) self.navigate_by_menu('ipaserver/config', False)
def assert_e_url(self, url, e): def assert_e_url(self, url, e):
""" """
Assert correct url for entity Assert correct url for entity

View File

@ -59,10 +59,10 @@ class test_netgroup(UI_driver):
self.navigate_to_record(netgroup.PKEY, entity=netgroup.ENTITY) self.navigate_to_record(netgroup.PKEY, entity=netgroup.ENTITY)
tables = [ tables = [
['memberuser_user', [user.PKEY, user.PKEY2],], ['memberuser_user', [user.PKEY, user.PKEY2], ],
['memberuser_group', [group.PKEY, group.PKEY2],], ['memberuser_group', [group.PKEY, group.PKEY2], ],
['memberhost_host', [host.pkey, host.pkey2],], ['memberhost_host', [host.pkey, host.pkey2], ],
['memberhost_hostgroup', [hostgroup.PKEY, hostgroup.PKEY2],], ['memberhost_hostgroup', [hostgroup.PKEY, hostgroup.PKEY2], ],
] ]
categories = [ categories = [

View File

@ -31,17 +31,18 @@ DATA = {
('textbox', 'cospriority', '364'), ('textbox', 'cospriority', '364'),
], ],
'mod': [ 'mod': [
('textbox', 'krbmaxpwdlife','3000'), ('textbox', 'krbmaxpwdlife', '3000'),
('textbox', 'krbminpwdlife','1'), ('textbox', 'krbminpwdlife', '1'),
('textbox', 'krbpwdhistorylength','0'), ('textbox', 'krbpwdhistorylength', '0'),
('textbox', 'krbpwdmindiffchars','2'), ('textbox', 'krbpwdmindiffchars', '2'),
('textbox', 'krbpwdminlength','2'), ('textbox', 'krbpwdminlength', '2'),
('textbox', 'krbpwdmaxfailure','15'), ('textbox', 'krbpwdmaxfailure', '15'),
('textbox', 'krbpwdfailurecountinterval','5'), ('textbox', 'krbpwdfailurecountinterval', '5'),
('textbox', 'krbpwdlockoutduration','3600'), ('textbox', 'krbpwdlockoutduration', '3600'),
], ],
} }
class test_pwpolicy(UI_driver): class test_pwpolicy(UI_driver):
def test_crud(self): def test_crud(self):

View File

@ -26,6 +26,7 @@ from ipatests.test_webui.ui_driver import UI_driver
ENTITY = 'idrange' ENTITY = 'idrange'
PKEY = 'itest-range' PKEY = 'itest-range'
class test_range(UI_driver): class test_range(UI_driver):
def get_shifts(self, idranges=None): def get_shifts(self, idranges=None):

View File

@ -30,10 +30,10 @@ ROLE_DATA = {
'pkey': ROLE_PKEY, 'pkey': ROLE_PKEY,
'add': [ 'add': [
('textbox', 'cn', ROLE_PKEY), ('textbox', 'cn', ROLE_PKEY),
('textarea', 'description','role desc'), ('textarea', 'description', 'role desc'),
], ],
'mod': [ 'mod': [
('textarea', 'description','role desc mod'), ('textarea', 'description', 'role desc mod'),
], ],
} }
@ -44,10 +44,10 @@ PRIVILEGE_DATA = {
'pkey': PRIVILEGE_PKEY, 'pkey': PRIVILEGE_PKEY,
'add': [ 'add': [
('textbox', 'cn', PRIVILEGE_PKEY), ('textbox', 'cn', PRIVILEGE_PKEY),
('textarea', 'description','privilege desc'), ('textarea', 'description', 'privilege desc'),
], ],
'mod': [ 'mod': [
('textarea', 'description','privilege desc mod'), ('textarea', 'description', 'privilege desc mod'),
], ],
} }
@ -61,10 +61,11 @@ PERMISSION_DATA = {
('textbox', 'filter', 'cn=user'), ('textbox', 'filter', 'cn=user'),
], ],
'mod': [ 'mod': [
('textbox', 'filter','cn=user2'), ('textbox', 'filter', 'cn=user2'),
], ],
} }
class test_rbac(UI_driver): class test_rbac(UI_driver):
def test_crud(self): def test_crud(self):

View File

@ -25,6 +25,7 @@ from ipatests.test_webui.ui_driver import UI_driver
ENTITY = 'realmdomains' ENTITY = 'realmdomains'
class test_realmdomains(UI_driver): class test_realmdomains(UI_driver):
def test_read(self): def test_read(self):

View File

@ -37,8 +37,8 @@ DATA = {
], ],
} }
class test_selfservice(UI_driver):
class test_selfservice(UI_driver):
def test_crud(self): def test_crud(self):
""" """

View File

@ -28,18 +28,19 @@ import ipatests.test_webui.data_hostgroup as hostgroup
from ipatests.test_webui.test_host import host_tasks, ENTITY as HOST_ENTITY from ipatests.test_webui.test_host import host_tasks, ENTITY as HOST_ENTITY
ENTITY = 'selinuxusermap' ENTITY = 'selinuxusermap'
PKEY='itest-selinuxusermap' PKEY = 'itest-selinuxusermap'
DATA = { DATA = {
'pkey': PKEY, 'pkey': PKEY,
'add': [ 'add': [
('textbox', 'cn', PKEY), ('textbox', 'cn', PKEY),
('textbox', 'ipaselinuxuser','user_u:s0'), ('textbox', 'ipaselinuxuser', 'user_u:s0'),
], ],
'mod': [ 'mod': [
('textarea', 'description','itest-selinuxusermap desc'), ('textarea', 'description', 'itest-selinuxusermap desc'),
], ],
} }
class test_selinuxusermap(UI_driver): class test_selinuxusermap(UI_driver):
def test_crud(self): def test_crud(self):
@ -69,10 +70,10 @@ class test_selinuxusermap(UI_driver):
self.navigate_to_record(PKEY) self.navigate_to_record(PKEY)
tables = [ tables = [
['memberuser_user', [user.PKEY, user.PKEY2],], ['memberuser_user', [user.PKEY, user.PKEY2], ],
['memberuser_group', [group.PKEY, group.PKEY2],], ['memberuser_group', [group.PKEY, group.PKEY2], ],
['memberhost_host', [host.pkey, host.pkey2],], ['memberhost_host', [host.pkey, host.pkey2], ],
['memberhost_hostgroup', [hostgroup.PKEY, hostgroup.PKEY2],], ['memberhost_hostgroup', [hostgroup.PKEY, hostgroup.PKEY2], ],
] ]
categories = [ categories = [

View File

@ -25,6 +25,7 @@ from ipatests.test_webui.ui_driver import UI_driver
ENTITY = 'service' ENTITY = 'service'
class sevice_tasks(UI_driver): class sevice_tasks(UI_driver):
def prep_data(self): def prep_data(self):
@ -40,7 +41,7 @@ class sevice_tasks(UI_driver):
('combobox', 'host', host) ('combobox', 'host', host)
], ],
'mod': [ 'mod': [
('checkbox', 'ipakrbokasdelegate',''), ('checkbox', 'ipakrbokasdelegate', ''),
], ],
} }
@ -93,7 +94,7 @@ class test_service(sevice_tasks):
self.action_panel_action(panel, 'request_cert') self.action_panel_action(panel, 'request_cert')
self.fill_text('textarea.certificate', csr) self.fill_text('textarea.certificate', csr)
self.dialog_button_click('issue') self.dialog_button_click('issue')
self.wait_for_request(n=2,d=0.5) self.wait_for_request(n=2, d=0.5)
self.assert_visible("div[name='certificate-valid']") self.assert_visible("div[name='certificate-valid']")
# cert view # cert view

View File

@ -29,6 +29,7 @@ import ipatests.test_webui.data_group as group
import ipatests.test_webui.data_hostgroup as hostgroup import ipatests.test_webui.data_hostgroup as hostgroup
from ipatests.test_webui.test_host import host_tasks, ENTITY as HOST_ENTITY from ipatests.test_webui.test_host import host_tasks, ENTITY as HOST_ENTITY
class test_sudo(UI_driver): class test_sudo(UI_driver):
def test_crud(self): def test_crud(self):
@ -72,17 +73,17 @@ class test_sudo(UI_driver):
self.navigate_to_record(sudo.RULE_PKEY, entity=sudo.RULE_ENTITY) self.navigate_to_record(sudo.RULE_PKEY, entity=sudo.RULE_ENTITY)
tables = [ tables = [
['memberuser_user', [user.PKEY, user.PKEY2],], ['memberuser_user', [user.PKEY, user.PKEY2], ],
['memberuser_group', [group.PKEY, group.PKEY2],], ['memberuser_group', [group.PKEY, group.PKEY2], ],
['memberhost_host', [host.pkey, host.pkey2],], ['memberhost_host', [host.pkey, host.pkey2], ],
['memberhost_hostgroup', [hostgroup.PKEY, hostgroup.PKEY2],], ['memberhost_hostgroup', [hostgroup.PKEY, hostgroup.PKEY2], ],
['memberallowcmd_sudocmd', [sudo.CMD_PKEY, sudo.CMD_PKEY2],], ['memberallowcmd_sudocmd', [sudo.CMD_PKEY, sudo.CMD_PKEY2], ],
['memberallowcmd_sudocmdgroup', [sudo.CMD_GROUP_PKEY, sudo.CMD_GROUP_PKEY2],], ['memberallowcmd_sudocmdgroup', [sudo.CMD_GROUP_PKEY, sudo.CMD_GROUP_PKEY2], ],
['memberdenycmd_sudocmd', [sudo.CMD_PKEY, sudo.CMD_PKEY2],], ['memberdenycmd_sudocmd', [sudo.CMD_PKEY, sudo.CMD_PKEY2], ],
['memberdenycmd_sudocmdgroup', [sudo.CMD_GROUP_PKEY, sudo.CMD_GROUP_PKEY2],], ['memberdenycmd_sudocmdgroup', [sudo.CMD_GROUP_PKEY, sudo.CMD_GROUP_PKEY2], ],
['ipasudorunas_user', ['admin'],], ['ipasudorunas_user', ['admin'], ],
['ipasudorunas_group', ['editors', 'admins'],], ['ipasudorunas_group', ['editors', 'admins'], ],
['ipasudorunasgroup_group', ['editors', 'admins'],], ['ipasudorunasgroup_group', ['editors', 'admins'], ],
] ]
categories = [ categories = [

View File

@ -29,6 +29,7 @@ import ipatests.test_webui.data_hbac as hbac
import ipatests.test_webui.test_rbac as rbac import ipatests.test_webui.test_rbac as rbac
import ipatests.test_webui.data_sudo as sudo import ipatests.test_webui.data_sudo as sudo
class test_user(UI_driver): class test_user(UI_driver):
def test_crud(self): def test_crud(self):
@ -90,7 +91,7 @@ class test_user(UI_driver):
self.add_record(group.ENTITY, group.DATA2) self.add_record(group.ENTITY, group.DATA2)
self.navigate_to_record(group.PKEY2) self.navigate_to_record(group.PKEY2)
self.add_associations([group.PKEY],facet='member_group') self.add_associations([group.PKEY], facet='member_group')
self.add_record(netgroup.ENTITY, netgroup.DATA) self.add_record(netgroup.ENTITY, netgroup.DATA)
self.navigate_to_record(netgroup.PKEY) self.navigate_to_record(netgroup.PKEY)
@ -128,7 +129,6 @@ class test_user(UI_driver):
self.delete(hbac.RULE_ENTITY, [hbac.RULE_DATA]) self.delete(hbac.RULE_ENTITY, [hbac.RULE_DATA])
self.delete(sudo.RULE_ENTITY, [sudo.RULE_DATA]) self.delete(sudo.RULE_ENTITY, [sudo.RULE_DATA])
def test_actions(self): def test_actions(self):
""" """
Test user actions Test user actions
@ -144,8 +144,8 @@ class test_user(UI_driver):
# reset password # reset password
pwd = self.config.get('ipa_password') pwd = self.config.get('ipa_password')
fields = [ fields = [
('password' ,'password1', pwd), ('password', 'password1', pwd),
('password' ,'password2', pwd), ('password', 'password2', pwd),
] ]
self.action_panel_action('account_actions', 'reset_password') self.action_panel_action('account_actions', 'reset_password')
self.assert_dialog() self.assert_dialog()

View File

@ -75,6 +75,7 @@ DEFAULT_BROWSER = 'firefox'
DEFAULT_PORT = 4444 DEFAULT_PORT = 4444
DEFAULT_TYPE = 'local' DEFAULT_TYPE = 'local'
class UI_driver(object): class UI_driver(object):
""" """
Base class for all UI integration tests Base class for all UI integration tests
@ -109,14 +110,14 @@ class UI_driver(object):
except yaml.YAMLError, e: except yaml.YAMLError, e:
raise nose.SkipTest("Invalid Web UI config.\n%s" % e) raise nose.SkipTest("Invalid Web UI config.\n%s" % e)
except IOError, e: except IOError, e:
raise nose.SkipTest("Can't load Web UI test config: %s" %e) raise nose.SkipTest("Can't load Web UI test config: %s" % e)
else: else:
self.config = {} self.config = {}
c = self.config c = self.config
# override with environmental variables # override with environmental variables
for k,v in ENV_MAP.iteritems(): for k, v in ENV_MAP.iteritems():
val = os.environ.get(k) val = os.environ.get(k)
if val is not None: if val is not None:
c[v] = val c[v] = val
@ -129,7 +130,6 @@ class UI_driver(object):
if 'type' not in c: if 'type' not in c:
c['type'] = DEFAULT_TYPE c['type'] = DEFAULT_TYPE
def setUp(self): def setUp(self):
""" """
Test setup Test setup
@ -288,7 +288,6 @@ class UI_driver(object):
""" """
return "contains(concat(' ',normalize-space(@%s), ' '),' %s ')" % (attr, val) return "contains(concat(' ',normalize-space(@%s), ' '),' %s ')" % (attr, val)
def init_app(self): def init_app(self):
""" """
Load and login Load and login
@ -346,7 +345,7 @@ class UI_driver(object):
def navigate_to_entity(self, entity, facet=None): def navigate_to_entity(self, entity, facet=None):
self.driver.get(self.get_url(entity, facet)) self.driver.get(self.get_url(entity, facet))
self.wait_for_request(n=3,d=0.4) self.wait_for_request(n=3, d=0.4)
def navigate_by_menu(self, item, complete=True): def navigate_by_menu(self, item, complete=True):
""" """
@ -432,11 +431,13 @@ class UI_driver(object):
# get facet title # get facet title
el = self.find(".facet-header h3 *:first-child", By.CSS_SELECTOR, facet) el = self.find(".facet-header h3 *:first-child", By.CSS_SELECTOR, facet)
if el: info["title"] = el.text if el:
info["title"] = el.text
# get facet pkey # get facet pkey
el = self.find(".facet-header h3 span.facet-pkey", By.CSS_SELECTOR, facet) el = self.find(".facet-header h3 span.facet-pkey", By.CSS_SELECTOR, facet)
if el: info["pkey"] = el.text if el:
info["pkey"] = el.text
return info return info
@ -677,7 +678,6 @@ class UI_driver(object):
else: else:
self.del_multivalued(name, value, parent) self.del_multivalued(name, value, parent)
def check_option(self, name, value=None, parent=None): def check_option(self, name, value=None, parent=None):
""" """
Find checkbox or radio with name which matches ^NAME\d$ Find checkbox or radio with name which matches ^NAME\d$
@ -826,7 +826,7 @@ class UI_driver(object):
s = "table" s = "table"
if name: if name:
s += "[name='%s']" % name s += "[name='%s']" % name
s +='.search-table' s += '.search-table'
return s return s
def select_record(self, pkey, parent=None, table_name=None): def select_record(self, pkey, parent=None, table_name=None):
@ -901,7 +901,6 @@ class UI_driver(object):
self.wait_for_request(n=2) self.wait_for_request(n=2)
self.wait() self.wait()
def delete(self, entity, data_list, facet='search', navigate=True): def delete(self, entity, data_list, facet='search', navigate=True):
""" """
Delete entity records: Delete entity records:
@ -999,7 +998,6 @@ class UI_driver(object):
assert valid, "Values don't match. Expected: '%s', Got: '%s'" % (expected, actual) assert valid, "Values don't match. Expected: '%s', Got: '%s'" % (expected, actual)
def find_record(self, entity, data, facet='search', dummy='XXXXXXX'): def find_record(self, entity, data, facet='search', dummy='XXXXXXX'):
""" """
Test search functionality of search facet. Test search functionality of search facet.
@ -1011,7 +1009,6 @@ class UI_driver(object):
self.assert_facet(entity, facet) self.assert_facet(entity, facet)
facet = self.get_facet() facet = self.get_facet()
search_field_s = '.search-filter input[name=filter]' search_field_s = '.search-filter input[name=filter]'
key = data.get('pkey') key = data.get('pkey')
@ -1081,7 +1078,6 @@ class UI_driver(object):
self.dialog_button_click('ok') self.dialog_button_click('ok')
self.wait_for_request() self.wait_for_request()
# check for error # check for error
self.assert_no_error_dialog() self.assert_no_error_dialog()
self.wait_for_request() self.wait_for_request()
@ -1119,10 +1115,10 @@ class UI_driver(object):
self.assert_facet_button_enabled(facet_btn, enabled=False) self.assert_facet_button_enabled(facet_btn, enabled=False)
def basic_crud(self, entity, data, def basic_crud(self, entity, data,
parent_entity = None, parent_entity=None,
details_facet = 'details', details_facet='details',
search_facet = 'search', search_facet='search',
default_facet = 'details', default_facet='details',
add_facet_btn='add', add_facet_btn='add',
add_dialog_btn='add', add_dialog_btn='add',
add_dialog_name='add', add_dialog_name='add',
@ -1190,7 +1186,6 @@ class UI_driver(object):
if delete: if delete:
self.delete_record(pkey, data.get('del')) self.delete_record(pkey, data.get('del'))
def add_table_record(self, name, data, parent=None): def add_table_record(self, name, data, parent=None):
""" """
Add record to dnsrecord table, association table and similar Add record to dnsrecord table, association table and similar
@ -1364,7 +1359,6 @@ class UI_driver(object):
# add multiple at once and test table delete button # add multiple at once and test table delete button
self.add_table_associations(table, keys, delete=True) self.add_table_associations(table, keys, delete=True)
def skip(self, reason): def skip(self, reason):
""" """
Skip tests Skip tests
@ -1401,7 +1395,6 @@ class UI_driver(object):
dialogs = self.get_dialogs(name) dialogs = self.get_dialogs(name)
assert len(dialogs) == 1, 'No or more than one dialog opened' assert len(dialogs) == 1, 'No or more than one dialog opened'
def assert_no_error_dialog(self): def assert_no_error_dialog(self):
""" """
Assert that no error dialog is opened Assert that no error dialog is opened
@ -1447,7 +1440,6 @@ class UI_driver(object):
s = "table[name='%s'] " % table_name s = "table[name='%s'] " % table_name
self.assert_button_enabled(name, s, enabled) self.assert_button_enabled(name, s, enabled)
def assert_facet(self, entity, facet=None): def assert_facet(self, entity, facet=None):
""" """
Assert that current facet is correct Assert that current facet is correct
@ -1485,7 +1477,6 @@ class UI_driver(object):
else: else:
assert visible, "Element not visible: %s" % selector assert visible, "Element not visible: %s" % selector
def assert_record(self, pkey, parent=None, table_name=None, negative=False): def assert_record(self, pkey, parent=None, table_name=None, negative=False):
""" """
Assert that record is in current search table Assert that record is in current search table