#8684 [WebUI] test_hostgroup::test_names_and_button - timeout reached
Closed: fixed by mpolovka. Opened by mpolovka.

WebUI test test_hostgroup/test_names_and_button failed in version ipa-4-9 with an error

message = 'Button is not displayed: cancel'
    def until(self, method, message=''):
        """Calls the method provided with the driver as an argument until the \
        return value is not False."""
        screen = None
        stacktrace = None
        end_time = time.time() + self._timeout
        while True:
            try:
                value = method(self._driver)
                if value:
                    return value
            except self._ignored_exceptions as exc:
                screen = getattr(exc, 'screen', None)
                stacktrace = getattr(exc, 'stacktrace', None)
            time.sleep(self._poll)
            if time.time() > end_time:
                break
>       raise TimeoutException(message, screen, stacktrace)
E       selenium.common.exceptions.TimeoutException: Message: Button is not displayed: cancel

Upon investigation it was found that there is sometimes small delay between cancelling one dialog window and showing another, most probably based on system performance and internet connection speed (no other relevant effectors found during the investigation).

Full log follows:

self = <ipatests.test_webui.test_hostgroup.test_hostgroup object at 0x7f1d612d62e8>
    @screenshot
    def test_names_and_button(self):
        """
        Hostgroup names and buttons
        """
        self.init_app()
        host = host_tasks()
        host.driver = self.driver
        host.config = self.config
        self.add_record(hostgroup.ENTITY, hostgroup.DATA6)
        self.add_record(hostgroup.ENTITY, hostgroup.DATA7, navigate=False)
        self.add_record(hostgroup.ENTITY, hostgroup.DATA8, navigate=False)
        # test invalid names
        invalid_names = [hostgroup.LEADING_SPACE,
                         hostgroup.TRAILING_SPACE,
                         hostgroup.NAME_SPACE]
        check_invalid_names(self, invalid_names, hostgroup.CHAR_WARNING_MSG)
        invalid_names = [hostgroup.PKEY6]
        check_invalid_names(self, invalid_names,
                            hostgroup.DUPLICATE_WARNING_MSG)
        # test invalid description
        self.button_click(name='add')
        self.fill_input('cn', hostgroup.PKEY)
        self.fill_textarea('description', hostgroup.LEADING_SPACE)
        self.dialog_button_click('add')
        assert hostgroup.DESCRIPTION_ERROR_DIALOG in \
            self.get_last_error_dialog().text
        self.dialog_button_click('cancel')
        self.wait()
        self.fill_textarea('description', hostgroup.TRAILING_SPACE)
        self.dialog_button_click('add')
        assert hostgroup.DESCRIPTION_ERROR_DIALOG in \
            self.get_last_error_dialog().text
        self.dialog_button_click('cancel')
        self.dialog_button_click('cancel')
        # duplicate
        self.button_click(name='add')
        self.fill_input('cn', hostgroup.PKEY6)
        self.dialog_button_click('add')
        assert hostgroup.DUPLICATE_WARNING_MSG in \
            self.get_last_error_dialog().text
        self.dialog_button_click('cancel')
>       self.dialog_button_click('cancel')
host       = <ipatests.test_webui.test_host.host_tasks object at 0x7f1d61211828>
invalid_names = ['ITEST-HOSTGROUP6']
self       = <ipatests.test_webui.test_hostgroup.test_hostgroup object at 0x7f1d612d62e8>
test_webui/test_hostgroup.py:290: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
test_webui/ui_driver.py:728: in dialog_button_click
    self._button_click(s, dialog, name)
test_webui/ui_driver.py:762: in _button_click
    'Button is not displayed: %s' % (name or selector)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
self = <selenium.webdriver.support.wait.WebDriverWait (session="cc7160b5-9796-4718-be44-c0a175b220ae")>
method = <function UI_driver._button_click.<locals>.<lambda> at 0x7f1d61297d90>
message = 'Button is not displayed: cancel'
    def until(self, method, message=''):
        """Calls the method provided with the driver as an argument until the \
        return value is not False."""
        screen = None
        stacktrace = None
        end_time = time.time() + self._timeout
        while True:
            try:
                value = method(self._driver)
                if value:
                    return value
            except self._ignored_exceptions as exc:
                screen = getattr(exc, 'screen', None)
                stacktrace = getattr(exc, 'stacktrace', None)
            time.sleep(self._poll)
            if time.time() > end_time:
                break
>       raise TimeoutException(message, screen, stacktrace)
E       selenium.common.exceptions.TimeoutException: Message: Button is not displayed: cancel
end_time   = 1609546511.0135734
message    = 'Button is not displayed: cancel'
method     = <function UI_driver._button_click.<locals>.<lambda> at 0x7f1d61297d90>
screen     = None
self       = <selenium.webdriver.support.wait.WebDriverWait (session="cc7160b5-9796-4718-be44-c0a175b220ae")>
stacktrace = None
value      = False
/usr/local/lib/python3.6/site-packages/selenium/webdriver/support/wait.py:80: TimeoutException
------------------------------ Captured log setup ------------------------------
remote_connection.py       388 DEBUG    POST http://127.0.0.1:57769/session {"capabilities": {"firstMatch": [{}], "alwaysMatch": {"browserName": "firefox", "acceptInsecureCerts": true}}, "desiredCapabilities": {"browserName": "firefox", "acceptInsecureCerts": true, "marionette": true}}
connectionpool.py          205 DEBUG    Starting new HTTP connection (1): 127.0.0.1:57769
connectionpool.py          393 DEBUG    http://127.0.0.1:57769 "POST /session HTTP/1.1" 200 686
remote_connection.py       440 DEBUG    Finished Request
remote_connection.py       388 DEBUG    POST http://127.0.0.1:57769/session/cc7160b5-9796-4718-be44-c0a175b220ae/window/maximize {}
connectionpool.py          393 DEBUG    http://127.0.0.1:57769 "POST /session/cc7160b5-9796-4718-be44-c0a175b220ae/window/maximize HTTP/1.1" 200 50
remote_connection.py       440 DEBUG    Finished Request

PR with test adjustment opened at PR5481

Metadata Update from @mpolovka:
- Issue tagged with: webui

master:

  • d0269f2367fb7528693563ce70aa3610915ea3e4 test_webui: test_hostgroup: Wait for modal dialog to appear

Similar failure observed in testing_master_previous

test_hostgroup/test_names_and_button PR [Logs](http://freeipa-org-pr-ci.s3-website.eu-central-1.amazonaws.com/jobs/4094f570-77c9-11eb-b987-fa163e7519b4/report.html

Closing as fixed as the PR is merged and the issue hasn't been present since.

Metadata Update from @mpolovka:
- Issue close_status updated to: fixed
- Issue status updated to: Closed (was: Open)

Metadata