Ver código fonte

use more robust scene ID for tests #218

Falko Schindler 2 anos atrás
pai
commit
3110930bf8
1 arquivos alterados com 2 adições e 2 exclusões
  1. 2 2
      tests/test_scene.py

+ 2 - 2
tests/test_scene.py

@@ -15,7 +15,7 @@ def test_moving_sphere_with_timer(screen: Screen):
     def position() -> None:
         for _ in range(3):
             try:
-                pos = screen.selenium.execute_script('return scene_3.getObjectByName("sphere").position.z')
+                pos = screen.selenium.execute_script(f'return scene_{scene.id}.getObjectByName("sphere").position.z')
                 if pos is not None:
                     return pos
             except JavascriptException as e:
@@ -38,4 +38,4 @@ def test_no_object_duplication_on_index_client(screen: Screen):
     screen.open('/')
     screen.switch_to(0)
     screen.wait(0.2)
-    assert screen.selenium.execute_script('return scene_3.children.length') == 5
+    assert screen.selenium.execute_script(f'return scene_{scene.id}.children.length') == 5