Imported Debian patch 4.0.5-6~numeezy
This commit is contained in:
committed by
Mario Fetka
parent
c44de33144
commit
10dfc9587b
@@ -59,13 +59,13 @@ class range_tasks(UI_driver):
|
||||
self.max_id = max_id
|
||||
self.max_rid = max_rid
|
||||
|
||||
def get_domain(self):
|
||||
def get_sid(self):
|
||||
result = self.execute_api_from_ui('trust_find', [], {})
|
||||
trusts = result['result']['result']
|
||||
domain = None
|
||||
sid = None
|
||||
if trusts:
|
||||
domain = trusts[0]['cn']
|
||||
return domain
|
||||
sid = trusts[0]['ipanttrusteddomainsid']
|
||||
return sid
|
||||
|
||||
def get_data(self, pkey, size=50, add_data=None):
|
||||
|
||||
@@ -81,7 +81,7 @@ class range_tasks(UI_driver):
|
||||
}
|
||||
return data
|
||||
|
||||
def get_add_data(self, pkey, range_type='ipa-local', size=50, shift=100, domain=None):
|
||||
def get_add_data(self, pkey, range_type='ipa-local', size=50, shift=100, sid=None):
|
||||
|
||||
base_id = self.max_id + shift
|
||||
self.max_id = base_id + size
|
||||
@@ -98,19 +98,19 @@ class range_tasks(UI_driver):
|
||||
('callback', self.check_range_type_mod, range_type)
|
||||
]
|
||||
|
||||
if not domain:
|
||||
if not sid:
|
||||
base_rid = self.max_rid + shift
|
||||
self.max_rid = base_rid + size
|
||||
add.append(('textbox', 'ipasecondarybaserid', str(base_rid)))
|
||||
if domain:
|
||||
add.append(('textbox', 'ipanttrusteddomainname', domain))
|
||||
if sid:
|
||||
add.append(('textbox', 'ipanttrusteddomainsid', sid))
|
||||
|
||||
return add
|
||||
|
||||
def check_range_type_mod(self, range_type):
|
||||
if range_type == 'ipa-local':
|
||||
self.assert_disabled("[name=ipanttrusteddomainname]")
|
||||
self.assert_disabled("[name=ipanttrusteddomainsid]")
|
||||
self.assert_disabled("[name=ipasecondarybaserid]", negative=True)
|
||||
elif range_type == 'ipa-ad-trust':
|
||||
self.assert_disabled("[name=ipanttrusteddomainname]", negative=True)
|
||||
self.assert_disabled("[name=ipanttrusteddomainsid]", negative=True)
|
||||
self.assert_disabled("[name=ipasecondarybaserid]")
|
||||
|
||||
@@ -25,7 +25,6 @@ from ipatests.test_webui.ui_driver import UI_driver
|
||||
from ipatests.test_webui.ui_driver import screenshot
|
||||
import ipatests.test_webui.data_hostgroup as hostgroup
|
||||
from ipatests.test_webui.test_host import host_tasks
|
||||
import pytest
|
||||
|
||||
ENTITY = 'automember'
|
||||
|
||||
@@ -51,7 +50,6 @@ HOST_GROUP_DATA = {
|
||||
}
|
||||
|
||||
|
||||
@pytest.mark.tier1
|
||||
class test_automember(UI_driver):
|
||||
|
||||
@screenshot
|
||||
@@ -95,7 +93,6 @@ class test_automember(UI_driver):
|
||||
self.init_app()
|
||||
|
||||
host_util = host_tasks()
|
||||
host_util.setup(self.driver, self.config)
|
||||
domain = self.config.get('ipa_domain')
|
||||
host1 = 'web1.%s' % domain
|
||||
host2 = 'web2.%s' % domain
|
||||
|
||||
@@ -23,7 +23,6 @@ Automount tests
|
||||
|
||||
from ipatests.test_webui.ui_driver import UI_driver
|
||||
from ipatests.test_webui.ui_driver import screenshot
|
||||
import pytest
|
||||
|
||||
LOC_ENTITY = 'automountlocation'
|
||||
MAP_ENTITY = 'automountmap'
|
||||
@@ -62,7 +61,6 @@ KEY_DATA = {
|
||||
}
|
||||
|
||||
|
||||
@pytest.mark.tier1
|
||||
class test_automount(UI_driver):
|
||||
|
||||
@screenshot
|
||||
|
||||
@@ -23,16 +23,14 @@ Cert tests
|
||||
|
||||
from ipatests.test_webui.ui_driver import UI_driver
|
||||
from ipatests.test_webui.ui_driver import screenshot
|
||||
import pytest
|
||||
|
||||
ENTITY = 'cert'
|
||||
|
||||
|
||||
@pytest.mark.tier1
|
||||
class test_cert(UI_driver):
|
||||
|
||||
def setup(self, *args, **kwargs):
|
||||
super(test_cert, self).setup(*args, **kwargs)
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(test_cert, self).__init__(args, kwargs)
|
||||
|
||||
if not self.has_ca():
|
||||
self.skip('CA not configured')
|
||||
|
||||
@@ -23,7 +23,6 @@ Config tests
|
||||
|
||||
from ipatests.test_webui.ui_driver import UI_driver
|
||||
from ipatests.test_webui.ui_driver import screenshot
|
||||
import pytest
|
||||
|
||||
ENTITY = 'config'
|
||||
|
||||
@@ -42,7 +41,6 @@ DATA2 = {
|
||||
}
|
||||
|
||||
|
||||
@pytest.mark.tier1
|
||||
class test_config(UI_driver):
|
||||
|
||||
@screenshot
|
||||
|
||||
@@ -23,7 +23,6 @@ Delegation tests
|
||||
|
||||
from ipatests.test_webui.ui_driver import UI_driver
|
||||
from ipatests.test_webui.ui_driver import screenshot
|
||||
import pytest
|
||||
|
||||
ENTITY = 'delegation'
|
||||
PKEY = 'itest-delegation-rule'
|
||||
@@ -43,7 +42,6 @@ DATA = {
|
||||
}
|
||||
|
||||
|
||||
@pytest.mark.tier1
|
||||
class test_delegation(UI_driver):
|
||||
|
||||
@screenshot
|
||||
|
||||
@@ -23,7 +23,6 @@ DNS tests
|
||||
|
||||
from ipatests.test_webui.ui_driver import UI_driver
|
||||
from ipatests.test_webui.ui_driver import screenshot
|
||||
import pytest
|
||||
|
||||
ZONE_ENTITY = 'dnszone'
|
||||
FORWARD_ZONE_ENTITY = 'dnsforwardzone'
|
||||
@@ -38,6 +37,9 @@ ZONE_DATA = {
|
||||
'pkey': ZONE_PKEY,
|
||||
'add': [
|
||||
('textbox', 'idnsname', ZONE_PKEY),
|
||||
('textbox', 'idnssoamname', 'ns'),
|
||||
('textbox', 'ip_address', '192.168.1.1'),
|
||||
('checkbox', 'force', 'checked'),
|
||||
],
|
||||
'mod': [
|
||||
('checkbox', 'idnsallowsyncptr', 'checked'),
|
||||
@@ -86,11 +88,10 @@ CONFIG_MOD_DATA = {
|
||||
}
|
||||
|
||||
|
||||
@pytest.mark.tier1
|
||||
class test_dns(UI_driver):
|
||||
|
||||
def setup(self, *args, **kwargs):
|
||||
super(test_dns, self).setup(*args, **kwargs)
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(test_dns, self).__init__(args, kwargs)
|
||||
|
||||
if not self.has_dns():
|
||||
self.skip('DNS not configured')
|
||||
|
||||
@@ -29,10 +29,8 @@ import ipatests.test_webui.data_netgroup as netgroup
|
||||
import ipatests.test_webui.data_hbac as hbac
|
||||
import ipatests.test_webui.test_rbac as rbac
|
||||
import ipatests.test_webui.data_sudo as sudo
|
||||
import pytest
|
||||
|
||||
|
||||
@pytest.mark.tier1
|
||||
class test_group(UI_driver):
|
||||
|
||||
@screenshot
|
||||
|
||||
@@ -25,10 +25,8 @@ from ipatests.test_webui.ui_driver import UI_driver
|
||||
from ipatests.test_webui.ui_driver import screenshot
|
||||
import ipatests.test_webui.data_hbac as hbac
|
||||
import ipatests.test_webui.data_hostgroup as hostgroup
|
||||
import pytest
|
||||
|
||||
|
||||
@pytest.mark.tier1
|
||||
class test_hbac(UI_driver):
|
||||
|
||||
@screenshot
|
||||
|
||||
@@ -28,16 +28,14 @@ import ipatests.test_webui.data_netgroup as netgroup
|
||||
import ipatests.test_webui.data_hbac as hbac
|
||||
import ipatests.test_webui.test_rbac as rbac
|
||||
import ipatests.test_webui.data_sudo as sudo
|
||||
import pytest
|
||||
|
||||
ENTITY = 'host'
|
||||
|
||||
|
||||
@pytest.mark.tier1
|
||||
class host_tasks(UI_driver):
|
||||
|
||||
def setup(self, *args, **kwargs):
|
||||
super(host_tasks, self).setup(*args, **kwargs)
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(host_tasks, self).__init__(args, kwargs)
|
||||
self.prep_data()
|
||||
self.prep_data2()
|
||||
|
||||
@@ -105,7 +103,6 @@ class host_tasks(UI_driver):
|
||||
return csr
|
||||
|
||||
|
||||
@pytest.mark.tier1
|
||||
class test_host(host_tasks):
|
||||
|
||||
@screenshot
|
||||
|
||||
@@ -29,10 +29,8 @@ import ipatests.test_webui.data_netgroup as netgroup
|
||||
import ipatests.test_webui.data_hbac as hbac
|
||||
import ipatests.test_webui.test_rbac as rbac
|
||||
import ipatests.test_webui.data_sudo as sudo
|
||||
import pytest
|
||||
|
||||
|
||||
@pytest.mark.tier1
|
||||
class test_hostgroup(UI_driver):
|
||||
|
||||
@screenshot
|
||||
@@ -50,8 +48,7 @@ class test_hostgroup(UI_driver):
|
||||
Hostgroup associations
|
||||
"""
|
||||
self.init_app()
|
||||
host = host_tasks()
|
||||
host.setup(self.driver, self.config)
|
||||
host = host_tasks(self.driver, self.config)
|
||||
|
||||
# prepare
|
||||
# -------
|
||||
@@ -92,8 +89,7 @@ class test_hostgroup(UI_driver):
|
||||
Hostgroup indirect associations
|
||||
"""
|
||||
self.init_app()
|
||||
host = host_tasks()
|
||||
host.setup(self.driver, self.config)
|
||||
host = host_tasks(self.driver, self.config)
|
||||
|
||||
# add
|
||||
# ---
|
||||
|
||||
@@ -23,7 +23,6 @@ Kerberos policy tests
|
||||
|
||||
from ipatests.test_webui.ui_driver import UI_driver
|
||||
from ipatests.test_webui.ui_driver import screenshot
|
||||
import pytest
|
||||
|
||||
ENTITY = 'krbtpolicy'
|
||||
|
||||
@@ -42,7 +41,6 @@ DATA2 = {
|
||||
}
|
||||
|
||||
|
||||
@pytest.mark.tier1
|
||||
class test_krbtpolicy(UI_driver):
|
||||
|
||||
@screenshot
|
||||
|
||||
@@ -23,7 +23,6 @@ Basic ui tests
|
||||
|
||||
from ipatests.test_webui.ui_driver import UI_driver
|
||||
from ipatests.test_webui.ui_driver import screenshot
|
||||
import pytest
|
||||
|
||||
|
||||
ENTITIES = [
|
||||
@@ -66,7 +65,6 @@ ENTITIES = [
|
||||
]
|
||||
|
||||
|
||||
@pytest.mark.tier1
|
||||
class test_navigation(UI_driver):
|
||||
|
||||
@screenshot
|
||||
|
||||
@@ -28,10 +28,8 @@ import ipatests.test_webui.data_user as user
|
||||
import ipatests.test_webui.data_group as group
|
||||
import ipatests.test_webui.data_hostgroup as hostgroup
|
||||
from ipatests.test_webui.test_host import host_tasks, ENTITY as HOST_ENTITY
|
||||
import pytest
|
||||
|
||||
|
||||
@pytest.mark.tier1
|
||||
class test_netgroup(UI_driver):
|
||||
|
||||
@screenshot
|
||||
@@ -48,8 +46,7 @@ class test_netgroup(UI_driver):
|
||||
Mod: netgroup
|
||||
"""
|
||||
self.init_app()
|
||||
host = host_tasks()
|
||||
host.setup(self.driver, self.config)
|
||||
host = host_tasks(self.driver, self.config)
|
||||
|
||||
self.add_record(netgroup.ENTITY, netgroup.DATA2)
|
||||
self.add_record(user.ENTITY, user.DATA)
|
||||
|
||||
@@ -23,7 +23,6 @@ Password policy tests
|
||||
|
||||
from ipatests.test_webui.ui_driver import UI_driver
|
||||
from ipatests.test_webui.ui_driver import screenshot
|
||||
import pytest
|
||||
|
||||
ENTITY = 'pwpolicy'
|
||||
DATA = {
|
||||
@@ -45,7 +44,6 @@ DATA = {
|
||||
}
|
||||
|
||||
|
||||
@pytest.mark.tier1
|
||||
class test_pwpolicy(UI_driver):
|
||||
|
||||
@screenshot
|
||||
|
||||
@@ -24,13 +24,11 @@ Range tests
|
||||
import ipatests.test_webui.test_trust as trust_mod
|
||||
from ipatests.test_webui.ui_driver import screenshot
|
||||
from ipatests.test_webui.task_range import range_tasks
|
||||
import pytest
|
||||
|
||||
ENTITY = 'idrange'
|
||||
PKEY = 'itest-range'
|
||||
|
||||
|
||||
@pytest.mark.tier1
|
||||
class test_range(range_tasks):
|
||||
|
||||
@screenshot
|
||||
@@ -76,11 +74,11 @@ class test_range(range_tasks):
|
||||
|
||||
self.add_record(trust_mod.ENTITY, trust_data)
|
||||
|
||||
domain = self.get_domain()
|
||||
sid = self.get_sid()
|
||||
|
||||
self.navigate_to_entity(ENTITY)
|
||||
|
||||
add = self.get_add_data(pkey_ad, range_type='ipa-ad-trust', domain=domain)
|
||||
add = self.get_add_data(pkey_ad, range_type='ipa-ad-trust', sid=sid)
|
||||
data = self.get_data(pkey_ad, add_data=add)
|
||||
self.add_record(ENTITY, data, navigate=False)
|
||||
self.assert_record_value('Active Directory domain range', pkey_ad, column)
|
||||
|
||||
@@ -23,7 +23,6 @@ RBAC tests
|
||||
|
||||
from ipatests.test_webui.ui_driver import UI_driver
|
||||
from ipatests.test_webui.ui_driver import screenshot
|
||||
import pytest
|
||||
|
||||
ROLE_ENTITY = 'role'
|
||||
ROLE_DEF_FACET = 'member_user'
|
||||
@@ -71,7 +70,6 @@ PERMISSION_DATA = {
|
||||
}
|
||||
|
||||
|
||||
@pytest.mark.tier1
|
||||
class test_rbac(UI_driver):
|
||||
|
||||
@screenshot
|
||||
|
||||
@@ -23,12 +23,10 @@ Realm domains tests
|
||||
|
||||
from ipatests.test_webui.ui_driver import UI_driver
|
||||
from ipatests.test_webui.ui_driver import screenshot
|
||||
import pytest
|
||||
|
||||
ENTITY = 'realmdomains'
|
||||
|
||||
|
||||
@pytest.mark.tier1
|
||||
class test_realmdomains(UI_driver):
|
||||
|
||||
@screenshot
|
||||
@@ -41,13 +39,13 @@ class test_realmdomains(UI_driver):
|
||||
|
||||
# add
|
||||
self.add_multivalued('associateddomain', 'itest.bar')
|
||||
self.facet_button_click('save')
|
||||
self.facet_button_click('update')
|
||||
self.dialog_button_click('force')
|
||||
self.wait_for_request()
|
||||
|
||||
# delete
|
||||
self.del_multivalued('associateddomain', 'itest.bar')
|
||||
self.facet_button_click('save')
|
||||
self.facet_button_click('update')
|
||||
self.dialog_button_click('force')
|
||||
self.wait_for_request()
|
||||
self.wait_for_request()
|
||||
|
||||
@@ -23,7 +23,6 @@ Selfservice tests
|
||||
|
||||
from ipatests.test_webui.ui_driver import UI_driver
|
||||
from ipatests.test_webui.ui_driver import screenshot
|
||||
import pytest
|
||||
|
||||
ENTITY = 'selfservice'
|
||||
PKEY = 'itest-selfservice-rule'
|
||||
@@ -40,7 +39,6 @@ DATA = {
|
||||
}
|
||||
|
||||
|
||||
@pytest.mark.tier1
|
||||
class test_selfservice(UI_driver):
|
||||
|
||||
@screenshot
|
||||
|
||||
@@ -27,7 +27,6 @@ import ipatests.test_webui.data_user as user
|
||||
import ipatests.test_webui.data_group as group
|
||||
import ipatests.test_webui.data_hostgroup as hostgroup
|
||||
from ipatests.test_webui.test_host import host_tasks, ENTITY as HOST_ENTITY
|
||||
import pytest
|
||||
|
||||
ENTITY = 'selinuxusermap'
|
||||
PKEY = 'itest-selinuxusermap'
|
||||
@@ -43,7 +42,6 @@ DATA = {
|
||||
}
|
||||
|
||||
|
||||
@pytest.mark.tier1
|
||||
class test_selinuxusermap(UI_driver):
|
||||
|
||||
@screenshot
|
||||
@@ -60,8 +58,7 @@ class test_selinuxusermap(UI_driver):
|
||||
Mod: selinuxusermap
|
||||
"""
|
||||
self.init_app()
|
||||
host = host_tasks()
|
||||
host.setup(self.driver, self.config)
|
||||
host = host_tasks(self.driver, self.config)
|
||||
|
||||
self.add_record(user.ENTITY, user.DATA)
|
||||
self.add_record(user.ENTITY, user.DATA2, navigate=False)
|
||||
|
||||
@@ -23,12 +23,10 @@ Service tests
|
||||
|
||||
from ipatests.test_webui.ui_driver import UI_driver
|
||||
from ipatests.test_webui.ui_driver import screenshot
|
||||
import pytest
|
||||
|
||||
ENTITY = 'service'
|
||||
|
||||
|
||||
@pytest.mark.tier1
|
||||
class sevice_tasks(UI_driver):
|
||||
|
||||
def prep_data(self):
|
||||
@@ -61,7 +59,6 @@ class sevice_tasks(UI_driver):
|
||||
return pkey
|
||||
|
||||
|
||||
@pytest.mark.tier1
|
||||
class test_service(sevice_tasks):
|
||||
|
||||
@screenshot
|
||||
|
||||
@@ -29,10 +29,8 @@ import ipatests.test_webui.data_user as user
|
||||
import ipatests.test_webui.data_group as group
|
||||
import ipatests.test_webui.data_hostgroup as hostgroup
|
||||
from ipatests.test_webui.test_host import host_tasks, ENTITY as HOST_ENTITY
|
||||
import pytest
|
||||
|
||||
|
||||
@pytest.mark.tier1
|
||||
class test_sudo(UI_driver):
|
||||
|
||||
@screenshot
|
||||
@@ -52,8 +50,7 @@ class test_sudo(UI_driver):
|
||||
Mod: sudo
|
||||
"""
|
||||
self.init_app()
|
||||
host = host_tasks()
|
||||
host.setup(self.driver, self.config)
|
||||
host = host_tasks(self.driver, self.config)
|
||||
|
||||
self.add_record(netgroup.ENTITY, netgroup.DATA2)
|
||||
|
||||
|
||||
@@ -24,7 +24,6 @@ Trust tests
|
||||
from ipatests.test_webui.ui_driver import UI_driver
|
||||
from ipatests.test_webui.ui_driver import screenshot
|
||||
from ipatests.test_webui.task_range import range_tasks
|
||||
import pytest
|
||||
|
||||
ENTITY = 'trust'
|
||||
CONFIG_ENTITY = 'trustconfig'
|
||||
@@ -42,7 +41,6 @@ CONFIG_DATA2 = {
|
||||
}
|
||||
|
||||
|
||||
@pytest.mark.tier1
|
||||
class trust_tasks(UI_driver):
|
||||
|
||||
def get_data(self, add_data=None):
|
||||
@@ -95,11 +93,11 @@ class trust_tasks(UI_driver):
|
||||
return domain.upper() + '_id_range'
|
||||
|
||||
|
||||
@pytest.mark.tier1
|
||||
class test_trust(trust_tasks):
|
||||
|
||||
def setup(self, *args, **kwargs):
|
||||
super(test_trust, self).setup(*args, **kwargs)
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(test_trust, self).__init__(args, kwargs)
|
||||
|
||||
if not self.has_trusts():
|
||||
self.skip('Trusts not configured')
|
||||
|
||||
@@ -123,8 +121,7 @@ class test_trust(trust_tasks):
|
||||
|
||||
self.init_app()
|
||||
|
||||
r_tasks = range_tasks()
|
||||
r_tasks.setup(self.driver, self.config)
|
||||
r_tasks = range_tasks(self.driver, self.config)
|
||||
r_tasks.get_shifts()
|
||||
range_add = r_tasks.get_add_data('')
|
||||
base_id = range_add[2][2]
|
||||
|
||||
@@ -29,7 +29,6 @@ import ipatests.test_webui.data_netgroup as netgroup
|
||||
import ipatests.test_webui.data_hbac as hbac
|
||||
import ipatests.test_webui.test_rbac as rbac
|
||||
import ipatests.test_webui.data_sudo as sudo
|
||||
import pytest
|
||||
|
||||
try:
|
||||
from selenium.webdriver.common.by import By
|
||||
@@ -37,7 +36,6 @@ except ImportError:
|
||||
pass
|
||||
|
||||
|
||||
@pytest.mark.tier1
|
||||
class test_user(UI_driver):
|
||||
|
||||
@screenshot
|
||||
|
||||
@@ -22,7 +22,6 @@ Base class for UI integration tests.
|
||||
|
||||
Contains browser driver and common tasks.
|
||||
"""
|
||||
from __future__ import print_function
|
||||
|
||||
import nose
|
||||
from datetime import datetime
|
||||
@@ -53,7 +52,7 @@ try:
|
||||
NO_YAML = False
|
||||
except ImportError:
|
||||
NO_YAML = True
|
||||
from six.moves.urllib.error import URLError
|
||||
from urllib2 import URLError
|
||||
from ipaplatform.paths import paths
|
||||
|
||||
ENV_MAP = {
|
||||
@@ -114,22 +113,16 @@ class UI_driver(object):
|
||||
"""
|
||||
|
||||
@classmethod
|
||||
def setup_class(cls):
|
||||
def setUpClass(cls):
|
||||
if NO_SELENIUM:
|
||||
raise nose.SkipTest('Selenium not installed')
|
||||
|
||||
def setup(self, driver=None, config=None):
|
||||
def __init__(self, driver=None, config=None):
|
||||
self.request_timeout = 30
|
||||
self.driver = driver
|
||||
self.config = config
|
||||
if not config:
|
||||
self.load_config()
|
||||
if not self.driver:
|
||||
self.driver = self.get_driver()
|
||||
self.driver.maximize_window()
|
||||
|
||||
def teardown(self):
|
||||
self.driver.quit()
|
||||
|
||||
def load_config(self):
|
||||
"""
|
||||
@@ -145,9 +138,9 @@ class UI_driver(object):
|
||||
try:
|
||||
with open(path, 'r') as conf:
|
||||
self.config = yaml.load(conf)
|
||||
except yaml.YAMLError as e:
|
||||
except yaml.YAMLError, e:
|
||||
raise nose.SkipTest("Invalid Web UI config.\n%s" % e)
|
||||
except IOError as e:
|
||||
except IOError, e:
|
||||
raise nose.SkipTest("Can't load Web UI test config: %s" % e)
|
||||
else:
|
||||
self.config = {}
|
||||
@@ -155,7 +148,7 @@ class UI_driver(object):
|
||||
c = self.config
|
||||
|
||||
# override with environmental variables
|
||||
for k, v in ENV_MAP.items():
|
||||
for k, v in ENV_MAP.iteritems():
|
||||
val = os.environ.get(k)
|
||||
if val is not None:
|
||||
c[v] = val
|
||||
@@ -168,6 +161,20 @@ class UI_driver(object):
|
||||
if 'type' not in c:
|
||||
c['type'] = DEFAULT_TYPE
|
||||
|
||||
def setUp(self):
|
||||
"""
|
||||
Test setup
|
||||
"""
|
||||
if not self.driver:
|
||||
self.driver = self.get_driver()
|
||||
self.driver.maximize_window()
|
||||
|
||||
def tearDown(self):
|
||||
"""
|
||||
Test clean up
|
||||
"""
|
||||
self.driver.quit()
|
||||
|
||||
def get_driver(self):
|
||||
"""
|
||||
Get WebDriver according to configuration
|
||||
@@ -199,9 +206,9 @@ class UI_driver(object):
|
||||
driver = webdriver.Remote(
|
||||
command_executor='http://%s:%d/wd/hub' % (host, port),
|
||||
desired_capabilities=capabilities)
|
||||
except URLError as e:
|
||||
except URLError, e:
|
||||
raise nose.SkipTest('Error connecting to selenium server: %s' % e)
|
||||
except RuntimeError as e:
|
||||
except RuntimeError, e:
|
||||
raise nose.SkipTest('Error while establishing webdriver: %s' % e)
|
||||
else:
|
||||
try:
|
||||
@@ -214,9 +221,9 @@ class UI_driver(object):
|
||||
if "ff_profile" in self.config:
|
||||
fp = webdriver.FirefoxProfile(self.config["ff_profile"])
|
||||
driver = webdriver.Firefox(fp)
|
||||
except URLError as e:
|
||||
except URLError, e:
|
||||
raise nose.SkipTest('Error connecting to selenium server: %s' % e)
|
||||
except RuntimeError as e:
|
||||
except RuntimeError, e:
|
||||
raise nose.SkipTest('Error while establishing webdriver: %s' % e)
|
||||
|
||||
return driver
|
||||
@@ -935,7 +942,7 @@ class UI_driver(object):
|
||||
checkbox = self.find(input_s, By.CSS_SELECTOR, parent, strict=True)
|
||||
checkbox_id = checkbox.get_attribute('id')
|
||||
label_s = s + " tbody td label[for='%s']" % checkbox_id
|
||||
print(label_s)
|
||||
print label_s
|
||||
label = self.find(label_s, By.CSS_SELECTOR, parent, strict=True)
|
||||
try:
|
||||
ActionChains(self.driver).move_to_element(label).click().perform()
|
||||
@@ -1219,7 +1226,7 @@ class UI_driver(object):
|
||||
new_count = len(self.get_rows())
|
||||
self.assert_row_count(count, new_count)
|
||||
|
||||
def mod_record(self, entity, data, facet='details', facet_btn='save'):
|
||||
def mod_record(self, entity, data, facet='details', facet_btn='update'):
|
||||
"""
|
||||
Mod record
|
||||
|
||||
@@ -1244,7 +1251,7 @@ class UI_driver(object):
|
||||
add_facet_btn='add',
|
||||
add_dialog_btn='add',
|
||||
add_dialog_name='add',
|
||||
update_btn='save',
|
||||
update_btn='update',
|
||||
breadcrumb=None,
|
||||
navigate=True,
|
||||
delete=True):
|
||||
@@ -1462,7 +1469,7 @@ class UI_driver(object):
|
||||
|
||||
# update
|
||||
self.assert_rule_tables_enabled(t_list, False)
|
||||
self.facet_button_click('save')
|
||||
self.facet_button_click('update')
|
||||
self.wait_for_request(n=3, d=0.3)
|
||||
self.assert_rule_tables_enabled(t_list, False)
|
||||
|
||||
@@ -1481,7 +1488,7 @@ class UI_driver(object):
|
||||
for cat in categories:
|
||||
self.check_option(cat, '')
|
||||
self.assert_rule_tables_enabled(t_list, True)
|
||||
self.facet_button_click('save')
|
||||
self.facet_button_click('update')
|
||||
self.wait_for_request(n=3, d=0.3)
|
||||
self.assert_rule_tables_enabled(t_list, True)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user