Forráskód Böngészése

fix local pytests for `ui.scene` (fixes #643)

Falko Schindler 1 éve
szülő
commit
05512678ad
2 módosított fájl, 6 hozzáadás és 2 törlés
  1. 5 1
      tests/conftest.py
  2. 1 1
      tests/test_scene.py

+ 5 - 1
tests/conftest.py

@@ -28,7 +28,11 @@ def chrome_options(chrome_options: webdriver.ChromeOptions) -> webdriver.ChromeO
     chrome_options.add_argument('disable-dev-shm-using')
     chrome_options.add_argument('no-sandbox')
     chrome_options.add_argument('headless')
-    chrome_options.add_argument('disable-gpu')
+    # check if we are running on GitHub Actions
+    if 'GITHUB_ACTIONS' in os.environ:
+        chrome_options.add_argument('disable-gpu')
+    else:
+        chrome_options.add_argument('--use-gl=angle')
     chrome_options.add_argument('window-size=600x600')
     chrome_options.add_experimental_option('prefs', {
         "download.default_directory": str(DOWNLOAD_DIR),

+ 1 - 1
tests/test_scene.py

@@ -14,7 +14,7 @@ def test_moving_sphere_with_timer(screen: Screen):
 
     screen.open('/')
 
-    def position() -> None:
+    def position() -> float:
         for _ in range(3):
             try:
                 pos = screen.selenium.execute_script(f'return scene_c{scene.id}.getObjectByName("sphere").position.z')