Skip to content

Commit

Permalink
fix(vue-vtk-js): Update vtk.js
Browse files Browse the repository at this point in the history
  • Loading branch information
jourdain committed Jun 16, 2023
1 parent 46e3d6d commit 96e569a
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test_and_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:
pip install -r tests/requirements.txt
# Run the tests with coverage so we get a coverage report too
pip install coverage
coverage run --source . -m pytest .
coverage run --source . -m pytest . --browser=firefox
# Print the coverage report
coverage report -m
Expand All @@ -83,7 +83,7 @@ jobs:
- name: Install trame-vtk.js
run: |
mkdir -p ./trame_vtk/modules/common/serve
curl https://unpkg.com/vue-vtk-js@3.1.5 -Lo ./trame_vtk/modules/common/serve/trame-vtk.js
curl https://unpkg.com/vue-vtk-js@3.1.6 -Lo ./trame_vtk/modules/common/serve/trame-vtk.js
- name: Python Semantic Release
uses: relekang/python-semantic-release@master
Expand Down
5 changes: 4 additions & 1 deletion examples/validation/PyVistaDynaLUT.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,12 @@
from pyvista import examples
from pyvista.trame.ui import plotter_ui

# Just for using this script in testing
from trame_client.utils.testing import enable_testing

pv.OFF_SCREEN = True

server = get_server()
server = enable_testing(get_server())
state, ctrl = server.state, server.controller

state.trame__title = "PyVista UI Template"
Expand Down
5 changes: 4 additions & 1 deletion examples/validation/PyVistaLookupTable.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
from trame.ui.vuetify import SinglePageLayout
from trame.widgets import vuetify, vtk as vtk_widgets

server = get_server()
# Just for using this script in testing
from trame_client.utils.testing import enable_testing

server = enable_testing(get_server())
state, ctrl = server.state, server.controller

state.trame__title = "PyVista Lookup Table N Colors"
Expand Down
25 changes: 25 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import pytest
from pathlib import Path
from trame_client.utils.testing import FixtureHelper

ROOT_PATH = Path(__file__).parent.parent.absolute()
HELPER = FixtureHelper(ROOT_PATH)


@pytest.fixture()
def baseline_image():
HELPER.remove_page_urls()
yield
HELPER.remove_page_urls()


@pytest.fixture
def server(xprocess, server_path):
name, Starter, Monitor = HELPER.get_xprocess_args(server_path)

# ensure process is running and return its logfile
logfile = xprocess.ensure(name, Starter)
yield Monitor(logfile[1])

# clean up whole process tree afterwards
xprocess.getinfo(name).terminate()
5 changes: 5 additions & 0 deletions tests/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
pytest
seleniumbase
pytest-xprocess
trame
pyvista
trame-client>=2.9.2
11 changes: 11 additions & 0 deletions tests/test_remote_rendering.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import pytest
from seleniumbase import SB


@pytest.mark.parametrize("server_path", ["examples/validation/PyVistaLookupTable.py"])
def test_reactivity(server, baseline_image):
with SB() as sb:
url = f"http://localhost:{server.port}/"
sb.open(url)
sb.sleep(1) # Wait for geometry to arrive
sb.check_window(name="init", level=3)

0 comments on commit 96e569a

Please sign in to comment.