Skip to content

Fix option for enabling 3D APIs #2452

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jan 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions examples/test_3d_apis.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from seleniumbase import BaseCase
BaseCase.main(__name__, __file__)


class ThreeJSTests(BaseCase):
def test_animation(self):
if self.headless:
self.open_if_not_url("about:blank")
self.skip("Skip this test in headless mode!")
if self.is_chromium() and not self.enable_3d_apis:
self.get_new_driver(enable_3d_apis=True) # --enable-3d-apis
url = "https://threejs.org/examples/#webgl_animation_skinning_morph"
self.open(url)
self.switch_to_frame("iframe#viewer")
self.sleep(0.8)
self.click('button:contains("Wave")')
self.sleep(3)
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ filelock>=3.12.2;python_version<"3.8"
filelock>=3.13.1;python_version>="3.8"
platformdirs>=4.0.0;python_version<"3.8"
platformdirs>=4.1.0;python_version>="3.8"
typing-extensions>=4.9.0;python_version>="3.8"
parse>=1.20.0
parse-type>=0.6.2
pyyaml>=6.0.1
Expand Down
2 changes: 1 addition & 1 deletion seleniumbase/__version__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# seleniumbase package
__version__ = "4.23.0"
__version__ = "4.23.1"
10 changes: 8 additions & 2 deletions seleniumbase/core/browser_launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -1030,7 +1030,10 @@ def _set_chrome_options(
if swiftshader:
chrome_options.add_argument("--use-gl=angle")
chrome_options.add_argument("--use-angle=swiftshader-webgl")
elif not is_using_uc(undetectable, browser_name):
elif (
not is_using_uc(undetectable, browser_name)
and not enable_3d_apis
):
chrome_options.add_argument("--disable-gpu")
if not IS_LINUX and is_using_uc(undetectable, browser_name):
chrome_options.add_argument("--disable-dev-shm-usage")
Expand Down Expand Up @@ -2698,7 +2701,10 @@ def get_local_driver(
if swiftshader:
edge_options.add_argument("--use-gl=angle")
edge_options.add_argument("--use-angle=swiftshader-webgl")
else:
elif (
not is_using_uc(undetectable, browser_name)
and not enable_3d_apis
):
edge_options.add_argument("--disable-gpu")
if IS_LINUX:
edge_options.add_argument("--disable-dev-shm-usage")
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@
'filelock>=3.13.1;python_version>="3.8"',
'platformdirs>=4.0.0;python_version<"3.8"',
'platformdirs>=4.1.0;python_version>="3.8"',
'typing-extensions>=4.9.0;python_version>="3.8"',
'parse>=1.20.0',
'parse-type>=0.6.2',
'pyyaml>=6.0.1',
Expand Down Expand Up @@ -233,7 +234,7 @@
'pdfminer.six==20221105;python_version<"3.8"',
'pdfminer.six==20231228;python_version>="3.8"',
'cryptography==39.0.2;python_version<"3.9"',
'cryptography==42.0.0;python_version>="3.9"',
'cryptography==42.0.1;python_version>="3.9"',
'cffi==1.15.1;python_version<"3.8"',
'cffi==1.16.0;python_version>="3.8"',
"pycparser==2.21",
Expand Down