Commit a64427ea authored by Thomas Dowrick's avatar Thomas Dowrick
Browse files

Disable UI test

parent ae4726a0
Pipeline #1434 failed with stage
in 10 minutes and 41 seconds
import pytest
from sksurgeryardavinci.widgets import Viewers
from sksurgeryvtk.models.vtk_surface_model_directory_loader \
import VTKSurfaceModelDirectoryLoader
@pytest.fixture()
def mono_viewer(qtbot):
mono_viewer = Viewers.MonoViewer('tests/data/test_video.avi')
qtbot.addWidget(mono_viewer)
vtk_model_path = 'inputs/Liver'
vtk_model_loader = VTKSurfaceModelDirectoryLoader(vtk_model_path)
mono_viewer.add_VTK_models(vtk_model_loader.models)
mono_viewer.start()
return mono_viewer
def test_opacity_slider_for_correct_opacity(qtbot):
mono_viewer = Viewers.MonoViewer('tests/data/test_video.avi')
qtbot.addWidget(mono_viewer)
vtk_model_path = 'inputs/Liver'
vtk_model_loader = VTKSurfaceModelDirectoryLoader(vtk_model_path)
mono_viewer.add_VTK_models(vtk_model_loader.models)
mono_viewer.start()
mono_viewer.UI.opacity_slider.setSliderPosition(50)
for vtk_model in mono_viewer.UI.vtk_models:
assert vtk_model.actor.GetProperty().GetOpacity() == 0.5
mono_viewer.UI.opacity_slider.setSliderPosition(0)
for vtk_model in mono_viewer.UI.vtk_models:
assert vtk_model.actor.GetProperty().GetOpacity() == 0
mono_viewer.UI.opacity_slider.setSliderPosition(100)
for vtk_model in mono_viewer.UI.vtk_models:
assert vtk_model.actor.GetProperty().GetOpacity() == 1
def test_opacity_slider_for_incorrect_opacity(qtbot):
mono_viewer = Viewers.MonoViewer('tests/data/test_video.avi')
qtbot.addWidget(mono_viewer)
vtk_model_path = 'inputs/Liver'
vtk_model_loader = VTKSurfaceModelDirectoryLoader(vtk_model_path)
mono_viewer.add_VTK_models(vtk_model_loader.models)
mono_viewer.start()
mono_viewer.UI.opacity_slider.setSliderPosition(0)
for vtk_model in mono_viewer.UI.vtk_models:
assert vtk_model.actor.GetProperty().GetOpacity() != 0.5
def test_model_visibilty_toggle(mono_viewer):
for vtk_model in mono_viewer.UI.vtk_models:
vtk_model.toggle_visibility()
assert vtk_model.actor.GetVisibility() == 0
vtk_model.toggle_visibility()
assert vtk_model.actor.GetVisibility() == 1
\ No newline at end of file
......@@ -23,7 +23,6 @@ def test_mock_stereo_cameras_are_synced(qtbot):
mock_stereo.start()
left_cam = mock_stereo.left_overlay.get_foreground_camera()
right_cam = mock_stereo.right_overlay.get_foreground_camera()
ui_cam = mock_stereo.ui_overlay.get_foreground_camera()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment