Skip to content

Commit

Permalink
update test workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Dou Du committed Jun 16, 2024
1 parent f191bd3 commit 608f78e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions test/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ class test_widget():
def setup_method(self, method):
options = Options()
cwd = os.getcwd()
options.add_argument("--headless")
options.add_argument("--window-size=1280x1500")
options.add_experimental_option("prefs", {"download.default_directory": cwd})
self.driver = webdriver.Chrome(options=options)
self.vars = {}
Expand All @@ -25,11 +27,14 @@ def teardown_method(self, method):

def download_widget_image(self):
self.driver.get("http://localhost:8383/voila/render/example.ipynb")
self.driver.set_window_size(1280, 2000)
time.sleep(3)
self.driver.save_screenshot("widget-01.png")

self.driver.execute_script("window.scrollTo(0, document.body.scrollHeight)")
self.driver.find_element(By.CLASS_NAME, 'bands-widget-all').click()
time.sleep(3)

#Move to the end of the page
self.driver.find_element(By.TAG_NAME, 'body').send_keys(Keys.END)
time.sleep(3)
self.driver.save_screenshot("widget-02.png")

Expand Down
Binary file modified test/widget-sample.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 608f78e

Please sign in to comment.