-
Notifications
You must be signed in to change notification settings - Fork 1.3k
/
Copy pathmulti_uc.py
24 lines (22 loc) · 1018 Bytes
/
multi_uc.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
"""Part of the UC presentation"""
import pytest
from random import randint
from seleniumbase import BaseCase
BaseCase.main(__name__, __file__, "--uc", "-n3")
@pytest.mark.parametrize("", [[]] * 3)
def test_multi_threaded(sb):
url = "https://gitlab.com/users/sign_in"
sb.driver.uc_open_with_reconnect(url, 3)
sb.set_window_rect(randint(0, 755), randint(38, 403), 700, 500)
try:
sb.assert_text("Username", '[for="user_login"]', timeout=3)
sb.post_message("SeleniumBase wasn't detected", duration=4)
sb._print("\n Success! Website did not detect Selenium! ")
except Exception:
sb.driver.uc_open_with_reconnect(url, 3)
try:
sb.assert_text("Username", '[for="user_login"]', timeout=3)
sb.post_message("SeleniumBase wasn't detected", duration=4)
sb._print("\n Success! Website did not detect Selenium! ")
except Exception:
sb.fail('Selenium was detected! Try using: "pytest --uc"')