Skip to content

Commit

Permalink
revert timeout only left on load page and button click and test
Browse files Browse the repository at this point in the history
  • Loading branch information
CopyDemon committed Oct 23, 2024
1 parent 93a458a commit 5aa3e7f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
13 changes: 6 additions & 7 deletions idaes_ui/fv/fsvis.py
Original file line number Diff line number Diff line change
Expand Up @@ -416,17 +416,16 @@ async def _async_save_diagram(
from IPython.display import display as IPythonDisplay

async with async_playwright() as p:
timeout = 800000
browser = await p.chromium.launch(
headless=True, args=["--no-sandbox"], timeout=timeout
headless=True, args=["--no-sandbox"], timeout=500000
)
context = await browser.new_context(viewport={"width": 1920, "height": 1080})
page = await context.new_page()

try:
# Go to visualizer URL and wait document load
await page.goto(live_server_url, timeout=timeout)
await page.wait_for_load_state("networkidle", timeout=timeout)
await page.goto(live_server_url)
await page.wait_for_load_state("networkidle")

# Hover on download menu show download option list
await page.hover("#diagram_download_icon")
Expand All @@ -438,14 +437,14 @@ async def _async_save_diagram(
await page.click("#headerExportSvgBtn")

# Click download btn on UI pop modal
async with page.expect_download(timeout=timeout) as download_info:
await page.click(".control-button")
async with page.expect_download() as download_info:
await page.click(".control-button", timeout=500000)

# Get download value
download = await download_info.value

# Wait for download to complete
download_path = await download.path(timeout=timeout)
download_path = await download.path()

diagram_saved_path = os.path.join(
save_to, f"{screenshot_name}.{image_type}"
Expand Down
1 change: 1 addition & 0 deletions some/user_defined_path/test_diagram.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions test_diagram.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"model": {"stream_table": {"index": [], "columns": ["Variable", "Units"], "data": []}, "id": "test_diagram", "unit_models": {}, "arcs": {}}, "routing_config": {}, "cells": []}

0 comments on commit 5aa3e7f

Please sign in to comment.