front: фикс скриншотов, теперь автоматически будет светлая тема и корректно работающее создание скриншотов для полной страницы
@@ -63,6 +63,7 @@ def run_server(modem, build):
|
||||
|
||||
def create_driver():
|
||||
opts = webdriver.FirefoxOptions()
|
||||
opts.add_argument("--headless")
|
||||
serv = webdriver.FirefoxService(executable_path='/snap/bin/geckodriver')
|
||||
driver = webdriver.Firefox(options=opts, service=serv)
|
||||
|
||||
@@ -103,7 +104,7 @@ def make_screenshots_or_checks(modem):
|
||||
driver = create_driver()
|
||||
try:
|
||||
driver.get("http://localhost:8080/login")
|
||||
driver.save_screenshot(str(out_dir / f"login.png"))
|
||||
driver.get_full_page_screenshot_as_file(str(out_dir / f"login.png"))
|
||||
|
||||
login(driver)
|
||||
|
||||
@@ -115,12 +116,9 @@ def make_screenshots_or_checks(modem):
|
||||
|
||||
# Проверка, что body загрузилось
|
||||
time.sleep(1)
|
||||
page_height = driver.execute_script("return document.body.scrollHeight")
|
||||
driver.set_window_size(SCREEN_WIDTH, page_height + 200)
|
||||
time.sleep(1)
|
||||
|
||||
driver.find_element(By.TAG_NAME, "body") # гарантирует что DOM есть
|
||||
driver.save_screenshot(str(out_dir / f"{tab_name}.png"))
|
||||
driver.get_full_page_screenshot_as_file(str(out_dir / f"{tab_name}.png"))
|
||||
|
||||
finally:
|
||||
driver.quit()
|
||||
|
||||
|
Before Width: | Height: | Size: 99 KiB After Width: | Height: | Size: 32 KiB |
|
Before Width: | Height: | Size: 464 KiB After Width: | Height: | Size: 165 KiB |
|
Before Width: | Height: | Size: 589 KiB After Width: | Height: | Size: 201 KiB |
|
Before Width: | Height: | Size: 206 KiB After Width: | Height: | Size: 78 KiB |
|
Before Width: | Height: | Size: 602 KiB After Width: | Height: | Size: 309 KiB |
|
Before Width: | Height: | Size: 463 KiB After Width: | Height: | Size: 165 KiB |
|
Before Width: | Height: | Size: 454 KiB After Width: | Height: | Size: 152 KiB |
|
Before Width: | Height: | Size: 508 KiB After Width: | Height: | Size: 279 KiB |
|
Before Width: | Height: | Size: 428 KiB After Width: | Height: | Size: 154 KiB |
|
Before Width: | Height: | Size: 214 KiB After Width: | Height: | Size: 81 KiB |
|
Before Width: | Height: | Size: 634 KiB After Width: | Height: | Size: 216 KiB |
|
Before Width: | Height: | Size: 513 KiB After Width: | Height: | Size: 243 KiB |