Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,18 @@ def peek_icons(self, svgs: List[str], screenshot_folder: str):
main_content.screenshot(new_icons_path);

# go downward so we get the oldest icon first
len_ = len(svgs)
for i in range(len_, 0, -1):
xpath = f'//*[@id="glyphSet0"]/div[{i}]'
icon_div = self.driver.find_element_by_xpath(xpath)
icon_divs_xpath = f'//div[@id="glyphSet0"]/div'
icon_divs = self.driver.find_elements_by_xpath(icon_divs_xpath)
icon_divs.reverse()
i = 0
for icon_div in icon_divs:
if not icon_div.is_displayed():
continue

# crop the div out from the screenshot
icon_screenshot = str(
Path(screenshot_folder, f"new_icon_{len_ - i}.png").resolve()
Path(screenshot_folder, f"new_icon_{i}.png").resolve()
)
icon_div.screenshot(icon_screenshot)
i += 1

print("Finished peeking the icons...")