File: test_misc_cases.py

package info (click to toggle)
freeipa 4.13.1-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 367,240 kB
  • sloc: javascript: 562,763; python: 310,289; ansic: 49,809; sh: 7,176; makefile: 2,589; xml: 343; sed: 16
file content (47 lines) | stat: -rw-r--r-- 1,264 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#
# Copyright (C) 2018  FreeIPA Contributors see COPYING for license
#

"""
Place for various miscellaneous test cases that do not fit to other suites
"""

from ipatests.test_webui.ui_driver import UI_driver
from ipatests.test_webui.ui_driver import screenshot
import pytest
import re

try:
    from selenium.webdriver.common.by import By
except ImportError:
    pass


@pytest.mark.tier1
class TestMiscCases(UI_driver):

    @screenshot
    def test_version_present(self):

        self.init_app()

        self.profile_menu_action('about')

        about_text = self.get_text('div[data-name="version_dialog"] p')
        ver_re = re.compile('version: .*')
        assert re.search(ver_re, about_text), 'Version not found'
        self.dialog_button_click('ok')

    @screenshot
    def test_customization_pagination_input_required(self):
        """Test if 'pagination size' is required when submitting the form."""
        self.init_app()

        self.profile_menu_action('configuration')
        self.fill_input('pagination_size', '')
        self.dialog_button_click('save')

        pagination_size_elem = self.find(
            ".widget[name='pagination_size']", By.CSS_SELECTOR)

        self.assert_field_validation_required(parent=pagination_size_elem)