Skip to content

Proxy

TestProxyPage

Bases: UccTester

Source code in tests/ui/test_configuration_page_proxy_tab.py
 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
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
class TestProxyPage(UccTester):
    @pytest.mark.execute_enterprise_cloud_false
    @pytest.mark.forwarder
    @pytest.mark.proxy
    def test_proxy_misc(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper):
        proxy = Proxy(
            C.ADDON_NAME,
            _PROXY_URL,
            ucc_smartx_selenium_helper=ucc_smartx_selenium_helper,
            ucc_smartx_rest_helper=ucc_smartx_rest_helper,
        )

        # Labels
        self.assert_util(proxy.proxy_enable.get_input_label, "Enable")
        self.assert_util(proxy.type.get_input_label, "Proxy Type")
        self.assert_util(proxy.host.get_input_label, "Host")
        self.assert_util(proxy.port.get_input_label, "Port")
        self.assert_util(proxy.username.get_input_label, "Username")
        self.assert_util(proxy.password.get_input_label, "Password")
        self.assert_util(proxy.dns_enable.get_input_label, "Reverse DNS resolution")

        # Default values
        self.assert_util(proxy.proxy_enable.is_checked(), False)
        self.assert_util(proxy.type.get_value(), "http")
        self.assert_util(proxy.type.list_of_values(), ["http", "socks4", "socks5"])
        self.assert_util(proxy.host.get_value(), "")
        self.assert_util(proxy.port.get_value(), "")
        self.assert_util(proxy.username.get_value(), "")
        self.assert_util(proxy.password.get_value(), "")
        self.assert_util(proxy.dns_enable.is_checked(), False)

    @pytest.mark.execute_enterprise_cloud_false
    @pytest.mark.forwarder
    @pytest.mark.proxy
    def test_proxy_required_field_host(
        self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
    ):
        # Tests proxy.options.saveValidator
        proxy = Proxy(
            C.ADDON_NAME,
            _PROXY_URL,
            ucc_smartx_selenium_helper=ucc_smartx_selenium_helper,
            ucc_smartx_rest_helper=ucc_smartx_rest_helper,
        )
        proxy.proxy_enable.check()
        proxy.type.select("http")
        proxy.port.set_value("655")
        proxy.username.set_value("test")
        proxy.password.set_value("test")
        self.assert_util(
            proxy.save, "Proxy Host can not be empty", left_args={"expect_error": True}
        )
        proxy.host.set_value("closeerror")
        self.assert_util(proxy.is_error_closed, True)

    @pytest.mark.execute_enterprise_cloud_false
    @pytest.mark.forwarder
    @pytest.mark.proxy
    def test_proxy_host_field_length_validation(
        self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
    ):
        proxy = Proxy(
            C.ADDON_NAME,
            _PROXY_URL,
            ucc_smartx_selenium_helper=ucc_smartx_selenium_helper,
            ucc_smartx_rest_helper=ucc_smartx_rest_helper,
        )
        host_value = "a" * 4097
        proxy.host.set_value(host_value)
        self.assert_util(
            proxy.save,
            "Max host length is 4096",
            left_args={"expect_error": True},
        )

    @pytest.mark.execute_enterprise_cloud_false
    @pytest.mark.forwarder
    @pytest.mark.proxy
    def test_proxy_required_field_port(
        self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
    ):
        # Tests proxy.options.saveValidator
        proxy = Proxy(
            C.ADDON_NAME,
            _PROXY_URL,
            ucc_smartx_selenium_helper=ucc_smartx_selenium_helper,
            ucc_smartx_rest_helper=ucc_smartx_rest_helper,
        )
        proxy.proxy_enable.check()
        proxy.type.select("http")
        proxy.host.set_value("foobar")
        proxy.username.set_value("test")
        proxy.password.set_value("test")
        self.assert_util(
            proxy.save, "Proxy Port can not be empty", left_args={"expect_error": True}
        )

    @pytest.mark.execute_enterprise_cloud_false
    @pytest.mark.forwarder
    @pytest.mark.proxy
    def test_proxy_port_field_numeric_values(
        self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
    ):
        proxy = Proxy(
            C.ADDON_NAME,
            _PROXY_URL,
            ucc_smartx_selenium_helper=ucc_smartx_selenium_helper,
            ucc_smartx_rest_helper=ucc_smartx_rest_helper,
        )
        proxy.host.set_value("foobar")
        proxy.port.set_value("test")
        self.assert_util(
            proxy.save,
            "Field Port is not a number",
            left_args={"expect_error": True},
        )

    @pytest.mark.execute_enterprise_cloud_false
    @pytest.mark.forwarder
    @pytest.mark.proxy
    def test_proxy_port_field_valid_range(
        self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
    ):
        proxy = Proxy(
            C.ADDON_NAME,
            _PROXY_URL,
            ucc_smartx_selenium_helper=ucc_smartx_selenium_helper,
            ucc_smartx_rest_helper=ucc_smartx_rest_helper,
        )
        proxy.host.set_value("foobar")
        proxy.port.set_value("0")
        self.assert_util(
            proxy.save,
            "Field Port should be within the range of [1 and 65535]",
            left_args={"expect_error": True},
        )

    @pytest.mark.execute_enterprise_cloud_false
    @pytest.mark.forwarder
    @pytest.mark.proxy
    def test_proxy_port_field_valid_integer(
        self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
    ):
        proxy = Proxy(
            C.ADDON_NAME,
            _PROXY_URL,
            ucc_smartx_selenium_helper=ucc_smartx_selenium_helper,
            ucc_smartx_rest_helper=ucc_smartx_rest_helper,
        )
        proxy.host.set_value("foobar")
        proxy.port.set_value("10.1")
        self.assert_util(
            proxy.save,
            "Field Port is not a integer",
            left_args={"expect_error": True},
        )

    @pytest.mark.execute_enterprise_cloud_false
    @pytest.mark.forwarder
    @pytest.mark.proxy
    def test_proxy_encrypted_field_password(
        self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
    ):
        proxy = Proxy(
            C.ADDON_NAME,
            _PROXY_URL,
            ucc_smartx_selenium_helper=ucc_smartx_selenium_helper,
            ucc_smartx_rest_helper=ucc_smartx_rest_helper,
        )
        mask_check = proxy.password.encrypted
        if mask_check:
            msg = "Password is masked"
        else:
            msg = "Password is not masked"
        self.assert_util(msg, "Password is masked")
        proxy.proxy_enable.check()
        proxy.type.select("http")
        proxy.host.set_value("foobar")
        proxy.port.set_value("655")
        proxy.username.set_value("test")
        proxy.password.set_value("test")
        assert proxy.save()
        self.assert_util(
            proxy.backend_conf_get.get_stanza().get("proxy_password"), "******"
        )

    @pytest.mark.execute_enterprise_cloud_false
    @pytest.mark.forwarder
    @pytest.mark.proxy
    def test_proxy_username_field_length_validation(
        self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
    ):
        proxy = Proxy(
            C.ADDON_NAME,
            _PROXY_URL,
            ucc_smartx_selenium_helper=ucc_smartx_selenium_helper,
            ucc_smartx_rest_helper=ucc_smartx_rest_helper,
        )
        proxy.host.set_value("foobar")
        proxy.port.set_value("65535")
        proxy.username.set_value("a" * 51)
        self.assert_util(
            proxy.save,
            "Max length of username is 50",
            left_args={"expect_error": True},
        )

    @pytest.mark.execute_enterprise_cloud_false
    @pytest.mark.forwarder
    @pytest.mark.proxy
    def test_proxy_password_field_length_validation(
        self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
    ):
        proxy = Proxy(
            C.ADDON_NAME,
            _PROXY_URL,
            ucc_smartx_selenium_helper=ucc_smartx_selenium_helper,
            ucc_smartx_rest_helper=ucc_smartx_rest_helper,
        )
        proxy.host.set_value("foobar")
        proxy.port.set_value("65535")
        proxy.username.set_value("aaa")
        proxy.password.set_value("a" * 8193)
        self.assert_util(
            proxy.save,
            "Max length of password is 8192",
            left_args={"expect_error": True},
        )

    @pytest.mark.execute_enterprise_cloud_false
    @pytest.mark.forwarder
    @pytest.mark.proxy
    @pytest.mark.sanity_test
    def test_proxy_frontend_backend_validation(
        self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
    ):
        proxy = Proxy(
            C.ADDON_NAME,
            _PROXY_URL,
            ucc_smartx_selenium_helper=ucc_smartx_selenium_helper,
            ucc_smartx_rest_helper=ucc_smartx_rest_helper,
        )
        proxy.proxy_enable.check()
        proxy.type.select("socks4")
        proxy.host.set_value("foobar")
        proxy.port.set_value("655")
        proxy.username.set_value("test")
        proxy.password.set_value("test")
        proxy.dns_enable.check()
        assert proxy.save()
        self.assert_util(
            proxy.backend_conf_get.get_stanza(decrypt=True),
            {
                "disabled": False,
                "proxy_enabled": "1",
                "proxy_port": "655",
                "proxy_rdns": "1",
                "proxy_type": "socks4",
                "proxy_url": "foobar",
                "proxy_password": "test",
                "proxy_username": "test",
            },
        )

    @pytest.mark.execute_enterprise_cloud_false
    @pytest.mark.proxy
    @pytest.mark.forwarder
    def test_proxy_host_valid_input(
        self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
    ):
        """
        Verification of host throwing error msg when containing special characters
        """
        proxy = Proxy(
            C.ADDON_NAME,
            _PROXY_URL,
            ucc_smartx_selenium_helper=ucc_smartx_selenium_helper,
            ucc_smartx_rest_helper=ucc_smartx_rest_helper,
        )
        proxy.host.set_value("abc$$")
        self.assert_util(
            proxy.save,
            "Proxy Host should not have special characters",
            left_args={"expect_error": True},
        )

test_proxy_encrypted_field_password(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)

Source code in tests/ui/test_configuration_page_proxy_tab.py
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
@pytest.mark.execute_enterprise_cloud_false
@pytest.mark.forwarder
@pytest.mark.proxy
def test_proxy_encrypted_field_password(
    self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
):
    proxy = Proxy(
        C.ADDON_NAME,
        _PROXY_URL,
        ucc_smartx_selenium_helper=ucc_smartx_selenium_helper,
        ucc_smartx_rest_helper=ucc_smartx_rest_helper,
    )
    mask_check = proxy.password.encrypted
    if mask_check:
        msg = "Password is masked"
    else:
        msg = "Password is not masked"
    self.assert_util(msg, "Password is masked")
    proxy.proxy_enable.check()
    proxy.type.select("http")
    proxy.host.set_value("foobar")
    proxy.port.set_value("655")
    proxy.username.set_value("test")
    proxy.password.set_value("test")
    assert proxy.save()
    self.assert_util(
        proxy.backend_conf_get.get_stanza().get("proxy_password"), "******"
    )

test_proxy_frontend_backend_validation(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)

Source code in tests/ui/test_configuration_page_proxy_tab.py
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
@pytest.mark.execute_enterprise_cloud_false
@pytest.mark.forwarder
@pytest.mark.proxy
@pytest.mark.sanity_test
def test_proxy_frontend_backend_validation(
    self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
):
    proxy = Proxy(
        C.ADDON_NAME,
        _PROXY_URL,
        ucc_smartx_selenium_helper=ucc_smartx_selenium_helper,
        ucc_smartx_rest_helper=ucc_smartx_rest_helper,
    )
    proxy.proxy_enable.check()
    proxy.type.select("socks4")
    proxy.host.set_value("foobar")
    proxy.port.set_value("655")
    proxy.username.set_value("test")
    proxy.password.set_value("test")
    proxy.dns_enable.check()
    assert proxy.save()
    self.assert_util(
        proxy.backend_conf_get.get_stanza(decrypt=True),
        {
            "disabled": False,
            "proxy_enabled": "1",
            "proxy_port": "655",
            "proxy_rdns": "1",
            "proxy_type": "socks4",
            "proxy_url": "foobar",
            "proxy_password": "test",
            "proxy_username": "test",
        },
    )

test_proxy_host_field_length_validation(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)

Source code in tests/ui/test_configuration_page_proxy_tab.py
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
@pytest.mark.execute_enterprise_cloud_false
@pytest.mark.forwarder
@pytest.mark.proxy
def test_proxy_host_field_length_validation(
    self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
):
    proxy = Proxy(
        C.ADDON_NAME,
        _PROXY_URL,
        ucc_smartx_selenium_helper=ucc_smartx_selenium_helper,
        ucc_smartx_rest_helper=ucc_smartx_rest_helper,
    )
    host_value = "a" * 4097
    proxy.host.set_value(host_value)
    self.assert_util(
        proxy.save,
        "Max host length is 4096",
        left_args={"expect_error": True},
    )

test_proxy_host_valid_input(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)

Verification of host throwing error msg when containing special characters

Source code in tests/ui/test_configuration_page_proxy_tab.py
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
@pytest.mark.execute_enterprise_cloud_false
@pytest.mark.proxy
@pytest.mark.forwarder
def test_proxy_host_valid_input(
    self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
):
    """
    Verification of host throwing error msg when containing special characters
    """
    proxy = Proxy(
        C.ADDON_NAME,
        _PROXY_URL,
        ucc_smartx_selenium_helper=ucc_smartx_selenium_helper,
        ucc_smartx_rest_helper=ucc_smartx_rest_helper,
    )
    proxy.host.set_value("abc$$")
    self.assert_util(
        proxy.save,
        "Proxy Host should not have special characters",
        left_args={"expect_error": True},
    )

test_proxy_misc(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)

Source code in tests/ui/test_configuration_page_proxy_tab.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
@pytest.mark.execute_enterprise_cloud_false
@pytest.mark.forwarder
@pytest.mark.proxy
def test_proxy_misc(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper):
    proxy = Proxy(
        C.ADDON_NAME,
        _PROXY_URL,
        ucc_smartx_selenium_helper=ucc_smartx_selenium_helper,
        ucc_smartx_rest_helper=ucc_smartx_rest_helper,
    )

    # Labels
    self.assert_util(proxy.proxy_enable.get_input_label, "Enable")
    self.assert_util(proxy.type.get_input_label, "Proxy Type")
    self.assert_util(proxy.host.get_input_label, "Host")
    self.assert_util(proxy.port.get_input_label, "Port")
    self.assert_util(proxy.username.get_input_label, "Username")
    self.assert_util(proxy.password.get_input_label, "Password")
    self.assert_util(proxy.dns_enable.get_input_label, "Reverse DNS resolution")

    # Default values
    self.assert_util(proxy.proxy_enable.is_checked(), False)
    self.assert_util(proxy.type.get_value(), "http")
    self.assert_util(proxy.type.list_of_values(), ["http", "socks4", "socks5"])
    self.assert_util(proxy.host.get_value(), "")
    self.assert_util(proxy.port.get_value(), "")
    self.assert_util(proxy.username.get_value(), "")
    self.assert_util(proxy.password.get_value(), "")
    self.assert_util(proxy.dns_enable.is_checked(), False)

test_proxy_password_field_length_validation(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)

Source code in tests/ui/test_configuration_page_proxy_tab.py
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
@pytest.mark.execute_enterprise_cloud_false
@pytest.mark.forwarder
@pytest.mark.proxy
def test_proxy_password_field_length_validation(
    self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
):
    proxy = Proxy(
        C.ADDON_NAME,
        _PROXY_URL,
        ucc_smartx_selenium_helper=ucc_smartx_selenium_helper,
        ucc_smartx_rest_helper=ucc_smartx_rest_helper,
    )
    proxy.host.set_value("foobar")
    proxy.port.set_value("65535")
    proxy.username.set_value("aaa")
    proxy.password.set_value("a" * 8193)
    self.assert_util(
        proxy.save,
        "Max length of password is 8192",
        left_args={"expect_error": True},
    )

test_proxy_port_field_numeric_values(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)

Source code in tests/ui/test_configuration_page_proxy_tab.py
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
@pytest.mark.execute_enterprise_cloud_false
@pytest.mark.forwarder
@pytest.mark.proxy
def test_proxy_port_field_numeric_values(
    self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
):
    proxy = Proxy(
        C.ADDON_NAME,
        _PROXY_URL,
        ucc_smartx_selenium_helper=ucc_smartx_selenium_helper,
        ucc_smartx_rest_helper=ucc_smartx_rest_helper,
    )
    proxy.host.set_value("foobar")
    proxy.port.set_value("test")
    self.assert_util(
        proxy.save,
        "Field Port is not a number",
        left_args={"expect_error": True},
    )

test_proxy_port_field_valid_integer(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)

Source code in tests/ui/test_configuration_page_proxy_tab.py
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
@pytest.mark.execute_enterprise_cloud_false
@pytest.mark.forwarder
@pytest.mark.proxy
def test_proxy_port_field_valid_integer(
    self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
):
    proxy = Proxy(
        C.ADDON_NAME,
        _PROXY_URL,
        ucc_smartx_selenium_helper=ucc_smartx_selenium_helper,
        ucc_smartx_rest_helper=ucc_smartx_rest_helper,
    )
    proxy.host.set_value("foobar")
    proxy.port.set_value("10.1")
    self.assert_util(
        proxy.save,
        "Field Port is not a integer",
        left_args={"expect_error": True},
    )

test_proxy_port_field_valid_range(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)

Source code in tests/ui/test_configuration_page_proxy_tab.py
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
@pytest.mark.execute_enterprise_cloud_false
@pytest.mark.forwarder
@pytest.mark.proxy
def test_proxy_port_field_valid_range(
    self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
):
    proxy = Proxy(
        C.ADDON_NAME,
        _PROXY_URL,
        ucc_smartx_selenium_helper=ucc_smartx_selenium_helper,
        ucc_smartx_rest_helper=ucc_smartx_rest_helper,
    )
    proxy.host.set_value("foobar")
    proxy.port.set_value("0")
    self.assert_util(
        proxy.save,
        "Field Port should be within the range of [1 and 65535]",
        left_args={"expect_error": True},
    )

test_proxy_required_field_host(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)

Source code in tests/ui/test_configuration_page_proxy_tab.py
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
@pytest.mark.execute_enterprise_cloud_false
@pytest.mark.forwarder
@pytest.mark.proxy
def test_proxy_required_field_host(
    self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
):
    # Tests proxy.options.saveValidator
    proxy = Proxy(
        C.ADDON_NAME,
        _PROXY_URL,
        ucc_smartx_selenium_helper=ucc_smartx_selenium_helper,
        ucc_smartx_rest_helper=ucc_smartx_rest_helper,
    )
    proxy.proxy_enable.check()
    proxy.type.select("http")
    proxy.port.set_value("655")
    proxy.username.set_value("test")
    proxy.password.set_value("test")
    self.assert_util(
        proxy.save, "Proxy Host can not be empty", left_args={"expect_error": True}
    )
    proxy.host.set_value("closeerror")
    self.assert_util(proxy.is_error_closed, True)

test_proxy_required_field_port(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)

Source code in tests/ui/test_configuration_page_proxy_tab.py
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
@pytest.mark.execute_enterprise_cloud_false
@pytest.mark.forwarder
@pytest.mark.proxy
def test_proxy_required_field_port(
    self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
):
    # Tests proxy.options.saveValidator
    proxy = Proxy(
        C.ADDON_NAME,
        _PROXY_URL,
        ucc_smartx_selenium_helper=ucc_smartx_selenium_helper,
        ucc_smartx_rest_helper=ucc_smartx_rest_helper,
    )
    proxy.proxy_enable.check()
    proxy.type.select("http")
    proxy.host.set_value("foobar")
    proxy.username.set_value("test")
    proxy.password.set_value("test")
    self.assert_util(
        proxy.save, "Proxy Port can not be empty", left_args={"expect_error": True}
    )

test_proxy_username_field_length_validation(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)

Source code in tests/ui/test_configuration_page_proxy_tab.py
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
@pytest.mark.execute_enterprise_cloud_false
@pytest.mark.forwarder
@pytest.mark.proxy
def test_proxy_username_field_length_validation(
    self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
):
    proxy = Proxy(
        C.ADDON_NAME,
        _PROXY_URL,
        ucc_smartx_selenium_helper=ucc_smartx_selenium_helper,
        ucc_smartx_rest_helper=ucc_smartx_rest_helper,
    )
    proxy.host.set_value("foobar")
    proxy.port.set_value("65535")
    proxy.username.set_value("a" * 51)
    self.assert_util(
        proxy.save,
        "Max length of username is 50",
        left_args={"expect_error": True},
    )