Skip to content

Commit d7d226e

Browse files
committed
press escape
1 parent 0710eda commit d7d226e

File tree

1 file changed

+33
-30
lines changed

1 file changed

+33
-30
lines changed

tests/e2e-playwright/tests/metamodeling/test_response_surface_modeling.py

Lines changed: 33 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
MINUTE,
1313
RobustWebSocket,
1414
ServiceType,
15+
wait_for_service_running,
1516
)
1617

1718
_WAITING_FOR_SERVICE_TO_START: Final[int] = 5 * MINUTE
@@ -61,7 +62,7 @@ def _create_function_from_project(
6162
"Created function: %s", f"{json.dumps(function_data['data'], indent=2)}"
6263
)
6364

64-
page.click("body") # to close any dialog
65+
page.keyboard.press("Escape")
6566
created_function_uuids.append(function_data["data"]["uuid"])
6667
return function_data["data"]
6768

@@ -170,35 +171,37 @@ def test_response_surface_modeling(
170171

171172
# 3. start a RSM with that function
172173

173-
# with log_context(
174-
# logging.INFO,
175-
# f"Waiting for {service_key} to be responsive (waiting for {_DEFAULT_RESPONSE_TO_WAIT_FOR})",
176-
# ):
177-
# project_data = create_project_from_service_dashboard(
178-
# ServiceType.DYNAMIC, service_key, None, service_version
179-
# )
180-
# assert "workbench" in project_data, "Expected workbench to be in project data!"
181-
# assert isinstance(project_data["workbench"], dict), (
182-
# "Expected workbench to be a dict!"
183-
# )
184-
# node_ids: list[str] = list(project_data["workbench"])
185-
# assert len(node_ids) == 1, "Expected 1 node in the workbench!"
186-
187-
# wait_for_service_running(
188-
# page=page,
189-
# node_id=node_ids[0],
190-
# websocket=log_in_and_out,
191-
# timeout=_WAITING_FOR_SERVICE_TO_START,
192-
# press_start_button=False,
193-
# product_url=product_url,
194-
# is_service_legacy=is_service_legacy,
195-
# )
196-
197-
# service_iframe = page.frame_locator("iframe")
198-
# with log_context(logging.INFO, "Waiting for the RSM to be ready..."):
199-
# service_iframe.get_by_role("grid").wait_for(
200-
# state="visible", timeout=_WAITING_FOR_SERVICE_TO_APPEAR
201-
# )
174+
with log_context(
175+
logging.INFO,
176+
f"Waiting for {service_key} to be responsive (waiting for {_DEFAULT_RESPONSE_TO_WAIT_FOR})",
177+
):
178+
project_data = create_project_from_service_dashboard(
179+
ServiceType.DYNAMIC, service_key, None, service_version
180+
)
181+
assert "workbench" in project_data, "Expected workbench to be in project data!"
182+
assert isinstance(
183+
project_data["workbench"], dict
184+
), "Expected workbench to be a dict!"
185+
node_ids: list[str] = list(project_data["workbench"])
186+
assert len(node_ids) == 1, "Expected 1 node in the workbench!"
187+
188+
wait_for_service_running(
189+
page=page,
190+
node_id=node_ids[0],
191+
websocket=log_in_and_out,
192+
timeout=_WAITING_FOR_SERVICE_TO_START,
193+
press_start_button=False,
194+
product_url=product_url,
195+
is_service_legacy=is_service_legacy,
196+
)
197+
198+
service_iframe = page.frame_locator("iframe")
199+
with log_context(logging.INFO, "Waiting for the RSM to be ready..."):
200+
service_iframe.get_by_role("grid").wait_for(
201+
state="visible", timeout=_WAITING_FOR_SERVICE_TO_APPEAR
202+
)
203+
204+
page.wait_for_timeout(10000)
202205

203206
# # select the function
204207
# service_iframe.get_by_role("gridcell", name=_FUNCTION_NAME).click()

0 commit comments

Comments
 (0)