Skip to content

An update and a fix #2601

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Mar 14, 2024
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion mkdocs_build/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ regex>=2023.12.25
pymdown-extensions>=10.7.1
pipdeptree>=2.16.1
python-dateutil>=2.8.2
Markdown==3.5.2
Markdown==3.6
markdown2==2.4.13
MarkupSafe==2.1.5
Jinja2==3.1.3
Expand Down
10 changes: 6 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
pip>=24.0
packaging>=23.2
packaging>=24.0
setuptools>=68.0.0;python_version<"3.8"
setuptools>=69.1.1;python_version>="3.8"
wheel>=0.42.0
setuptools>=69.2.0;python_version>="3.8"
wheel>=0.42.0;python_version<"3.8"
wheel>=0.43.0;python_version>="3.8"
attrs>=23.2.0
certifi>=2024.2.2
filelock>=3.12.2;python_version<"3.8"
Expand Down Expand Up @@ -44,7 +45,8 @@ pytest-html==2.0.1
pytest-metadata==3.0.0;python_version<"3.8"
pytest-metadata==3.1.1;python_version>="3.8"
pytest-ordering==0.6
pytest-rerunfailures==13.0
pytest-rerunfailures==13.0;python_version<"3.8"
pytest-rerunfailures==14.0;python_version>="3.8"
pytest-xdist==3.5.0
parameterized==0.9.0
sbvirtualdisplay==1.3.0
Expand Down
2 changes: 1 addition & 1 deletion seleniumbase/__version__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# seleniumbase package
__version__ = "4.24.5"
__version__ = "4.24.6"
43 changes: 24 additions & 19 deletions seleniumbase/console_scripts/sb_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -710,8 +710,7 @@ def main(override=None, intel_for_uc=None, force_uc=None):
p_version = c3 + use_version + cr
log_d("\n*** %s = %s" % (msg, p_version))
elif name == "iedriver":
major_version = "3.14"
full_version = "3.14.0"
full_version = "4.14.0"
use_version = full_version
if IS_WINDOWS and "64" in ARCH:
file_name = "IEDriverServer_x64_%s.zip" % full_version
Expand All @@ -723,8 +722,9 @@ def main(override=None, intel_for_uc=None, force_uc=None):
"Windows-based systems!"
)
download_url = (
"https://selenium-release.storage.googleapis.com/"
"%s/%s" % (major_version, file_name)
"https://github.com/SeleniumHQ/selenium/"
"releases/download/selenium-"
"%s/%s" % (full_version, file_name)
)
headless_ie_version = "v1.4"
headless_ie_file_name = "headless-selenium-for-win-v1-4.zip"
Expand Down Expand Up @@ -949,7 +949,11 @@ def main(override=None, intel_for_uc=None, force_uc=None):
make_executable(path_file)
log_d("Also copied to: %s%s%s" % (c3, path_file, cr))
log_d("")
elif name == "edgedriver" or name == "msedgedriver":
elif (
name == "edgedriver"
or name == "msedgedriver"
or name == "iedriver"
):
if IS_MAC or IS_LINUX:
# Mac / Linux
expected_contents = [
Expand All @@ -969,6 +973,8 @@ def main(override=None, intel_for_uc=None, force_uc=None):
"Driver_Notes/LICENSE",
"msedgedriver.exe",
]
if name == "iedriver":
expected_contents = ["IEDriverServer.exe"]
if len(contents) > 5:
raise Exception("Unexpected content in EdgeDriver Zip file!")
for content in contents:
Expand All @@ -984,21 +990,20 @@ def main(override=None, intel_for_uc=None, force_uc=None):
# Remove existing version if exists
str_name = str(f_name)
new_file = os.path.join(downloads_folder, str_name)
if IS_MAC or IS_LINUX:
# Mac / Linux
if str_name == "msedgedriver":
driver_file = str_name
driver_path = new_file
if os.path.exists(new_file):
os.remove(new_file)
else:
# Windows
if str_name == "msedgedriver.exe":
driver_file = str_name
driver_path = new_file
if os.path.exists(new_file):
os.remove(new_file)
if (
((IS_MAC or IS_LINUX) and str_name == "msedgedriver")
or (
str_name == "msedgedriver.exe"
or str_name == "IEDriverServer.exe"
)
):
driver_file = str_name
driver_path = new_file
if os.path.exists(new_file):
os.remove(new_file)
if not driver_file or not driver_path:
if str_name == "IEDriverServer.exe":
raise Exception("IEDriverServer missing from Zip file!")
raise Exception("msedgedriver missing from Zip file!")
log_d("Extracting %s from %s ..." % (contents, file_name))
zip_ref.extractall(downloads_folder)
Expand Down
12 changes: 7 additions & 5 deletions seleniumbase/core/browser_launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -2304,14 +2304,14 @@ def get_local_driver(
"IE Browser is for Windows-based systems only!"
)
from selenium.webdriver.ie.options import Options
from selenium.webdriver.ie.service import Service
ie_options = Options()
ie_options.ignore_protected_mode_settings = True
ie_options.ignore_zoom_level = True
ie_options.require_window_focus = False
ie_options.native_events = True
ie_options.full_page_screenshot = True
ie_options.persistent_hover = True
ie_capabilities = ie_options.to_capabilities()
if LOCAL_IEDRIVER and os.path.exists(LOCAL_IEDRIVER):
try:
make_driver_executable_if_not(LOCAL_IEDRIVER)
Expand Down Expand Up @@ -2345,16 +2345,18 @@ def get_local_driver(
log_d("\nWarning: HeadlessIEDriver not found. Getting it now:")
sb_install.main(override="iedriver")
sys.argv = sys_args # Put back the original sys args
d_b_c = "--disable-build-check"
if not headless:
warnings.simplefilter("ignore", category=DeprecationWarning)
driver = webdriver.Ie(capabilities=ie_capabilities)
service = Service(service_args=[d_b_c])
driver = webdriver.Ie(service=service, options=ie_options)
return extend_driver(driver)
else:
warnings.simplefilter("ignore", category=DeprecationWarning)
driver = webdriver.Ie(
executable_path=LOCAL_HEADLESS_IEDRIVER,
capabilities=ie_capabilities,
service = Service(
executable_path=LOCAL_IEDRIVER, service_args=[d_b_c],
)
driver = webdriver.Ie(service=service, options=ie_options)
return extend_driver(driver)
elif browser_name == constants.Browser.EDGE:
prefs = {
Expand Down
7 changes: 5 additions & 2 deletions seleniumbase/fixtures/base_case.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ def __initialize_variables(self):
self._language = "English"
self._presentation_slides = {}
self._presentation_transition = {}
self._output_file_saves = True # For Presenter / ChartMaker
self._rec_overrides_switch = True # Recorder-Mode uses set_c vs switch
self._sb_test_identifier = None
self._html_report_extra = [] # (Used by pytest_plugin.py)
Expand Down Expand Up @@ -11187,7 +11188,8 @@ def save_presentation(
out_file = codecs.open(file_path, "w+", encoding="utf-8")
out_file.writelines(the_html)
out_file.close()
print("\n>>> [%s] was saved!\n" % file_path)
if self._output_file_saves:
print("\n>>> [%s] was saved!\n" % file_path)
return file_path

def begin_presentation(
Expand Down Expand Up @@ -11885,7 +11887,8 @@ def save_chart(self, chart_name=None, filename=None, folder=None):
out_file = codecs.open(file_path, "w+", encoding="utf-8")
out_file.writelines(the_html)
out_file.close()
print("\n>>> [%s] was saved!" % file_path)
if self._output_file_saves:
print("\n>>> [%s] was saved!" % file_path)
return file_path

def display_chart(self, chart_name=None, filename=None, interval=0):
Expand Down
16 changes: 9 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,11 @@
python_requires=">=3.7",
install_requires=[
'pip>=24.0',
'packaging>=23.2',
'packaging>=24.0',
'setuptools>=68.0.0;python_version<"3.8"',
'setuptools>=69.1.1;python_version>="3.8"',
'wheel>=0.42.0',
'setuptools>=69.2.0;python_version>="3.8"',
'wheel>=0.42.0;python_version<"3.8"',
'wheel>=0.43.0;python_version>="3.8"',
'attrs>=23.2.0',
"certifi>=2024.2.2",
'filelock>=3.12.2;python_version<"3.8"',
Expand Down Expand Up @@ -192,7 +193,8 @@
'pytest-metadata==3.0.0;python_version<"3.8"',
'pytest-metadata==3.1.1;python_version>="3.8"',
"pytest-ordering==0.6",
'pytest-rerunfailures==13.0',
'pytest-rerunfailures==13.0;python_version<"3.8"',
'pytest-rerunfailures==14.0;python_version>="3.8"',
'pytest-xdist==3.5.0',
'parameterized==0.9.0',
"sbvirtualdisplay==1.3.0",
Expand All @@ -217,9 +219,9 @@
# Usage: pytest --alluredir=allure_results
# Serve: allure serve allure_results
"allure": [
'allure-pytest==2.13.2',
'allure-python-commons==2.13.2',
'allure-behave==2.13.2',
'allure-pytest==2.13.3',
'allure-python-commons==2.13.3',
'allure-behave==2.13.3',
],
# pip install -e .[coverage]
# Usage: coverage run -m pytest; coverage html; coverage report
Expand Down