URL: https://github.com/freeipa/freeipa/pull/1938
Author: pavelpicka
 Title: #1938: Extend host test suite with negative scenarios and more test 
cases
Action: opened

PR body:
"""
Automation of host test scenarios.
"""

To pull the PR as Git branch:
git remote add ghfreeipa https://github.com/freeipa/freeipa
git fetch ghfreeipa pull/1938/head:pr1938
git checkout pr1938
From f11c172b5bdebe4affd45f446ad4698151cfbe17 Mon Sep 17 00:00:00 2001
From: Pavel Picka <ppi...@redhat.com>
Date: Fri, 27 Apr 2018 12:04:32 +0200
Subject: [PATCH 1/2] Adding WebUI Host test cases

Added test cases due to downstream test cases
- negative input
- ssh keys
- csr
- otp
- filter
- buttons

https://pagure.io/freeipa/issue/7550

Signed-off-by: Pavel Picka <ppi...@redhat.com>
---
 ipatests/test_webui/data_host.py | 162 +++++++++++++++++
 ipatests/test_webui/test_host.py | 373 ++++++++++++++++++++++++++++++++++++++-
 2 files changed, 533 insertions(+), 2 deletions(-)
 create mode 100644 ipatests/test_webui/data_host.py

diff --git a/ipatests/test_webui/data_host.py b/ipatests/test_webui/data_host.py
new file mode 100644
index 0000000000..d5121fed59
--- /dev/null
+++ b/ipatests/test_webui/data_host.py
@@ -0,0 +1,162 @@
+
+# Copyright (C) 2018  FreeIPA Contributors see COPYING for license
+#
+
+BAD_IP_MSG = "Not a valid IP address"
+BAD_HOSTNAME_MSG = "only letters, numbers, '-' are allowed"
+BAS_HOSTNAME_SPACE_MSG = "Leading and trailing spaces are not allowed"
+
+empty_hostname = {
+    'pkey': 'empty_hostname',
+    'add': [
+    ('textbox', 'hostname', ''),
+    ],
+}
+
+empty_domain = {
+    'pkey': 'empty_domain',
+    'add': [
+    ('textbox', 'hostname', 'itest-empty-domain'),
+    ('textbox', 'dnszone', ''),
+    ],
+}
+
+hostname_tilde = {
+    'pkey': 'tilde_hostname',
+    'add': [
+    ('textbox', 'hostname', '~tilde'),
+    ],
+}
+
+hostname_dash = {
+    'pkey': 'dash_hostname',
+    'add': [
+    ('textbox', 'hostname', '-dash'),
+    ],
+}
+
+hostname_leading_space = {
+    'pkey': 'leading_space',
+    'add': [
+    ('textbox', 'hostname', ' leading_space'),
+    ],
+}
+
+hostname_trailing_space = {
+    'pkey': 'trailing_space',
+    'add': [
+    ('textbox', 'hostname', 'trailing_space '),
+    ],
+}
+
+ip_alpha = {
+    'pkey': 'empty_domain',
+    'add': [
+    ('textbox', 'hostname', 'ip-field-test'),
+    ('textbox', 'ip_address', 'abc.10.12.14'),
+    ],
+}
+
+ip_many_oct = {
+    'pkey': 'empty_domain',
+    'add': [
+    ('textbox', 'hostname', 'ip-field-test'),
+    ('textbox', 'ip_address', '10.10.10.1.10'),
+    ],
+}
+
+ip_bad_oct = {
+    'pkey': 'empty_domain',
+    'add': [
+    ('textbox', 'hostname', 'ip-field-test'),
+    ('textbox', 'ip_address', '10.0.378.1'),
+    ],
+}
+
+ip_special_char = {
+    'pkey': 'empty_domain',
+    'add': [
+    ('textbox', 'hostname', 'ip-field-test'),
+    ('textbox', 'ip_address', '10.0.##.1'),
+    ],
+}
+
+mod_desc = [
+    ('textarea', 'description', 'description in details'),
+]
+
+mod_desc_m = [
+    ('textarea', 'description', 'description never appear'),
+]
+
+mod_locality = [
+    ('textbox', 'l', 'Brno Office'),
+]
+
+mod_location = [
+    ('textbox', 'nshostlocation', 'Brno Office'),
+]
+
+mod_platform = [
+    ('textbox', 'nshardwareplatform', 'x86_64'),
+]
+
+mod_os = [
+    ('textbox', 'nsosversion', 'FEDORA RHEL 277'),
+]
+
+otp_alpha = [
+    ('password', 'userpassword', 'alpha'),
+    ('password', 'password2', 'alpha'),
+]
+
+otp_num = [
+    ('password', 'userpassword', '1234'),
+    ('password', 'password2', '1234'),
+]
+
+otp_alphanum = [
+    ('password', 'userpassword', 'abc123'),
+    ('password', 'password2', 'abc123'),
+]
+
+otp_special = [
+    ('password', 'userpassword', '@#$'),
+    ('password', 'password2', '@#$'),
+]
+
+otp_mixed = [
+    ('password', 'userpassword', 'AbC12D'),
+    ('password', 'password2', 'AbC12D'),
+]
+
+ssh_nomod_error = "no modifications to be performed"
+ssh_invalid_error = "invalid SSH public key"
+ssh_rsa = 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCnAOLatncsaDxF+ldDhjNdPRDWXKsiZUz6Y49LjPnEr9p4Th24dZ7ZuvOVjhXDSkivh6MRunWZC+MXxRo1lDZgkCSyQfkMq0Eu6xkubPg3tYAdrFBZIcIl5CUNerqYMdTz2hyTq6HAR/qs6oRbtzUemwHLPo3duqDRLWQoojP+tI8I2IEXnOO2N5oxqYGWAUe7bGXS/O2ukGfclt8/BfVw9e6eqHqlc7tKGqEctnimlsbG291ctNgco8FsvCnV5EOti/O0rLdkTmm66j7WCFjD9gJncfkAzxc+itWE4eUg/0B5ICIeRrFl5obD8Vu3LzTQ4yKiwaUnY5ngXgWBoFq9 r...@sshkey.testipa.ipa'
+ssh_dsa = 'ssh-dss AAAAB3NzaC1kc3MAAACBAO3OqwC1eNedXVJ57/a+Q/BfVcbZiJcTxhVP6TnIIQXmI+YSu685gLXEHWEAX19+8eQuvUSmgWViuskErCXliE1c4PVyrwkf/2UMsH+hFaj0jlAM4APzizSvHC59hjpr5ktPyrv1arBXGYRuWyZNphJZOFbqK2DHZbz1jvhD4uz5AAAAFQDasuSv8Dkn2Khqek0U3EAHUaUL2wAAAIB5Wr4r7z4ZyaSoaxfiUvvKg49FCeGjrYjRbYN/PazAn/X0rPcGqpaF3u5FmxXP7vhvlvECZvveK7TFIJVz1DSKHMRu8886akKLegF1zhhjrnjN7Q4vHbwkhsCIaV+4rlJa7B32girkSltlooP/qWMnRde0aJIf20Zhq/IF9oj49AAAAIBsKrdE+nxubD13+BdX07Sq6wAPVa9RVCISqEsimlCvopStg8vNuNfGi9swmyFyNjSMiZEgoxH2cLRME4+xzn7THVrmE6OQ/Duz/mQAnDvt1N0Qw4jNxv0WqoT0kz7X21L5Dmg5qy4qdEvlcOkVI9gMrIrXhwGb+Vj8XEGtWcNmJw== r...@sshkey.testipa.ipa'
+ssh_empty = ''
+ssh_invalid = 'ff99cc1234dec invalid'
+
+csr_invalid_error = 'Base64 decoding failed'
+csr_invalid = 'invalid cert'
+csr_other_host_error = 'Base64 decoding failed'
+csr_other_host = '''-----BEGIN NEW CERTIFICATE REQUEST-----
+MIICpjCCAY4CAQAwMDEQMA4GA1UEChMHSVBBLklQQTEcMBoGA1UEAxMTYW5vdGhl
+cmhvc3QuaXBhLmlwYTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAM5Z
+xiBOxo0W107maJt84m4BrkOFErCi0Mk4UQABMAfg/Sbj/+nYL19CA/IgSy4NoCnt
+0RK1IZcFvSzHNhJmwpyRcmaOIbEsjes35rYYA2LKV3QVBp14284tJN5xRHztuL9B
+0NDaSuZOG4JERHJl7JBGOzs4mj3FkI+Ci92d/zi+vpI+T0b26BGejcpU98zkVKxE
+ktXNHqZp/QV7EHsqaZDdIPGTORZokZnU3VFsbUnCLDyghg3+75t+Wq4sJvwL1Y9j
+btO5cQLWTJiOotk1Ies2A5nrp89CpMP45ERtZmoe+G3WeWgW9Nqr182kF5NjlC/O
+sHKz4bP9hT9Z6bk4J3ECAwEAAaAxMC8GCSqGSIb3DQEJDjEiMCAwHgYDVR0RBBcw
+FYITYW5vdGhlcmhvc3QuaXBhLmlwYTANBgkqhkiG9w0BAQsFAAOCAQEAoEQNqnts
+Ob5fTPZRQQo8ygoKa+4GXMjM/Ue2SYs2zOa1/aYeI6JVzWzWH9xHFNvhOkdhu154
+9fefKPtFKeyRTRz60KjSGcHyawDmoWyVYMPgFwmWp1lceFDEy0SlCnB58iXuxYEU
+mwlXmODQR1hQxLuo5Ow3Hy0Djyml7gh7DA/iHP7WrOJH3PwTegxAFFixIj7K6DYK
+3Kaeng72Ht8vQeTEh0Fq4rcfIdlW6tjWywLqLqCjtwhNkak4tJna6M9/3yjeyEnk
+/w7Ya8CyOwlTaCvN8cjnBTxXWVVh+lIaPhujxG4UVtOMqaI30EkMIMHrocCUNnRd
+2e8CMvHPLREqJw==
+-----END NEW CERTIFICATE REQUEST-----'''
+
+krb_enrolled = 'Kerberos Key Present, Host Provisioned'
+krb_not_enrolled = 'Kerberos Key Not Present'
diff --git a/ipatests/test_webui/test_host.py b/ipatests/test_webui/test_host.py
index 48714f1f13..502edd6560 100644
--- a/ipatests/test_webui/test_host.py
+++ b/ipatests/test_webui/test_host.py
@@ -28,8 +28,16 @@
 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 ipatests.test_webui.data_host as host
 import pytest
 
+try:
+    from selenium.webdriver.common.by import By
+    from selenium.webdriver.common.keys import Keys
+    from selenium.webdriver.common.action_chains import ActionChains
+except ImportError:
+    NO_SELENIUM = True
+
 ENTITY = 'host'
 
 
@@ -40,6 +48,8 @@ def setup(self, *args, **kwargs):
         super(host_tasks, self).setup(*args, **kwargs)
         self.prep_data()
         self.prep_data2()
+        self.prep_data3()
+        self.prep_data4()
 
     def prep_data(self):
         host = 'itest'
@@ -56,6 +66,20 @@ def prep_data2(self):
         self.pkey2 = self.data2['pkey']
         return self.data2
 
+    def prep_data3(self):
+        host = 'ITEST3'
+        domain = self.config.get('ipa_domain')
+        self.data3 = self.get_data(host, domain)
+        self.pkey3 = self.data3['pkey']
+        return self.data3
+
+    def prep_data4(self):
+        host = 'ITesT4'
+        domain = self.config.get('ipa_domain')
+        self.data4 = self.get_data(host, domain)
+        self.pkey4 = self.data4['pkey']
+        return self.data4
+
     def get_data(self, host, domain, ip=None):
         if self.has_dns():
             add_data = [
@@ -99,6 +123,10 @@ def get_ip(self):
         return '.'.join(ip)
 
     def load_file(self, path):
+        """
+        Load file helper mainly for CSR load_file
+        """
+
         with open(path, 'r') as file_d:
             content = file_d.read()
         return content
@@ -407,11 +435,352 @@ def test_indirect_associations(self):
         self.assert_indirect_record(hbac.RULE_PKEY, ENTITY, 'memberof_hbacrule')
         self.assert_indirect_record(sudo.RULE_PKEY, ENTITY, 'memberof_sudorule')
 
-        ## cleanup
-        ## -------
+        # cleanup
+        # -------
         self.delete(ENTITY, [self.data])
         self.delete(hostgroup.ENTITY, [hostgroup.DATA, hostgroup.DATA2])
         self.delete(netgroup.ENTITY, [netgroup.DATA])
         self.delete(rbac.ROLE_ENTITY, [rbac.ROLE_DATA])
         self.delete(hbac.RULE_ENTITY, [hbac.RULE_DATA])
         self.delete(sudo.RULE_ENTITY, [sudo.RULE_DATA])
+
+    @screenshot
+    def test_buttons(self):
+        """Test buttons"""
+        self.init_app()
+        actions = ActionChains(self.driver)
+        self.navigate_to_entity(ENTITY)
+        # add with enter key
+        self.navigate_to_entity(ENTITY)
+        self.button_click('add')
+        self.fill_text('div[name="hostname"] input[name="hostname"]',
+                       self.pkey)
+        self.check_option('force')
+        actions.send_keys(Keys.ENTER).perform()
+        self.wait_for_request(n=3)
+        self.assert_record(self.pkey)
+
+        # add and another
+        self.add_record(ENTITY, [self.data2, self.data3])
+        # webui automatically lower case
+        self.pkey3 = self.pkey3.lower()
+        self.data3['pkey'] = self.data3['pkey'].lower()
+        self.pkey4 = self.pkey4.lower()
+        self.data4['pkey'] = self.data4['pkey'].lower()
+
+        # add and edit record
+        self.add_record(ENTITY, self.data4, dialog_btn='add_and_edit')
+        self.assert_facet(ENTITY, facet="details")
+
+        # cancel managedby
+        self.add_associations([self.pkey3], facet='managedby_host',
+                              confirm_btn="cancel")
+        self.wait()
+        fqdn_table = self.find('table[name="fqdn"]', By.CSS_SELECTOR)
+        self.select_record(self.pkey4, parent=fqdn_table)
+        self.button_click('remove')
+        self.dialog_button_click('cancel')
+        self.assert_record(self.pkey4)
+
+        # add duplicate
+        self.add_record(ENTITY, self.data2, negative=True, pre_delete=False)
+        dialog_info = self.get_dialog_info()
+        expected_msg = 'host with name "' + self.data2['pkey'] + '" already exist'
+        if expected_msg in dialog_info['text']:
+            self.dialog_button_click('cancel')
+            self.dialog_button_click('cancel')
+        else:
+            assert False, "Duplicate dialog missing or have wrong text."
+
+        # duplicate with pressed keys
+        self.add_record(ENTITY, self.data2, negative=True, pre_delete=False)
+        actions.send_keys(Keys.TAB).perform()
+        self.wait()
+        actions.send_keys(Keys.ENTER).perform()
+        self.wait(3)
+        self.dialog_button_click('cancel')
+        self.assert_no_dialog()
+
+        # remove multiple
+        self.navigate_to_entity(ENTITY)
+        self.select_multiple_records([self.data2, self.data3, self.data4])
+        self.facet_button_click('remove')
+        self.wait()
+        self.check_option('updatedns')
+        self.dialog_button_click('ok')
+        self.assert_notification()
+        self.close_notifications()
+
+        # remove without updatedns
+        self.select_record(self.pkey)
+        self.facet_button_click('remove')
+        self.dialog_button_click('ok')
+        self.assert_notification()
+        self.close_notifications()
+
+    @screenshot
+    def test_negative_add_input(self):
+        """ Test field validations for adding """
+        self.init_app()
+
+        # wrong hostname input
+        hosts_tests = [host.hostname_tilde,
+                       host.hostname_trailing_space,
+                       host.hostname_dash]
+        for hostname_test in hosts_tests:
+            self.add_record(ENTITY, hostname_test, negative=True)
+            dialog_info = self.get_dialog_info()
+            if host.BAD_HOSTNAME_MSG in dialog_info['text']:
+                self.dialog_button_click('cancel')
+                self.dialog_button_click('cancel')
+
+        # leading space in hostname
+        self.add_record(ENTITY, host.hostname_leading_space, negative=True)
+        dialog_info = self.get_dialog_info()
+        if host.BAS_HOSTNAME_SPACE_MSG in dialog_info['text']:
+            self.dialog_button_click('cancel')
+            self.dialog_button_click('cancel')
+
+        # empty hostname
+        self.add_record(ENTITY, host.empty_hostname, negative=True)
+        hostname_i = self.find('.widget[name="hostname"]', By.CSS_SELECTOR)
+        self.assert_field_validation_required(parent=hostname_i)
+        self.dialog_button_click('cancel')
+
+        # empty domain
+        self.add_record(ENTITY, host.empty_domain, negative=True)
+        dnszone_i = self.find('.widget[name="dnszone"]', By.CSS_SELECTOR)
+        self.assert_field_validation_required(parent=dnszone_i)
+        self.dialog_button_click('cancel')
+
+        # Wrong IP input
+        ip_tests = [host.ip_alpha, host.ip_many_oct,
+                    host.ip_bad_oct, host.ip_special_char]
+        for ip_test in ip_tests:
+            self.add_record(ENTITY, ip_test, negative=True)
+            bad_ip = self.find('.widget[name="ip_address"]', By.CSS_SELECTOR)
+            self.assert_field_validation(host.BAD_IP_MSG, parent=bad_ip)
+            self.dialog_button_click('cancel')
+
+    @screenshot
+    def test_details_input(self):
+        """ Test text fields in details page """
+        self.init_app()
+
+        self.add_record(ENTITY, self.data2)
+        self.navigate_to_record(self.data2['pkey'], entity=ENTITY)
+
+        # modify
+        modify_tests = [host.mod_desc, host.mod_locality,
+                        host.mod_location, host.mod_platform,
+                        host.mod_os]
+        for mod_test in modify_tests:
+            self.fill_fields(mod_test)
+            self.button_click('save')
+            self.assert_notification()
+            self.close_notifications()
+
+        self.fill_fields(host.mod_desc_m)
+        desc_parent = self.find('.textarea-widget[name="description"]',
+                                By.CSS_SELECTOR)
+        self.button_click('undo', parent=desc_parent)
+
+        self.delete(ENTITY, [self.data2])
+
+        # otp set_otp
+        otp_tests = [host.otp_alpha, host.otp_num, host.otp_alphanum,
+                     host.otp_special, host.otp_mixed]
+        for otp_test in otp_tests:
+            self.add_record(ENTITY, self.data2)
+            self.close_notifications()
+            self.navigate_to_record(self.data2['pkey'], entity=ENTITY)
+            self.action_list_action('set_otp', confirm=False)
+            self.fill_fields(otp_test)
+            self.dialog_button_click('confirm')
+            self.assert_notification()
+            self.close_notifications()
+            self.delete(ENTITY, [self.data2])
+            self.close_notifications()
+
+        # otp cancer and reset
+        self.add_record(ENTITY, self.data2)
+        self.navigate_to_record(self.data2['pkey'], entity=ENTITY)
+        self.action_list_action('set_otp', confirm=False)
+        self.assert_dialog()
+        self.dialog_button_click('cancel')
+        self.assert_no_dialog()
+        self.navigate_to_record(self.data2['pkey'], entity=ENTITY)
+        self.action_list_action('set_otp', confirm=False)
+        self.fill_fields(host.otp_alpha)
+        self.dialog_button_click('confirm')
+        self.assert_notification()
+        self.close_notifications()
+        self.action_list_action('reset_otp', confirm=False)
+        self.assert_dialog()
+        self.dialog_button_click('cancel')
+        self.assert_no_dialog()
+
+        # cleanup
+        self.delete(ENTITY, [self.data2])
+
+    @screenshot
+    def test_sshkey(self):
+        """ Test ssh keys """
+        self.init_app()
+        self.add_record(ENTITY, self.data2)
+        self.close_notifications()
+        # add dsa key
+        self.add_sshkey_to_record(host.ssh_dsa, self.data2['pkey'],
+                                  entity=ENTITY, navigate=True)
+        self.assert_notification()
+        self.close_notifications()
+
+        # delete ssh key
+        self.delete_record_sshkeys(self.data2['pkey'],
+                                   entity=ENTITY, navigate=True)
+
+        # add rsa key
+        self.add_sshkey_to_record(host.ssh_rsa, self.data2['pkey'],
+                                  entity=ENTITY, navigate=True)
+        self.assert_notification()
+        self.close_notifications()
+
+        # negative ssh key input
+        neg_key_tests = [host.ssh_empty, host.ssh_rsa]
+        for key in neg_key_tests:
+            self.add_sshkey_to_record(key, self.data2['pkey'],
+                                        entity=ENTITY, navigate=True)
+            self.assert_dialog()
+            dialog_info = self.get_dialog_info()
+            if host.ssh_nomod_error in dialog_info['text']:
+                self.dialog_button_click('cancel')
+
+        # invalid ssh key
+        self.add_sshkey_to_record(host.ssh_invalid, self.data2['pkey'],
+                                  entity=ENTITY, navigate=True)
+        self.assert_dialog()
+        dialog_info = self.get_dialog_info()
+        if host.ssh_invalid_error in dialog_info['text']:
+            self.dialog_button_click('cancel')
+
+        # undo all and delete ssh keys
+        self.undo_ssh_keys(btn_name='undo_all')
+        self.delete_record_sshkeys(self.data2['pkey'],
+                                   entity=ENTITY)
+
+        # undo
+        self.add_sshkey_to_record(host.ssh_rsa, self.data2['pkey'],
+                                  entity=ENTITY, navigate=True, save=False)
+        self.undo_ssh_keys()
+
+        # refresh
+        self.add_sshkey_to_record(host.ssh_rsa, self.data2['pkey'],
+                                  entity=ENTITY, navigate=True, save=False)
+        self.facet_button_click('refresh')
+        self.assert_num_ssh_keys(0)
+
+        # revert
+        self.add_sshkey_to_record(host.ssh_rsa, self.data2['pkey'],
+                                  entity=ENTITY, navigate=True, save=False)
+        self.facet_button_click('revert')
+        self.assert_num_ssh_keys(0)
+
+        # cleanup
+        self.delete(ENTITY, [self.data2])
+
+    @screenshot
+    def test_negative_cert(self):
+        """ Test negative CSR """
+        self.init_app()
+        self.add_record(ENTITY, self.data2)
+        self.close_notifications()
+        self.navigate_to_record(self.data2['pkey'], entity=ENTITY)
+
+        # emtpy CSR
+        csr_add = 'div[name="certificate"] button[name="add"]'
+        csr_add_btn = self.find(csr_add, By.CSS_SELECTOR, strict=True)
+        csr_add_btn.click()
+        self.wait()
+        self.dialog_button_click('ok')
+        self.assert_field_validation_required()
+        self.dialog_button_click('cancel')
+
+        # invalid CSR
+        csr_add = 'div[name="certificate"] button[name="add"]'
+        csr_add_btn = self.find(csr_add, By.CSS_SELECTOR, strict=True)
+        csr_add_btn.click()
+        self.wait()
+        self.fill_textarea('new_cert', host.csr_invalid)
+        self.dialog_button_click('ok')
+        dialog_info = self.get_dialog_info()
+        self.wait()
+        if host.csr_invalid_error in dialog_info['text']:
+            self.dialog_button_click('cancel')
+            self.dialog_button_click('cancel')
+
+        # other hostname CSR
+        self.action_list_action('request_cert', confirm=False)
+        self.assert_dialog()
+        self.fill_text("textarea[name='csr']", host.csr_other_host)
+        self.dialog_button_click('issue')
+        dialog_info = self.get_dialog_info()
+        if host.csr_other_host_error in dialog_info['text']:
+            self.dialog_button_click('cancel')
+            self.dialog_button_click('cancel')
+
+        # cleanup
+        self.delete(ENTITY, [self.data2])
+
+    @screenshot
+    def test_keytab(self):
+        """ Test keytab """
+        self.init_app()
+        self.add_record(ENTITY, self.data2)
+        # provision keytab
+        kt_tmp = '/tmp/test.keytab'
+        hostname = self.data2['pkey']
+        realm = self.config.get('ipa_realm')
+        principal = 'host/{}@{}'.format(hostname, realm)
+        self.run_cmd_on_ui_host('/usr/sbin/ipa-getkeytab '
+                                '-p {} '
+                                '-k {} '.format(principal, kt_tmp))
+        self.navigate_to_record(hostname, entity=ENTITY)
+        self.wait(3)
+        enroll = 'div[name="has_keytab"] label[name="present"]'
+        self.assert_text(enroll, host.krb_enrolled)
+        # test cancel button there bz818665
+        self.action_list_action('unprovision', confirm=False)
+        self.dialog_button_click('cancel')
+        # unprovision keytab
+        self.action_list_action('unprovision', confirm=False)
+        self.dialog_button_click('unprovision')
+        self.wait_for_request(n=4)
+        self.facet_button_click('refresh')
+        enroll = 'div[name="has_keytab"] label[name="missing"]'
+        self.assert_text(enroll, host.krb_not_enrolled)
+        # cleanup
+        self.delete(ENTITY, [self.data2])
+
+    def test_search(self):
+        self.init_app()
+        actions = ActionChains(self.driver)
+        self.navigate_to_entity(ENTITY)
+        self.add_record(ENTITY, [self.data2, self.data3])
+        # positive search filter
+        self.fill_text('div.search-filter input[name="filter"]',
+                       self.pkey2)
+        actions.send_keys(Keys.ENTER).perform()
+        self.wait()
+        self.assert_record(self.pkey2)
+        # negative search filter
+        self.fill_text('div.search-filter input[name="filter"]',
+                       self.pkey3)
+        actions.send_keys(Keys.ENTER).perform()
+        self.wait()
+        self.assert_record(self.pkey4, negative=True)
+        # cleanup
+        self.fill_text('div.search-filter input[name="filter"]',
+                       '')
+        actions.send_keys(Keys.ENTER).perform()
+        self.wait()
+        self.delete_record([self.pkey2.lower(), self.pkey3.lower()])

From 78a16ae5e28befc8857fdeb7a73869297a1486b8 Mon Sep 17 00:00:00 2001
From: Pavel Picka <ppi...@redhat.com>
Date: Thu, 17 May 2018 17:37:01 +0200
Subject: [PATCH 2/2] Temp commit to run webui test

.freeipa-pr-ci.yaml

Signed-off-by: Pavel Picka <ppi...@redhat.com>
---
 .freeipa-pr-ci.yaml | 175 +++++++---------------------------------------------
 1 file changed, 23 insertions(+), 152 deletions(-)

diff --git a/.freeipa-pr-ci.yaml b/.freeipa-pr-ci.yaml
index 88d34d58fc..f56e7465cf 100644
--- a/.freeipa-pr-ci.yaml
+++ b/.freeipa-pr-ci.yaml
@@ -3,6 +3,9 @@ topologies:
     name: build
     cpu: 2
     memory: 3800
+  ipaserver: &ipaserver
+    name: ipaserver
+    cpu: 1
   master_1repl: &master_1repl
     name: master_1repl
     cpu: 4
@@ -27,183 +30,51 @@ jobs:
         timeout: 1800
         topology: *build
 
-  fedora-27/simple_replication:
+  fedora-27/test_webui_a_to_d:
     requires: [fedora-27/build]
     priority: 50
     job:
-      class: RunPytest
+      class: RunWebuiTests
       args:
         build_url: '{fedora-27/build_url}'
-        test_suite: test_integration/test_simple_replication.py
+        test_suite: test_webui/test_automember.py test_webui/test_cert.py test_webui/test_config.py test_webui/test_delegation.py test_webui/test_dns.py
         template: *ci-master-f27
-        timeout: 3600
-        topology: *master_1repl
+        timeout: 7200
+        topology: *ipaserver
 
-  fedora-27/caless:
+  fedora-27/test_webui_g_to_m:
     requires: [fedora-27/build]
     priority: 50
     job:
-      class: RunPytest
+      class: RunWebuiTests
       args:
         build_url: '{fedora-27/build_url}'
-        test_suite: test_integration/test_caless.py::TestServerReplicaCALessToCAFull
+        test_suite: test_webui/test_group.py test_webui/test_hbac.py test_webui/test_host.py test_webui/test_hostgroup.py test_webui/test_idviews.py test_webui/test_krbtpolicy.py test_webui/test_misc_cases.py
         template: *ci-master-f27
-        timeout: 3600
-        topology: *master_1repl
+        timeout: 7200
+        topology: *ipaserver
 
-  fedora-27/external_ca:
+  fedora-27/test_webui_n_to_r:
     requires: [fedora-27/build]
     priority: 50
     job:
-      class: RunPytest
+      class: RunWebuiTests
       args:
         build_url: '{fedora-27/build_url}'
-        test_suite: test_integration/test_external_ca.py::TestExternalCA test_integration/test_external_ca.py::TestSelfExternalSelf test_integration/test_external_ca.py::TestExternalCAInstall
+        test_suite: test_webui/test_navigation.py test_webui/test_netgroup.py test_webui/test_pwpolicy.py test_webui/test_range.py test_webui/test_rbac.py test_webui/test_realmdomains.py
         template: *ci-master-f27
-        timeout: 3600
-        topology: *master_1repl
+        timeout: 7200
+        topology: *ipaserver
 
-  fedora-27/test_topologies:
+  fedora-27/test_webui_s_to_z:
     requires: [fedora-27/build]
     priority: 50
     job:
-      class: RunPytest
+      class: RunWebuiTests
       args:
         build_url: '{fedora-27/build_url}'
-        test_suite: test_integration/test_topologies.py
+        test_suite: test_webui/test_selfservice.py test_webui/test_selinuxusermap.py test_webui/test_service.py test_webui/test_sudo.py test_webui/test_trust.py test_webui/test_user.py test_webui/test_vault.py
         template: *ci-master-f27
-        timeout: 3600
-        topology: *master_1repl
-
-  fedora-27/test_sudo:
-    requires: [fedora-27/build]
-    priority: 50
-    job:
-      class: RunPytest
-      args:
-        build_url: '{fedora-27/build_url}'
-        test_suite: test_integration/test_sudo.py
-        template: *ci-master-f27
-        timeout: 3600
-        topology: *master_1repl_1client
-
-  fedora-27/test_ipa_cli:
-    requires: [fedora-27/build]
-    priority: 50
-    job:
-      class: RunPytest
-      args:
-        build_url: '{fedora-27/build_url}'
-        test_suite: test_integration/test_ipa_cli.py
-        template: *ci-master-f27
-        timeout: 3600
-        topology: *master_1repl
-
-  fedora-27/test_kerberos_flags:
-    requires: [fedora-27/build]
-    priority: 50
-    job:
-      class: RunPytest
-      args:
-        build_url: '{fedora-27/build_url}'
-        test_suite: test_integration/test_kerberos_flags.py
-        template: *ci-master-f27
-        timeout: 3600
-        topology: *master_1repl_1client
-
-  fedora-27/test_http_kdc_proxy:
-    requires: [fedora-27/build]
-    priority: 50
-    job:
-      class: RunPytest
-      args:
-        build_url: '{fedora-27/build_url}'
-        test_suite: test_integration/test_http_kdc_proxy.py
-        template: *ci-master-f27
-        timeout: 3600
-        topology: *master_1repl_1client
-
-  fedora-27/test_forced_client_enrolment:
-    requires: [fedora-27/build]
-    priority: 50
-    job:
-      class: RunPytest
-      args:
-        build_url: '{fedora-27/build_url}'
-        test_suite: test_integration/test_forced_client_reenrollment.py
-        template: *ci-master-f27
-        timeout: 3600
-        topology: *master_1repl_1client
-
-  fedora-27/test_advise:
-    requires: [fedora-27/build]
-    priority: 50
-    job:
-      class: RunPytest
-      args:
-        build_url: '{fedora-27/build_url}'
-        test_suite: test_integration/test_advise.py
-        template: *ci-master-f27
-        timeout: 3600
-        topology: *master_1repl
-
-  fedora-27/test_testconfig:
-    requires: [fedora-27/build]
-    priority: 50
-    job:
-      class: RunPytest
-      args:
-        build_url: '{fedora-27/build_url}'
-        test_suite: test_integration/test_testconfig.py
-        template: *ci-master-f27
-        timeout: 3600
-        topology: *master_1repl
-
-  fedora-27/test_service_permissions:
-    requires: [fedora-27/build]
-    priority: 50
-    job:
-      class: RunPytest
-      args:
-        build_url: '{fedora-27/build_url}'
-        test_suite: test_integration/test_service_permissions.py
-        template: *ci-master-f27
-        timeout: 3600
-        topology: *master_1repl
-
-  fedora-27/test_netgroup:
-    requires: [fedora-27/build]
-    priority: 50
-    job:
-      class: RunPytest
-      args:
-        build_url: '{fedora-27/build_url}'
-        test_suite: test_integration/test_netgroup.py
-        template: *ci-master-f27
-        timeout: 3600
-        topology: *master_1repl
-
-  fedora-27/test_vault:
-    requires: [fedora-27/build]
-    priority: 50
-    job:
-      class: RunPytest
-      args:
-        build_url: '{fedora-27/build_url}'
-        test_suite: test_integration/test_vault.py
-        template: *ci-master-f27
-        timeout: 3600
-        topology: *master_1repl
-
-  fedora-27/test_authconfig:
-    requires: [fedora-27/build]
-    priority: 50
-    job:
-      class: RunPytest
-      args:
-        build_url: '{fedora-27/build_url}'
-        test_suite: test_integration/test_authselect.py
-        template: *ci-master-f27
-        timeout: 3600
-        topology: *master_1repl_1client
+        timeout: 7200
+        topology: *ipaserver
 
_______________________________________________
FreeIPA-devel mailing list -- freeipa-devel@lists.fedorahosted.org
To unsubscribe send an email to freeipa-devel-le...@lists.fedorahosted.org
Fedora Code of Conduct: https://getfedora.org/code-of-conduct.html
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/freeipa-devel@lists.fedorahosted.org/message/AZCA3KC544UVKBXYNDVAJSJZM6DR2T4G/

Reply via email to