mirror of
https://github.com/konpa/devicon.git
synced 2025-08-12 01:24:42 +02:00
Revert "Fix a couple issues found in the build script"
This commit is contained in:
27
.github/scripts/build_assets/SeleniumRunner.py
vendored
27
.github/scripts/build_assets/SeleniumRunner.py
vendored
@@ -75,12 +75,14 @@ class SeleniumRunner:
|
||||
self.driver = WebDriver(options=options, executable_path=geckodriver_path)
|
||||
self.driver.get(self.ICOMOON_URL)
|
||||
assert "IcoMoon App" in self.driver.title
|
||||
# wait until the whole web page is loaded by testing the hamburger input
|
||||
WebDriverWait(self.driver, self.LONG_WAIT_IN_SEC).until(
|
||||
ec.element_to_be_clickable((By.XPATH, "(//i[@class='icon-menu'])[2]"))
|
||||
)
|
||||
print("Accessed icomoon.io")
|
||||
|
||||
# wait until the whole web page is loaded by testing the hamburger input
|
||||
hamburger_input = WebDriverWait(self.driver, SeleniumRunner.LONG_WAIT_IN_SEC).until(
|
||||
ec.element_to_be_clickable((By.CSS_SELECTOR,
|
||||
"button.btn5.lh-def.transparent i.icon-menu"))
|
||||
)
|
||||
hamburger_input.click()
|
||||
print("Accessed icomoon.io")
|
||||
|
||||
def upload_icomoon(self, icomoon_json_path: str):
|
||||
"""
|
||||
@@ -90,16 +92,11 @@ class SeleniumRunner:
|
||||
"""
|
||||
print("Uploading icomoon.json file...")
|
||||
try:
|
||||
self.click_hamburger_input()
|
||||
|
||||
# find the file input and enter the file path
|
||||
import_btn = self.driver.find_element(By.XPATH, "(//li[@class='file'])[1]//input")
|
||||
import_btn = WebDriverWait(self.driver, SeleniumRunner.LONG_WAIT_IN_SEC).until(
|
||||
ec.element_to_be_clickable((By.CSS_SELECTOR, "div#file input"))
|
||||
)
|
||||
import_btn.send_keys(icomoon_json_path)
|
||||
except SeleniumTimeoutException as e:
|
||||
print(e.stacktrace)
|
||||
print("Selenium timed out. Couldn't find import button.")
|
||||
self.close()
|
||||
raise e
|
||||
except Exception as e:
|
||||
self.close()
|
||||
raise e
|
||||
@@ -162,8 +159,8 @@ class SeleniumRunner:
|
||||
:return: None.
|
||||
"""
|
||||
try:
|
||||
hamburger_input = self.driver.find_element_by_xpath(
|
||||
"(//i[@class='icon-menu'])[2]"
|
||||
hamburger_input = self.driver.find_element_by_css_selector(
|
||||
"button.btn5.lh-def.transparent i.icon-menu"
|
||||
)
|
||||
|
||||
menu_appear_callback = ec.element_to_be_clickable(
|
||||
|
33
.github/scripts/build_assets/util.py
vendored
33
.github/scripts/build_assets/util.py
vendored
@@ -1,33 +0,0 @@
|
||||
from pathlib import Path
|
||||
from argparse import ArgumentParser
|
||||
from build_assets.PathResolverAction import PathResolverAction
|
||||
|
||||
def get_commandline_args():
|
||||
parser = ArgumentParser(description="Upload svgs to Icomoon to create icon files.")
|
||||
|
||||
parser.add_argument("--headless",
|
||||
help="Whether to run the browser in headless/no UI mode",
|
||||
action="store_true")
|
||||
|
||||
parser.add_argument("geckodriver_path",
|
||||
help="The path to the firefox executable file",
|
||||
action=PathResolverAction)
|
||||
|
||||
parser.add_argument("icomoon_json_path",
|
||||
help="The path to the icomoon.json aka the selection.json created by Icomoon",
|
||||
action=PathResolverAction)
|
||||
|
||||
parser.add_argument("devicon_json_path",
|
||||
help="The path to the devicon.json",
|
||||
action=PathResolverAction)
|
||||
|
||||
parser.add_argument("icons_folder_path",
|
||||
help="The path to the icons folder",
|
||||
action=PathResolverAction)
|
||||
|
||||
parser.add_argument("download_path",
|
||||
help="The path where you'd like to download the Icomoon files to",
|
||||
action=PathResolverAction)
|
||||
|
||||
|
||||
return parser.parse_args()
|
Reference in New Issue
Block a user