Skip to content

Commit 0b77e4a

Browse files
committed
FIX: Implement headless chrome and refactoring test
1 parent 54a8aaf commit 0b77e4a

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

botcity/web/browsers/undetected_chrome.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,10 @@ def default_options(headless=False, download_folder_path=None, user_data_dir=Non
5555

5656
chrome_options.add_argument("--disable-blink-features=AutomationControlled")
5757

58-
# Disable banner for Browser being remote-controlled
59-
# chrome_options.add_experimental_option("excludeSwitches", ["enable-automation"])
60-
# chrome_options.add_experimental_option('useAutomationExtension', False)
61-
6258
if headless:
6359
chrome_options.add_argument('--headless')
6460
chrome_options.add_argument('--headless=new')
61+
chrome_options.add_argument('--headless=chrome')
6562
chrome_options.add_argument("--disable-gpu")
6663
chrome_options.add_argument("--hide-scrollbars")
6764
chrome_options.add_argument("--mute-audio")

tests/test_browser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def test_display_size(web: WebBot):
4343
web.set_screen_resolution(1280, 720)
4444
(w, h) = web.display_size()
4545

46-
assert w == 1280 or w == 1233 or w == 1223 or w == 1028
46+
assert w in [1280, 1233, 1223, 1028]
4747

4848

4949
def test_javascript(web: WebBot):

0 commit comments

Comments
 (0)