Skip to content

Commit

Permalink
update workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Dou Du committed Jun 16, 2024
1 parent fbfc9b2 commit 874ec38
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 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,7 +27,6 @@ def teardown_method(self, method):

def test_elements(self):
self.driver.get("http://localhost:8383/voila/render/example.ipynb")
self.driver.set_window_size(1280, 1080)
time.sleep(3)

try:
Expand All @@ -36,10 +37,12 @@ def test_elements(self):

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

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

Expand Down

0 comments on commit 874ec38

Please sign in to comment.