Skip to content

General

TestConfigurationPage

Bases: UccTester

Source code in tests/ui/test_configuration_page.py
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
class TestConfigurationPage(UccTester):
    @pytest.mark.execute_enterprise_cloud_true
    @pytest.mark.forwarder
    @pytest.mark.configuration
    def test_configuration_page_title_and_description(
        self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
    ):
        """Verifies the title and description of the page"""
        configuration_page = ConfigurationPage(
            ucc_smartx_selenium_helper, ucc_smartx_rest_helper
        )
        self.assert_util(configuration_page.title.wait_to_display, "Configuration")
        self.assert_util(
            configuration_page.description.wait_to_display, "Set up your add-on"
        )

    @pytest.mark.execute_enterprise_cloud_true
    @pytest.mark.forwarder
    @pytest.mark.configuration
    def test_openapi_json_download_button(
        self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
    ):
        """Verifies the OpenAPI json download button"""
        configuration_page = ConfigurationPage(
            ucc_smartx_selenium_helper, ucc_smartx_rest_helper
        )
        download_openapi_href = (
            configuration_page.download_openapi.container.get_attribute("href")
        )
        configuration_page.download_openapi.wait_to_be_clickable()
        self.assert_util(
            f"/app/{ADDON_NAME}/openapi.json",
            download_openapi_href,
            operator="in",
        )

    @pytest.mark.execute_enterprise_cloud_true
    @pytest.mark.forwarder
    @pytest.mark.configuration
    def test_ucc_credits_label_exists(
        self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
    ):
        """Verifies the UCC label is rendered on the page"""
        configuration_page = ConfigurationPage(
            ucc_smartx_selenium_helper, ucc_smartx_rest_helper
        )
        ucc_label = configuration_page.ucc_credit.wait_to_display()
        self.assert_util(
            left="UCC",
            operator="in",
            right=ucc_label,
        )
        self.assert_util(
            left=__version__,
            operator="in",
            right=ucc_label,
        )

test_configuration_page_title_and_description(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)

Verifies the title and description of the page

Source code in tests/ui/test_configuration_page.py
12
13
14
15
16
17
18
19
20
21
22
23
24
25
@pytest.mark.execute_enterprise_cloud_true
@pytest.mark.forwarder
@pytest.mark.configuration
def test_configuration_page_title_and_description(
    self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
):
    """Verifies the title and description of the page"""
    configuration_page = ConfigurationPage(
        ucc_smartx_selenium_helper, ucc_smartx_rest_helper
    )
    self.assert_util(configuration_page.title.wait_to_display, "Configuration")
    self.assert_util(
        configuration_page.description.wait_to_display, "Set up your add-on"
    )

test_openapi_json_download_button(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)

Verifies the OpenAPI json download button

Source code in tests/ui/test_configuration_page.py
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
@pytest.mark.execute_enterprise_cloud_true
@pytest.mark.forwarder
@pytest.mark.configuration
def test_openapi_json_download_button(
    self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
):
    """Verifies the OpenAPI json download button"""
    configuration_page = ConfigurationPage(
        ucc_smartx_selenium_helper, ucc_smartx_rest_helper
    )
    download_openapi_href = (
        configuration_page.download_openapi.container.get_attribute("href")
    )
    configuration_page.download_openapi.wait_to_be_clickable()
    self.assert_util(
        f"/app/{ADDON_NAME}/openapi.json",
        download_openapi_href,
        operator="in",
    )

test_ucc_credits_label_exists(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)

Verifies the UCC label is rendered on the page

Source code in tests/ui/test_configuration_page.py
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
@pytest.mark.execute_enterprise_cloud_true
@pytest.mark.forwarder
@pytest.mark.configuration
def test_ucc_credits_label_exists(
    self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
):
    """Verifies the UCC label is rendered on the page"""
    configuration_page = ConfigurationPage(
        ucc_smartx_selenium_helper, ucc_smartx_rest_helper
    )
    ucc_label = configuration_page.ucc_credit.wait_to_display()
    self.assert_util(
        left="UCC",
        operator="in",
        right=ucc_label,
    )
    self.assert_util(
        left=__version__,
        operator="in",
        right=ucc_label,
    )