Skip to content

Commit 874ec38

Browse files
author
Dou Du
committed
update workflow
1 parent fbfc9b2 commit 874ec38

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

test/test.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ class test_widget():
1616
def setup_method(self, method):
1717
options = Options()
1818
cwd = os.getcwd()
19+
options.add_argument("--headless")
20+
options.add_argument("--window-size=1280x1500")
1921
options.add_experimental_option("prefs", {"download.default_directory": cwd})
2022
self.driver = webdriver.Chrome(options=options)
2123
self.vars = {}
@@ -25,7 +27,6 @@ def teardown_method(self, method):
2527

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

3132
try:
@@ -36,10 +37,12 @@ def test_elements(self):
3637

3738
def download_widget_image(self):
3839
self.driver.get("http://localhost:8383/voila/render/example.ipynb")
39-
self.driver.set_window_size(1280, 720)
4040
time.sleep(3)
4141
self.driver.save_screenshot("widget-01.png")
42-
self.driver.execute_script("window.scrollTo(0, 1000)")
42+
43+
#Move to the end of the page
44+
self.driver.find_element(By.CLASS_NAME, 'bz-canvas3d').click()
45+
self.driver.find_element(By.TAG_NAME, 'body').send_keys(Keys.END)
4346
time.sleep(3)
4447
self.driver.save_screenshot("widget-02.png")
4548

0 commit comments

Comments
 (0)