Skip to content

Commit d405a39

Browse files
committed
service version works for s4l and jupyterlab
1 parent e21caa0 commit d405a39

File tree

4 files changed

+20
-9
lines changed

4 files changed

+20
-9
lines changed

tests/e2e-playwright/Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,12 @@ $(SLEEPERS_INPUT_FILE) $(JUPYTER_LAB_INPUT_FILE) $(CLASSIC_TIP_INPUT_FILE) $(S4L
161161
if [ "$@" = "$(JUPYTER_LAB_INPUT_FILE)" ]; then \
162162
read -p "Enter the size of the large file (human readable form e.g. 3Gib): " LARGE_FILE_SIZE; \
163163
echo "--service-key=jupyter-math --large-file-size=$$LARGE_FILE_SIZE" >> $@; \
164+
read -p "Enter the service version (default to latest): " SERVICE_VERSION; \
165+
if [ -z "$$SERVICE_VERSION" ]; then \
166+
echo "No service version specified, using default."; \
167+
else \
168+
echo "--service-version=$$SERVICE_VERSION" >> $@; \
169+
fi; \
164170
elif [ "$@" = "$(S4L_INPUT_FILE)" ]; then \
165171
read -p "Do you want to check the videostreaming ? (requires to run with chrome/msedge) [y/n]: " VIDEOSTREAM; \
166172
if [ "$$VIDEOSTREAM" = "y" ]; then \

tests/e2e-playwright/tests/conftest.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -456,9 +456,14 @@ def _open_with_resources(page: Page, *, click_it: bool):
456456
def _select_service_version(page: Page, *, version: str) -> None:
457457
try:
458458
# since https://github.com/ITISFoundation/osparc-simcore/pull/7060
459-
page.get_by_test_id("serviceSelectBox").select_option(
460-
f"serviceVersionItem_{version}"
461-
)
459+
with log_context(logging.INFO, msg=f"selecting version {version}"):
460+
page.get_by_test_id("serviceSelectBox").click(timeout=5 * SECOND)
461+
with page.expect_response(
462+
re.compile(r"/catalog/services/.+/resources"), timeout=1.5 * 5 * SECOND
463+
):
464+
page.get_by_test_id(f"serviceVersionItem_{version}").click(
465+
timeout=5 * SECOND
466+
)
462467
except TimeoutError:
463468
# we try the non robust way
464469
page.get_by_label("Version").select_option(version)
@@ -480,8 +485,7 @@ def create_new_project_and_delete(
480485
created_project_uuids = []
481486

482487
def _(
483-
expected_states: tuple[RunningState] = (RunningState.NOT_STARTED,),
484-
*,
488+
expected_states: tuple[RunningState],
485489
press_open: bool,
486490
template_id: str | None,
487491
service_version: str | None,
@@ -509,8 +513,6 @@ def _(
509513
):
510514
open_with_resources_clicked = False
511515
# Project detail view pop-ups shows
512-
if service_version is not None:
513-
_select_service_version(page, version=service_version)
514516
if press_open:
515517
open_button = page.get_by_test_id("openResource")
516518
if template_id is not None:
@@ -559,6 +561,8 @@ def wait_for_done(response):
559561
# not expected in the sim4life context though
560562
...
561563
else:
564+
if service_version is not None:
565+
_select_service_version(page, version=service_version)
562566
open_button.click()
563567
if is_product_billable:
564568
_open_with_resources(page, click_it=True)

tests/e2e-playwright/tests/jupyterlabs/test_jupyterlab.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ def test_jupyterlab(
6767
[ServiceType, str, str | None, str | None], dict[str, Any]
6868
],
6969
service_key: str,
70+
service_version: str | None,
7071
large_file_size: ByteSize,
7172
large_file_block_size: ByteSize,
7273
product_url: AnyUrl,
@@ -86,7 +87,7 @@ def test_jupyterlab(
8687
),
8788
):
8889
project_data = create_project_from_service_dashboard(
89-
ServiceType.DYNAMIC, service_key, None, None
90+
ServiceType.DYNAMIC, service_key, None, service_version
9091
)
9192
assert "workbench" in project_data, "Expected workbench to be in project data!"
9293
assert isinstance(

tests/e2e-playwright/tests/tip/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,6 @@ def create_tip_plan_from_dashboard(
3333
def _(plan_name_test_id: str) -> dict[str, Any]:
3434
find_and_start_tip_plan_in_dashboard(plan_name_test_id)
3535
expected_states = (RunningState.UNKNOWN,)
36-
return create_new_project_and_delete(expected_states, False, None)
36+
return create_new_project_and_delete(expected_states, False, None, None)
3737

3838
return _

0 commit comments

Comments
 (0)