Skip to content
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
3 changes: 1 addition & 2 deletions mkdocs_build/prepare.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
""" For preparing the mkdocs-generated seleniumbase.io website. """

import codecs
import os
import re
from pathlib import Path
Expand Down Expand Up @@ -196,6 +195,6 @@ def main(*args, **kwargs):
)
seleniumbase_lines.append(line)
if changed:
out_file = codecs.open(readme_file, "w+", encoding="utf-8")
out_file = open(readme_file, "w+", encoding="utf-8")
out_file.writelines("\r\n".join(seleniumbase_lines))
out_file.close()
2 changes: 1 addition & 1 deletion mkdocs_build/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# mkdocs dependencies for generating the seleniumbase.io website
# Minimum Python version: 3.10 (for generating docs only)

regex>=2025.9.18
regex>=2025.10.23
pymdown-extensions>=10.16.1
pipdeptree>=2.29.0
python-dateutil>=2.8.2
Expand Down
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ cssselect==1.2.0;python_version<"3.9"
cssselect==1.3.0;python_version>="3.9"
sortedcontainers==2.4.0
execnet==2.1.1
iniconfig==2.1.0
iniconfig==2.1.0;python_version<"3.10"
iniconfig==2.3.0;python_version>="3.10"
pluggy==1.5.0;python_version<"3.9"
pluggy==1.6.0;python_version>="3.9"
pytest==8.3.5;python_version<"3.9"
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.43.0"
__version__ = "4.43.1"
5 changes: 2 additions & 3 deletions seleniumbase/behave/behave_sb.py
Original file line number Diff line number Diff line change
Expand Up @@ -1205,7 +1205,6 @@ def dashboard_pre_processing():


def _create_dashboard_assets_():
import codecs
from seleniumbase.js_code.live_js import live_js
from seleniumbase.core.style_sheet import get_pytest_style

Expand All @@ -1222,7 +1221,7 @@ def _create_dashboard_assets_():
if existing_pytest_style == get_pytest_style():
add_pytest_style_css = False
if add_pytest_style_css:
out_file = codecs.open(pytest_style_css, "w+", encoding="utf-8")
out_file = open(pytest_style_css, "w+", encoding="utf-8")
out_file.writelines(get_pytest_style())
out_file.close()
live_js_file = os.path.join(assets_folder, "live.js")
Expand All @@ -1234,7 +1233,7 @@ def _create_dashboard_assets_():
if existing_live_js == live_js:
add_live_js_file = False
if add_live_js_file:
out_file = codecs.open(live_js_file, "w+", encoding="utf-8")
out_file = open(live_js_file, "w+", encoding="utf-8")
out_file.writelines(live_js)
out_file.close()

Expand Down
5 changes: 2 additions & 3 deletions seleniumbase/console_scripts/sb_caseplans.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
Output:
Launches the SeleniumBase Case Plans Generator.
"""
import codecs
import colorama
import os
import subprocess
Expand Down Expand Up @@ -135,7 +134,7 @@ def generate_case_plan_boilerplates(
file_name = case_id
file_path = os.path.join(full_folder_path, file_name)
if not os.path.exists(file_path):
out_file = codecs.open(file_path, "w+", "utf-8")
out_file = open(file_path, "w+", "utf-8")
out_file.writelines("\r\n".join(data))
out_file.close()
new_plans += 1
Expand Down Expand Up @@ -316,7 +315,7 @@ def view_summary_of_existing_case_plans(root, tests):
full_plan = plan_head

file_path = "case_summary.md"
file = codecs.open(file_path, "w+", "utf-8")
file = open(file_path, "w+", "utf-8")
file.writelines("\r\n".join(full_plan))
file.close()

Expand Down
3 changes: 1 addition & 2 deletions seleniumbase/console_scripts/sb_mkchart.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
and use a "sky" theme with "slide" transition.
The chart can be used as a basic boilerplate.
"""
import codecs
import colorama
import os
import sys
Expand Down Expand Up @@ -254,7 +253,7 @@ def main():
continue
new_data.append(line)
data = new_data
file = codecs.open(file_path, "w+", "utf-8")
file = open(file_path, "w+", "utf-8")
file.writelines("\r\n".join(data))
file.close()
if " " not in file_name:
Expand Down
43 changes: 21 additions & 22 deletions seleniumbase/console_scripts/sb_mkdir.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
and Python boilerplates for setting up customized
test frameworks.
"""
import codecs
import colorama
import os
import sys
Expand Down Expand Up @@ -114,7 +113,7 @@ def main():
data.append(seleniumbase_req)
data.append("")
file_path = "%s/%s" % (dir_name, "requirements.txt")
file = codecs.open(file_path, "w+", "utf-8")
file = open(file_path, "w+", "utf-8")
file.writelines("\r\n".join(data))
file.close()

Expand Down Expand Up @@ -152,7 +151,7 @@ def main():
data.append(" production: custom marker")
data.append("")
file_path = "%s/%s" % (dir_name, "pytest.ini")
file = codecs.open(file_path, "w+", "utf-8")
file = open(file_path, "w+", "utf-8")
file.writelines("\r\n".join(data))
file.close()

Expand All @@ -169,14 +168,14 @@ def main():
data.append("show_skipped=false")
data.append("show_timings=false")
file_path = "%s/%s" % (dir_name, "setup.cfg")
file = codecs.open(file_path, "w+", "utf-8")
file = open(file_path, "w+", "utf-8")
file.writelines("\r\n".join(data))
file.close()

data = []
data.append("")
file_path = "%s/%s" % (dir_name, "__init__.py")
file = codecs.open(file_path, "w+", "utf-8")
file = open(file_path, "w+", "utf-8")
file.writelines("\r\n".join(data))
file.close()

Expand Down Expand Up @@ -312,7 +311,7 @@ def main():
data.append("temp_*/")
data.append("node_modules")
file_path = "%s/%s" % (dir_name, ".gitignore")
file = codecs.open(file_path, "w+", "utf-8")
file = open(file_path, "w+", "utf-8")
file.writelines("\r\n".join(data))
file.close()

Expand All @@ -324,7 +323,7 @@ def main():
data.append(" ├── requirements.txt")
data.append(" └── setup.cfg")
file_path = "%s/%s" % (dir_name, "outline.rst")
file = codecs.open(file_path, "w+", "utf-8")
file = open(file_path, "w+", "utf-8")
file.writelines("\r\n".join(data))
file.close()
os.system("sbase print %s -n" % file_path)
Expand Down Expand Up @@ -368,7 +367,7 @@ def main():
data.append(' self.assert_element("div#login_button_container")')
data.append("")
file_path = "%s/%s" % (dir_name, "my_first_test.py")
file = codecs.open(file_path, "w+", "utf-8")
file = open(file_path, "w+", "utf-8")
file.writelines("\r\n".join(data))
file.close()

Expand Down Expand Up @@ -461,7 +460,7 @@ def main():
data.append(' self.assert_text("SeleniumBase", "h2")')
data.append("")
file_path = "%s/%s" % (dir_name, "test_demo_site.py")
file = codecs.open(file_path, "w+", "utf-8")
file = open(file_path, "w+", "utf-8")
file.writelines("\r\n".join(data))
file.close()

Expand Down Expand Up @@ -500,7 +499,7 @@ def main():
data.append(' self.assert_title_contains(title_text)')
data.append("")
file_path = "%s/%s" % (dir_name, "parameterized_test.py")
file = codecs.open(file_path, "w+", "utf-8")
file = open(file_path, "w+", "utf-8")
file.writelines("\r\n".join(data))
file.close()

Expand All @@ -510,7 +509,7 @@ def main():
data = []
data.append("")
file_path = "%s/%s" % (dir_name_2, "__init__.py")
file = codecs.open(file_path, "w+", "utf-8")
file = open(file_path, "w+", "utf-8")
file.writelines("\r\n".join(data))
file.close()

Expand Down Expand Up @@ -545,7 +544,7 @@ def main():
data.append(" pass")
data.append("")
file_path = "%s/%s" % (dir_name_2, "base_test_case.py")
file = codecs.open(file_path, "w+", "utf-8")
file = open(file_path, "w+", "utf-8")
file.writelines("\r\n".join(data))
file.close()

Expand All @@ -554,7 +553,7 @@ def main():
data.append(' html = "html"')
data.append("")
file_path = "%s/%s" % (dir_name_2, "page_objects.py")
file = codecs.open(file_path, "w+", "utf-8")
file = open(file_path, "w+", "utf-8")
file.writelines("\r\n".join(data))
file.close()

Expand All @@ -570,7 +569,7 @@ def main():
data.append(" self.assert_element(Page.html)")
data.append("")
file_path = "%s/%s" % (dir_name_2, "boilerplate_test.py")
file = codecs.open(file_path, "w+", "utf-8")
file = open(file_path, "w+", "utf-8")
file.writelines("\r\n".join(data))
file.close()

Expand All @@ -594,7 +593,7 @@ def main():
data.append(' DataPage().add_input_text(self, "Goodbye!")')
data.append("")
file_path = "%s/%s" % (dir_name_2, "classic_obj_test.py")
file = codecs.open(file_path, "w+", "utf-8")
file = open(file_path, "w+", "utf-8")
file.writelines("\r\n".join(data))
file.close()

Expand All @@ -614,7 +613,7 @@ def main():
data.append(' DataPage().add_input_text(sb, "Goodbye!")')
data.append("")
file_path = "%s/%s" % (dir_name_2, "sb_fixture_test.py")
file = codecs.open(file_path, "w+", "utf-8")
file = open(file_path, "w+", "utf-8")
file.writelines("\r\n".join(data))
file.close()

Expand All @@ -624,7 +623,7 @@ def main():
data = []
data.append("")
file_path = "%s/%s" % (dir_name_3, "__init__.py")
file = codecs.open(file_path, "w+", "utf-8")
file = open(file_path, "w+", "utf-8")
file.writelines("\r\n".join(data))
file.close()

Expand Down Expand Up @@ -652,7 +651,7 @@ def main():
)
data.append("")
file_path = "%s/%s" % (dir_name_3, "google_test.py")
file = codecs.open(file_path, "w+", "utf-8")
file = open(file_path, "w+", "utf-8")
file.writelines("\r\n".join(data))
file.close()

Expand All @@ -670,7 +669,7 @@ def main():
data.append(' search_results = "div#center_col"')
data.append("")
file_path = "%s/%s" % (dir_name_3, "google_objects.py")
file = codecs.open(file_path, "w+", "utf-8")
file = open(file_path, "w+", "utf-8")
file.writelines("\r\n".join(data))
file.close()

Expand Down Expand Up @@ -702,7 +701,7 @@ def main():
data.append(' self.assert_element("div#login_button_container")')
data.append("")
file_path = "%s/%s" % (dir_name_3, "swag_labs_test.py")
file = codecs.open(file_path, "w+", "utf-8")
file = open(file_path, "w+", "utf-8")
file.writelines("\r\n".join(data))
file.close()

Expand All @@ -729,7 +728,7 @@ def main():
data.append(' sb.assert_element("div#login_button_container")')
data.append("")
file_path = "%s/%s" % (dir_name_3, "sb_swag_test.py")
file = codecs.open(file_path, "w+", "utf-8")
file = open(file_path, "w+", "utf-8")
file.writelines("\r\n".join(data))
file.close()

Expand All @@ -756,7 +755,7 @@ def main():
data.append(" ├── sb_swag_test.py")
data.append(" └── swag_labs_test.py")
file_path = "%s/%s" % (dir_name, "outline.rst")
file = codecs.open(file_path, "w+", "utf-8")
file = open(file_path, "w+", "utf-8")
file.writelines("\r\n".join(data))
file.close()
if " " not in file_path:
Expand Down
3 changes: 1 addition & 2 deletions seleniumbase/console_scripts/sb_mkfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
BaseCase format supports Languages or Recorder Mode.
UC Mode automatically uses English with SB() format.
"""
import codecs
import colorama
import os
import sys
Expand Down Expand Up @@ -413,7 +412,7 @@ def main():
continue
new_data.append(line)
data = new_data
file = codecs.open(file_path, "w+", "utf-8")
file = open(file_path, "w+", "utf-8")
file.writelines("\r\n".join(data))
file.close()
if " " not in file_name:
Expand Down
3 changes: 1 addition & 2 deletions seleniumbase/console_scripts/sb_mkpres.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
and use "serif" theme with "slide" transition.
The slides can be used as a basic boilerplate.
"""
import codecs
import colorama
import os
import sys
Expand Down Expand Up @@ -273,7 +272,7 @@ def main():
continue
new_data.append(line)
data = new_data
file = codecs.open(file_path, "w+", "utf-8")
file = open(file_path, "w+", "utf-8")
file.writelines("\r\n".join(data))
file.close()
if " " not in file_name:
Expand Down
3 changes: 1 addition & 2 deletions seleniumbase/console_scripts/sb_mkrec.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
Creates a new SeleniumBase test using the Recorder.
If the filename already exists, an error is raised.
"""
import codecs
import colorama
import shutil
import os
Expand Down Expand Up @@ -240,7 +239,7 @@ def main():
d2.append("")
data = d2

file = codecs.open(file_path, "w+", "utf-8")
file = open(file_path, "w+", "utf-8")
file.writelines("\r\n".join(data))
file.close()
success = (
Expand Down
5 changes: 2 additions & 3 deletions seleniumbase/console_scripts/sb_objectify.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
have been replaced with variable names defined in
"page_objects.py", supporting the Page Object Pattern.
"""
import codecs
import os
import re
import sys
Expand Down Expand Up @@ -136,7 +135,7 @@ def create_objects_file(selector_list_dict=None):
data.append(' html = "html"')
data.append("")
file_path = PAGE_OBJECTS_FILE
file = codecs.open(file_path, "w+", "utf-8")
file = open(file_path, "w+", "utf-8")
file.writelines("\r\n".join(data))
file.close()
if not selector_list_dict:
Expand Down Expand Up @@ -3189,7 +3188,7 @@ def main(shell_command):
# Create SeleniumBase test file
base_file_name = seleniumbase_file.split(".py")[0]
converted_file_name = base_file_name + ".py" # Change end to make a copy
out_file = codecs.open(converted_file_name, "w+", encoding="utf-8")
out_file = open(converted_file_name, "w+", encoding="utf-8")
out_file.writelines(seleniumbase_code)
out_file.close()
print('\n>>> ["%s"] was updated!\n' % converted_file_name)
Expand Down
4 changes: 1 addition & 3 deletions seleniumbase/core/browser_launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -2006,14 +2006,12 @@ def _repair_edgedriver(edge_version):


def _mark_driver_repaired():
import codecs

abs_path = os.path.abspath(".")
driver_repaired_lock = constants.MultiBrowser.DRIVER_REPAIRED
file_path = os.path.join(abs_path, driver_repaired_lock)
if not os.path.exists(DOWNLOADS_FOLDER):
os.makedirs(DOWNLOADS_FOLDER)
out_file = codecs.open(file_path, "w+", encoding="utf-8")
out_file = open(file_path, "w+", encoding="utf-8")
out_file.writelines("")
out_file.close()

Expand Down
Loading