-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Expand file tree
/
Copy pathraw_mobile_gitlab.py
More file actions
24 lines (23 loc) · 798 Bytes
/
raw_mobile_gitlab.py
File metadata and controls
24 lines (23 loc) · 798 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import mycdp
from seleniumbase import SB
with SB(uc=True, test=True) as sb:
url = "https://gitlab.com/users/sign_in"
sb.activate_cdp_mode()
tab = sb.cdp.get_active_tab()
loop = sb.cdp.get_event_loop()
loop.run_until_complete(
tab.send(
mycdp.emulation.set_device_metrics_override(
width=412, height=732, device_scale_factor=3, mobile=True
)
)
)
sb.open(url)
sb.sleep(2)
sb.solve_captcha()
# (The rest is for testing and demo purposes)
sb.assert_text("Username", '[for="user_login"]', timeout=3)
sb.assert_element('label[for="user_login"]')
sb.highlight('button:contains("Sign in")')
sb.highlight('h1:contains("GitLab")')
sb.post_message("SeleniumBase wasn't detected", duration=4)