Skip to content

Commit 8702f4f

Browse files
committed
updates tests
1 parent 0a47b9f commit 8702f4f

File tree

1 file changed

+65
-42
lines changed

1 file changed

+65
-42
lines changed

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

Lines changed: 65 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
from typing import Any, Final
1515

1616
from playwright.sync_api import Page, WebSocket
17-
from pytest_simcore.helpers.logging_tools import log_context, test_logger
17+
from pytest_simcore.helpers.logging_tools import log_context
1818
from pytest_simcore.helpers.playwright import (
1919
MINUTE,
2020
SECOND,
@@ -93,6 +93,9 @@ def test_classic_ti_plan( # noqa: PLR0915
9393
is_autoscaled: bool,
9494
is_product_lite: bool,
9595
):
96+
97+
# TODO: check TIP upgrade
98+
9699
project_data = create_tip_plan_from_dashboard("newTIPlanButton")
97100
assert "workbench" in project_data, "Expected workbench to be in project data!"
98101
assert isinstance(
@@ -204,49 +207,69 @@ def test_classic_ti_plan( # noqa: PLR0915
204207
)
205208

206209
with log_context(logging.INFO, "Create report"):
207-
ti_iframe.get_by_role("button", name="Load Analysis").click()
208-
page.wait_for_timeout(_JLAB_REPORTING_MAX_TIME)
209-
ti_iframe.get_by_role("button", name="Load").nth(1).click()
210-
page.wait_for_timeout(_JLAB_REPORTING_MAX_TIME)
211-
ti_iframe.get_by_role("button", name="Add to Report (0)").nth(0).click()
212-
page.wait_for_timeout(_JLAB_REPORTING_MAX_TIME)
213-
ti_iframe.get_by_role("button", name="Export to S4L").click()
214-
page.wait_for_timeout(_JLAB_REPORTING_MAX_TIME)
215-
ti_iframe.get_by_role("button", name="Add to Report (1)").nth(1).click()
216-
page.wait_for_timeout(_JLAB_REPORTING_MAX_TIME)
217-
ti_iframe.get_by_role("button", name="Export Report").click()
218-
page.wait_for_timeout(_JLAB_REPORTING_MAX_TIME)
210+
if is_product_lite:
211+
# NOTE: buttons should be disabled
212+
assert not ti_iframe.get_by_role(
213+
"button", name="Load Analysis"
214+
).is_enabled()
215+
assert (
216+
not ti_iframe.get_by_role("button", name="Load").nth(1).is_enabled()
217+
)
218+
assert not ti_iframe.get_by_role(
219+
"button", name="Export to S4L"
220+
).is_enabled()
221+
assert not ti_iframe.get_by_role(
222+
"button", name="Export Report"
223+
).is_enabled()
224+
225+
else:
226+
ti_iframe.get_by_role("button", name="Load Analysis").click()
227+
page.wait_for_timeout(_JLAB_REPORTING_MAX_TIME)
228+
ti_iframe.get_by_role("button", name="Load").nth(1).click()
229+
page.wait_for_timeout(_JLAB_REPORTING_MAX_TIME)
230+
ti_iframe.get_by_role("button", name="Add to Report (0)").nth(0).click()
231+
page.wait_for_timeout(_JLAB_REPORTING_MAX_TIME)
232+
ti_iframe.get_by_role("button", name="Export to S4L").click()
233+
page.wait_for_timeout(_JLAB_REPORTING_MAX_TIME)
234+
ti_iframe.get_by_role("button", name="Add to Report (1)").nth(1).click()
235+
page.wait_for_timeout(_JLAB_REPORTING_MAX_TIME)
236+
ti_iframe.get_by_role("button", name="Export Report").click()
237+
page.wait_for_timeout(_JLAB_REPORTING_MAX_TIME)
219238

220239
with log_context(logging.INFO, "Check outputs"):
221-
expected_outputs = ["output_1.zip", "TIP_report.pdf", "results.csv"]
222-
text_on_output_button = f"Outputs ({len(expected_outputs)})"
223-
page.get_by_test_id("outputsBtn").get_by_text(text_on_output_button).click()
240+
if is_product_lite:
241+
pass
242+
else:
243+
expected_outputs = ["output_1.zip", "TIP_report.pdf", "results.csv"]
244+
text_on_output_button = f"Outputs ({len(expected_outputs)})"
245+
page.get_by_test_id("outputsBtn").get_by_text(
246+
text_on_output_button
247+
).click()
224248

225249
if is_product_lite:
226-
test_logger.info(
227-
"Skipping the rest of the test since it is intended for the full version"
228-
)
229-
return
250+
assert expected_number_of_steps == 2
251+
else:
252+
with log_context(logging.INFO, "Exposure Analysis step (3)"):
253+
with expected_service_running(
254+
page=page,
255+
node_id=node_ids[2],
256+
websocket=log_in_and_out,
257+
timeout=(
258+
_POST_PRO_AUTOSCALED_MAX_STARTUP_TIME
259+
if is_autoscaled
260+
else _POST_PRO_MAX_STARTUP_TIME
261+
),
262+
press_start_button=False,
263+
) as service_running:
264+
app_mode_trigger_next_app(page)
265+
s4l_postpro_iframe = service_running.iframe_locator
266+
assert s4l_postpro_iframe
230267

231-
with log_context(logging.INFO, "Exposure Analysis step (3)"):
232-
with expected_service_running(
233-
page=page,
234-
node_id=node_ids[2],
235-
websocket=log_in_and_out,
236-
timeout=(
237-
_POST_PRO_AUTOSCALED_MAX_STARTUP_TIME
238-
if is_autoscaled
239-
else _POST_PRO_MAX_STARTUP_TIME
240-
),
241-
press_start_button=False,
242-
) as service_running:
243-
app_mode_trigger_next_app(page)
244-
s4l_postpro_iframe = service_running.iframe_locator
245-
assert s4l_postpro_iframe
246-
247-
with log_context(logging.INFO, "Post process"):
248-
# click on the postpro mode button
249-
s4l_postpro_iframe.get_by_test_id("mode-button-postro").click()
250-
# click on the surface viewer
251-
s4l_postpro_iframe.get_by_test_id("tree-item-ti_field.cache").click()
252-
s4l_postpro_iframe.get_by_test_id("tree-item-SurfaceViewer").nth(0).click()
268+
with log_context(logging.INFO, "Post process"):
269+
# click on the postpro mode button
270+
s4l_postpro_iframe.get_by_test_id("mode-button-postro").click()
271+
# click on the surface viewer
272+
s4l_postpro_iframe.get_by_test_id("tree-item-ti_field.cache").click()
273+
s4l_postpro_iframe.get_by_test_id("tree-item-SurfaceViewer").nth(
274+
0
275+
).click()

0 commit comments

Comments
 (0)