Skip to content

Commit 3d604bc

Browse files
committed
add required flags and delete tempdir
1 parent 433bec7 commit 3d604bc

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

py/test/selenium/webdriver/common/bidi_webextension_tests.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717

1818
import base64
1919
import os
20+
import shutil
21+
import tempfile
2022

2123
import pytest
2224
from python.runfiles import Runfiles
@@ -133,14 +135,23 @@ def chromium_driver(self, chromium_options, request):
133135
elif driver_option == "edge":
134136
browser_class = webdriver.Edge
135137

138+
temp_dir = tempfile.mkdtemp(prefix="chrome-profile-")
139+
136140
chromium_options.enable_bidi = True
137141
chromium_options.enable_webextensions = True
142+
chromium_options.add_argument(f"--user-data-dir={temp_dir}")
143+
chromium_options.add_argument("--no-sandbox")
144+
chromium_options.add_argument("--disable-dev-shm-usage")
138145

139146
chromium_driver = browser_class(options=chromium_options)
140147

141148
yield chromium_driver
142149
chromium_driver.quit()
143150

151+
# delete the temp directory
152+
if os.path.exists(temp_dir):
153+
shutil.rmtree(temp_dir)
154+
144155
def test_install_extension_path(self, chromium_driver, pages_chromium):
145156
"""Test installing an extension from a directory path."""
146157
path = os.path.join(extensions, EXTENSION_PATH)

0 commit comments

Comments
 (0)