|
12 | 12 | MINUTE, |
13 | 13 | RobustWebSocket, |
14 | 14 | ServiceType, |
| 15 | + wait_for_service_running, |
15 | 16 | ) |
16 | 17 |
|
17 | 18 | _WAITING_FOR_SERVICE_TO_START: Final[int] = 5 * MINUTE |
@@ -61,7 +62,7 @@ def _create_function_from_project( |
61 | 62 | "Created function: %s", f"{json.dumps(function_data['data'], indent=2)}" |
62 | 63 | ) |
63 | 64 |
|
64 | | - page.click("body") # to close any dialog |
| 65 | + page.keyboard.press("Escape") |
65 | 66 | created_function_uuids.append(function_data["data"]["uuid"]) |
66 | 67 | return function_data["data"] |
67 | 68 |
|
@@ -170,35 +171,37 @@ def test_response_surface_modeling( |
170 | 171 |
|
171 | 172 | # 3. start a RSM with that function |
172 | 173 |
|
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) |
202 | 205 |
|
203 | 206 | # # select the function |
204 | 207 | # service_iframe.get_by_role("gridcell", name=_FUNCTION_NAME).click() |
|
0 commit comments