Browse Source

Merge branch 'main' into javascript

Falko Schindler 2 years ago
parent
commit
ce6930c36a
2 changed files with 5 additions and 6 deletions
  1. 4 5
      tests/test_3d_scene.py
  2. 1 1
      tests/test_pages.py

+ 4 - 5
tests/test_3d_scene.py

@@ -6,15 +6,15 @@ from .screen import Screen
 
 
 def test_moving_sphere_with_timer(screen: Screen):
 def test_moving_sphere_with_timer(screen: Screen):
     with ui.scene() as scene:
     with ui.scene() as scene:
-        sphere = scene.sphere().move(0, -5, 2)
-        ui.timer(0.03, lambda: sphere.move(sphere.x, sphere.y + 0.05, sphere.z))
+        sphere = scene.sphere()
+        ui.timer(0.03, lambda: sphere.move(0, 0, sphere.z + 0.01))
 
 
     screen.open('/')
     screen.open('/')
 
 
     def position() -> None:
     def position() -> None:
         for _ in range(20):
         for _ in range(20):
             try:
             try:
-                pos = screen.selenium.execute_script('return scene.children[4].position.y')
+                pos = screen.selenium.execute_script('return scene.children[4].position.z')
                 if pos is not None:
                 if pos is not None:
                     return pos
                     return pos
             except JavascriptException:
             except JavascriptException:
@@ -22,6 +22,5 @@ def test_moving_sphere_with_timer(screen: Screen):
             screen.wait(0.1)
             screen.wait(0.1)
         raise Exception('Could not get position')
         raise Exception('Could not get position')
 
 
-    pos = position()
     screen.wait(0.2)
     screen.wait(0.2)
-    assert position() > pos
+    assert position() > 0

+ 1 - 1
tests/test_pages.py

@@ -213,7 +213,7 @@ def test_pageready_after_yield_on_non_async_page(screen: Screen):
 
 
     screen.open('/')
     screen.open('/')
     timing = screen.find('loading page took')
     timing = screen.find('loading page took')
-    assert 0 < float(timing.text.split()[-2]) < 1
+    assert 0 < float(timing.text.split()[-2]) < 3
 
 
 
 
 def test_pageready_after_yield_on_shared_page_raises_exception(screen: Screen):
 def test_pageready_after_yield_on_shared_page_raises_exception(screen: Screen):