seleniumbase 4.43.0__py3-none-any.whl → 4.43.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of seleniumbase might be problematic. Click here for more details.

Files changed (37) hide show
  1. seleniumbase/__version__.py +1 -1
  2. seleniumbase/behave/behave_sb.py +7 -8
  3. seleniumbase/console_scripts/sb_caseplans.py +3 -4
  4. seleniumbase/console_scripts/sb_mkchart.py +1 -2
  5. seleniumbase/console_scripts/sb_mkdir.py +21 -22
  6. seleniumbase/console_scripts/sb_mkfile.py +1 -2
  7. seleniumbase/console_scripts/sb_mkpres.py +1 -2
  8. seleniumbase/console_scripts/sb_mkrec.py +1 -2
  9. seleniumbase/console_scripts/sb_objectify.py +4 -5
  10. seleniumbase/console_scripts/sb_print.py +1 -1
  11. seleniumbase/core/browser_launcher.py +14 -3
  12. seleniumbase/core/detect_b_ver.py +214 -8
  13. seleniumbase/core/log_helper.py +4 -5
  14. seleniumbase/core/report_helper.py +6 -5
  15. seleniumbase/core/sb_cdp.py +17 -2
  16. seleniumbase/core/tour_helper.py +1 -2
  17. seleniumbase/fixtures/base_case.py +23 -24
  18. seleniumbase/fixtures/constants.py +11 -0
  19. seleniumbase/fixtures/js_utils.py +14 -2
  20. seleniumbase/fixtures/page_actions.py +1 -2
  21. seleniumbase/fixtures/page_utils.py +15 -10
  22. seleniumbase/plugins/basic_test_info.py +2 -3
  23. seleniumbase/plugins/page_source.py +2 -3
  24. seleniumbase/plugins/pytest_plugin.py +23 -20
  25. seleniumbase/translate/translator.py +2 -3
  26. seleniumbase/undetected/cdp_driver/cdp_util.py +42 -38
  27. seleniumbase/undetected/cdp_driver/connection.py +1 -2
  28. seleniumbase/utilities/selenium_grid/download_selenium_server.py +1 -1
  29. seleniumbase/utilities/selenium_grid/grid_hub.py +1 -2
  30. seleniumbase/utilities/selenium_grid/grid_node.py +2 -3
  31. seleniumbase/utilities/selenium_ide/convert_ide.py +2 -3
  32. {seleniumbase-4.43.0.dist-info → seleniumbase-4.43.2.dist-info}/METADATA +4 -3
  33. {seleniumbase-4.43.0.dist-info → seleniumbase-4.43.2.dist-info}/RECORD +37 -37
  34. {seleniumbase-4.43.0.dist-info → seleniumbase-4.43.2.dist-info}/WHEEL +0 -0
  35. {seleniumbase-4.43.0.dist-info → seleniumbase-4.43.2.dist-info}/entry_points.txt +0 -0
  36. {seleniumbase-4.43.0.dist-info → seleniumbase-4.43.2.dist-info}/licenses/LICENSE +0 -0
  37. {seleniumbase-4.43.0.dist-info → seleniumbase-4.43.2.dist-info}/top_level.txt +0 -0
@@ -1,2 +1,2 @@
1
1
  # seleniumbase package
2
- __version__ = "4.43.0"
2
+ __version__ = "4.43.2"
@@ -1205,7 +1205,6 @@ def dashboard_pre_processing():
1205
1205
 
1206
1206
 
1207
1207
  def _create_dashboard_assets_():
1208
- import codecs
1209
1208
  from seleniumbase.js_code.live_js import live_js
1210
1209
  from seleniumbase.core.style_sheet import get_pytest_style
1211
1210
 
@@ -1217,24 +1216,24 @@ def _create_dashboard_assets_():
1217
1216
  add_pytest_style_css = True
1218
1217
  if os.path.exists(pytest_style_css):
1219
1218
  existing_pytest_style = None
1220
- with open(pytest_style_css, "r") as f:
1219
+ with open(pytest_style_css, mode="r") as f:
1221
1220
  existing_pytest_style = f.read()
1222
1221
  if existing_pytest_style == get_pytest_style():
1223
1222
  add_pytest_style_css = False
1224
1223
  if add_pytest_style_css:
1225
- out_file = codecs.open(pytest_style_css, "w+", encoding="utf-8")
1224
+ out_file = open(pytest_style_css, mode="w+", encoding="utf-8")
1226
1225
  out_file.writelines(get_pytest_style())
1227
1226
  out_file.close()
1228
1227
  live_js_file = os.path.join(assets_folder, "live.js")
1229
1228
  add_live_js_file = True
1230
1229
  if os.path.exists(live_js_file):
1231
1230
  existing_live_js = None
1232
- with open(live_js_file, "r") as f:
1231
+ with open(live_js_file, mode="r") as f:
1233
1232
  existing_live_js = f.read()
1234
1233
  if existing_live_js == live_js:
1235
1234
  add_live_js_file = False
1236
1235
  if add_live_js_file:
1237
- out_file = codecs.open(live_js_file, "w+", encoding="utf-8")
1236
+ out_file = open(live_js_file, mode="w+", encoding="utf-8")
1238
1237
  out_file.writelines(live_js)
1239
1238
  out_file.close()
1240
1239
 
@@ -1307,7 +1306,7 @@ def _perform_behave_unconfigure_():
1307
1306
  # Part 1: Finalizing the dashboard / integrating html report
1308
1307
  if os.path.exists(dashboard_path):
1309
1308
  the_html_d = None
1310
- with open(dashboard_path, "r", encoding="utf-8") as f:
1309
+ with open(dashboard_path, mode="r", encoding="utf-8") as f:
1311
1310
  the_html_d = f.read()
1312
1311
  if sb_config._multithreaded and "-c" in sys.argv:
1313
1312
  # Threads have "-c" in sys.argv, except for the last
@@ -1318,7 +1317,7 @@ def _perform_behave_unconfigure_():
1318
1317
  if os.path.exists(pie_path):
1319
1318
  import json
1320
1319
 
1321
- with open(pie_path, "r") as f:
1320
+ with open(pie_path, mode="r") as f:
1322
1321
  dash_pie = f.read().strip()
1323
1322
  sb_config._saved_dashboard_pie = json.loads(dash_pie)
1324
1323
  # If the test run doesn't complete by itself, stop refresh
@@ -1327,7 +1326,7 @@ def _perform_behave_unconfigure_():
1327
1326
  the_html_d = the_html_d.replace(find_it_3, swap_with_3)
1328
1327
  the_html_d = the_html_d.replace(find_it_4, swap_with_4)
1329
1328
  the_html_d += stamp
1330
- with open(dashboard_path, "w", encoding="utf-8") as f:
1329
+ with open(dashboard_path, mode="w", encoding="utf-8") as f:
1331
1330
  f.write(the_html_d) # Finalize the dashboard
1332
1331
  except KeyboardInterrupt:
1333
1332
  pass
@@ -15,7 +15,6 @@ Examples:
15
15
  Output:
16
16
  Launches the SeleniumBase Case Plans Generator.
17
17
  """
18
- import codecs
19
18
  import colorama
20
19
  import os
21
20
  import subprocess
@@ -135,7 +134,7 @@ def generate_case_plan_boilerplates(
135
134
  file_name = case_id
136
135
  file_path = os.path.join(full_folder_path, file_name)
137
136
  if not os.path.exists(file_path):
138
- out_file = codecs.open(file_path, "w+", "utf-8")
137
+ out_file = open(file_path, mode="w+", encoding="utf-8")
139
138
  out_file.writelines("\r\n".join(data))
140
139
  out_file.close()
141
140
  new_plans += 1
@@ -183,7 +182,7 @@ def view_summary_of_existing_case_plans(root, tests):
183
182
  else:
184
183
  case_path = os.path.join(folder_path, "case_plans", case_id)
185
184
  if os.path.exists(case_path):
186
- f = open(case_path, "r")
185
+ f = open(case_path, mode="r")
187
186
  case_data = f.read()
188
187
  f.close()
189
188
  case_data_storage.append(case_data)
@@ -316,7 +315,7 @@ def view_summary_of_existing_case_plans(root, tests):
316
315
  full_plan = plan_head
317
316
 
318
317
  file_path = "case_summary.md"
319
- file = codecs.open(file_path, "w+", "utf-8")
318
+ file = open(file_path, mode="w+", encoding="utf-8")
320
319
  file.writelines("\r\n".join(full_plan))
321
320
  file.close()
322
321
 
@@ -22,7 +22,6 @@ Output:
22
22
  and use a "sky" theme with "slide" transition.
23
23
  The chart can be used as a basic boilerplate.
24
24
  """
25
- import codecs
26
25
  import colorama
27
26
  import os
28
27
  import sys
@@ -254,7 +253,7 @@ def main():
254
253
  continue
255
254
  new_data.append(line)
256
255
  data = new_data
257
- file = codecs.open(file_path, "w+", "utf-8")
256
+ file = open(file_path, mode="w+", encoding="utf-8")
258
257
  file.writelines("\r\n".join(data))
259
258
  file.close()
260
259
  if " " not in file_name:
@@ -18,7 +18,6 @@ Output:
18
18
  and Python boilerplates for setting up customized
19
19
  test frameworks.
20
20
  """
21
- import codecs
22
21
  import colorama
23
22
  import os
24
23
  import sys
@@ -114,7 +113,7 @@ def main():
114
113
  data.append(seleniumbase_req)
115
114
  data.append("")
116
115
  file_path = "%s/%s" % (dir_name, "requirements.txt")
117
- file = codecs.open(file_path, "w+", "utf-8")
116
+ file = open(file_path, mode="w+", encoding="utf-8")
118
117
  file.writelines("\r\n".join(data))
119
118
  file.close()
120
119
 
@@ -152,7 +151,7 @@ def main():
152
151
  data.append(" production: custom marker")
153
152
  data.append("")
154
153
  file_path = "%s/%s" % (dir_name, "pytest.ini")
155
- file = codecs.open(file_path, "w+", "utf-8")
154
+ file = open(file_path, mode="w+", encoding="utf-8")
156
155
  file.writelines("\r\n".join(data))
157
156
  file.close()
158
157
 
@@ -169,14 +168,14 @@ def main():
169
168
  data.append("show_skipped=false")
170
169
  data.append("show_timings=false")
171
170
  file_path = "%s/%s" % (dir_name, "setup.cfg")
172
- file = codecs.open(file_path, "w+", "utf-8")
171
+ file = open(file_path, mode="w+", encoding="utf-8")
173
172
  file.writelines("\r\n".join(data))
174
173
  file.close()
175
174
 
176
175
  data = []
177
176
  data.append("")
178
177
  file_path = "%s/%s" % (dir_name, "__init__.py")
179
- file = codecs.open(file_path, "w+", "utf-8")
178
+ file = open(file_path, mode="w+", encoding="utf-8")
180
179
  file.writelines("\r\n".join(data))
181
180
  file.close()
182
181
 
@@ -312,7 +311,7 @@ def main():
312
311
  data.append("temp_*/")
313
312
  data.append("node_modules")
314
313
  file_path = "%s/%s" % (dir_name, ".gitignore")
315
- file = codecs.open(file_path, "w+", "utf-8")
314
+ file = open(file_path, mode="w+", encoding="utf-8")
316
315
  file.writelines("\r\n".join(data))
317
316
  file.close()
318
317
 
@@ -324,7 +323,7 @@ def main():
324
323
  data.append(" ├── requirements.txt")
325
324
  data.append(" └── setup.cfg")
326
325
  file_path = "%s/%s" % (dir_name, "outline.rst")
327
- file = codecs.open(file_path, "w+", "utf-8")
326
+ file = open(file_path, mode="w+", encoding="utf-8")
328
327
  file.writelines("\r\n".join(data))
329
328
  file.close()
330
329
  os.system("sbase print %s -n" % file_path)
@@ -368,7 +367,7 @@ def main():
368
367
  data.append(' self.assert_element("div#login_button_container")')
369
368
  data.append("")
370
369
  file_path = "%s/%s" % (dir_name, "my_first_test.py")
371
- file = codecs.open(file_path, "w+", "utf-8")
370
+ file = open(file_path, mode="w+", encoding="utf-8")
372
371
  file.writelines("\r\n".join(data))
373
372
  file.close()
374
373
 
@@ -461,7 +460,7 @@ def main():
461
460
  data.append(' self.assert_text("SeleniumBase", "h2")')
462
461
  data.append("")
463
462
  file_path = "%s/%s" % (dir_name, "test_demo_site.py")
464
- file = codecs.open(file_path, "w+", "utf-8")
463
+ file = open(file_path, mode="w+", encoding="utf-8")
465
464
  file.writelines("\r\n".join(data))
466
465
  file.close()
467
466
 
@@ -500,7 +499,7 @@ def main():
500
499
  data.append(' self.assert_title_contains(title_text)')
501
500
  data.append("")
502
501
  file_path = "%s/%s" % (dir_name, "parameterized_test.py")
503
- file = codecs.open(file_path, "w+", "utf-8")
502
+ file = open(file_path, mode="w+", encoding="utf-8")
504
503
  file.writelines("\r\n".join(data))
505
504
  file.close()
506
505
 
@@ -510,7 +509,7 @@ def main():
510
509
  data = []
511
510
  data.append("")
512
511
  file_path = "%s/%s" % (dir_name_2, "__init__.py")
513
- file = codecs.open(file_path, "w+", "utf-8")
512
+ file = open(file_path, mode="w+", encoding="utf-8")
514
513
  file.writelines("\r\n".join(data))
515
514
  file.close()
516
515
 
@@ -545,7 +544,7 @@ def main():
545
544
  data.append(" pass")
546
545
  data.append("")
547
546
  file_path = "%s/%s" % (dir_name_2, "base_test_case.py")
548
- file = codecs.open(file_path, "w+", "utf-8")
547
+ file = open(file_path, mode="w+", encoding="utf-8")
549
548
  file.writelines("\r\n".join(data))
550
549
  file.close()
551
550
 
@@ -554,7 +553,7 @@ def main():
554
553
  data.append(' html = "html"')
555
554
  data.append("")
556
555
  file_path = "%s/%s" % (dir_name_2, "page_objects.py")
557
- file = codecs.open(file_path, "w+", "utf-8")
556
+ file = open(file_path, mode="w+", encoding="utf-8")
558
557
  file.writelines("\r\n".join(data))
559
558
  file.close()
560
559
 
@@ -570,7 +569,7 @@ def main():
570
569
  data.append(" self.assert_element(Page.html)")
571
570
  data.append("")
572
571
  file_path = "%s/%s" % (dir_name_2, "boilerplate_test.py")
573
- file = codecs.open(file_path, "w+", "utf-8")
572
+ file = open(file_path, mode="w+", encoding="utf-8")
574
573
  file.writelines("\r\n".join(data))
575
574
  file.close()
576
575
 
@@ -594,7 +593,7 @@ def main():
594
593
  data.append(' DataPage().add_input_text(self, "Goodbye!")')
595
594
  data.append("")
596
595
  file_path = "%s/%s" % (dir_name_2, "classic_obj_test.py")
597
- file = codecs.open(file_path, "w+", "utf-8")
596
+ file = open(file_path, mode="w+", encoding="utf-8")
598
597
  file.writelines("\r\n".join(data))
599
598
  file.close()
600
599
 
@@ -614,7 +613,7 @@ def main():
614
613
  data.append(' DataPage().add_input_text(sb, "Goodbye!")')
615
614
  data.append("")
616
615
  file_path = "%s/%s" % (dir_name_2, "sb_fixture_test.py")
617
- file = codecs.open(file_path, "w+", "utf-8")
616
+ file = open(file_path, mode="w+", encoding="utf-8")
618
617
  file.writelines("\r\n".join(data))
619
618
  file.close()
620
619
 
@@ -624,7 +623,7 @@ def main():
624
623
  data = []
625
624
  data.append("")
626
625
  file_path = "%s/%s" % (dir_name_3, "__init__.py")
627
- file = codecs.open(file_path, "w+", "utf-8")
626
+ file = open(file_path, mode="w+", encoding="utf-8")
628
627
  file.writelines("\r\n".join(data))
629
628
  file.close()
630
629
 
@@ -652,7 +651,7 @@ def main():
652
651
  )
653
652
  data.append("")
654
653
  file_path = "%s/%s" % (dir_name_3, "google_test.py")
655
- file = codecs.open(file_path, "w+", "utf-8")
654
+ file = open(file_path, mode="w+", encoding="utf-8")
656
655
  file.writelines("\r\n".join(data))
657
656
  file.close()
658
657
 
@@ -670,7 +669,7 @@ def main():
670
669
  data.append(' search_results = "div#center_col"')
671
670
  data.append("")
672
671
  file_path = "%s/%s" % (dir_name_3, "google_objects.py")
673
- file = codecs.open(file_path, "w+", "utf-8")
672
+ file = open(file_path, mode="w+", encoding="utf-8")
674
673
  file.writelines("\r\n".join(data))
675
674
  file.close()
676
675
 
@@ -702,7 +701,7 @@ def main():
702
701
  data.append(' self.assert_element("div#login_button_container")')
703
702
  data.append("")
704
703
  file_path = "%s/%s" % (dir_name_3, "swag_labs_test.py")
705
- file = codecs.open(file_path, "w+", "utf-8")
704
+ file = open(file_path, mode="w+", encoding="utf-8")
706
705
  file.writelines("\r\n".join(data))
707
706
  file.close()
708
707
 
@@ -729,7 +728,7 @@ def main():
729
728
  data.append(' sb.assert_element("div#login_button_container")')
730
729
  data.append("")
731
730
  file_path = "%s/%s" % (dir_name_3, "sb_swag_test.py")
732
- file = codecs.open(file_path, "w+", "utf-8")
731
+ file = open(file_path, mode="w+", encoding="utf-8")
733
732
  file.writelines("\r\n".join(data))
734
733
  file.close()
735
734
 
@@ -756,7 +755,7 @@ def main():
756
755
  data.append(" ├── sb_swag_test.py")
757
756
  data.append(" └── swag_labs_test.py")
758
757
  file_path = "%s/%s" % (dir_name, "outline.rst")
759
- file = codecs.open(file_path, "w+", "utf-8")
758
+ file = open(file_path, mode="w+", encoding="utf-8")
760
759
  file.writelines("\r\n".join(data))
761
760
  file.close()
762
761
  if " " not in file_path:
@@ -40,7 +40,6 @@ Output:
40
40
  BaseCase format supports Languages or Recorder Mode.
41
41
  UC Mode automatically uses English with SB() format.
42
42
  """
43
- import codecs
44
43
  import colorama
45
44
  import os
46
45
  import sys
@@ -413,7 +412,7 @@ def main():
413
412
  continue
414
413
  new_data.append(line)
415
414
  data = new_data
416
- file = codecs.open(file_path, "w+", "utf-8")
415
+ file = open(file_path, mode="w+", encoding="utf-8")
417
416
  file.writelines("\r\n".join(data))
418
417
  file.close()
419
418
  if " " not in file_name:
@@ -22,7 +22,6 @@ Output:
22
22
  and use "serif" theme with "slide" transition.
23
23
  The slides can be used as a basic boilerplate.
24
24
  """
25
- import codecs
26
25
  import colorama
27
26
  import os
28
27
  import sys
@@ -273,7 +272,7 @@ def main():
273
272
  continue
274
273
  new_data.append(line)
275
274
  data = new_data
276
- file = codecs.open(file_path, "w+", "utf-8")
275
+ file = open(file_path, mode="w+", encoding="utf-8")
277
276
  file.writelines("\r\n".join(data))
278
277
  file.close()
279
278
  if " " not in file_name:
@@ -29,7 +29,6 @@ Output:
29
29
  Creates a new SeleniumBase test using the Recorder.
30
30
  If the filename already exists, an error is raised.
31
31
  """
32
- import codecs
33
32
  import colorama
34
33
  import shutil
35
34
  import os
@@ -240,7 +239,7 @@ def main():
240
239
  d2.append("")
241
240
  data = d2
242
241
 
243
- file = codecs.open(file_path, "w+", "utf-8")
242
+ file = open(file_path, mode="w+", encoding="utf-8")
244
243
  file.writelines("\r\n".join(data))
245
244
  file.close()
246
245
  success = (
@@ -8,7 +8,6 @@ Output:
8
8
  have been replaced with variable names defined in
9
9
  "page_objects.py", supporting the Page Object Pattern.
10
10
  """
11
- import codecs
12
11
  import os
13
12
  import re
14
13
  import sys
@@ -136,7 +135,7 @@ def create_objects_file(selector_list_dict=None):
136
135
  data.append(' html = "html"')
137
136
  data.append("")
138
137
  file_path = PAGE_OBJECTS_FILE
139
- file = codecs.open(file_path, "w+", "utf-8")
138
+ file = open(file_path, mode="w+", encoding="utf-8")
140
139
  file.writelines("\r\n".join(data))
141
140
  file.close()
142
141
  if not selector_list_dict:
@@ -150,7 +149,7 @@ def scan_objects_file():
150
149
  create_objects_file()
151
150
 
152
151
  page_selectors = {}
153
- with open(PAGE_OBJECTS_FILE, "r", encoding="utf-8") as f:
152
+ with open(PAGE_OBJECTS_FILE, mode="r", encoding="utf-8") as f:
154
153
  all_code = f.read()
155
154
 
156
155
  var_names = []
@@ -3090,7 +3089,7 @@ def main(shell_command):
3090
3089
  "Expecting: %s\n" % (seleniumbase_file, expected_arg)
3091
3090
  )
3092
3091
 
3093
- with open(seleniumbase_file, "r", encoding="utf-8") as f:
3092
+ with open(seleniumbase_file, mode="r", encoding="utf-8") as f:
3094
3093
  all_code = f.read()
3095
3094
  if "def test_" not in all_code:
3096
3095
  raise Exception(
@@ -3189,7 +3188,7 @@ def main(shell_command):
3189
3188
  # Create SeleniumBase test file
3190
3189
  base_file_name = seleniumbase_file.split(".py")[0]
3191
3190
  converted_file_name = base_file_name + ".py" # Change end to make a copy
3192
- out_file = codecs.open(converted_file_name, "w+", encoding="utf-8")
3191
+ out_file = open(converted_file_name, mode="w+", encoding="utf-8")
3193
3192
  out_file.writelines(seleniumbase_code)
3194
3193
  out_file.close()
3195
3194
  print('\n>>> ["%s"] was updated!\n' % converted_file_name)
@@ -123,7 +123,7 @@ def main():
123
123
 
124
124
  all_code = None
125
125
  with open(
126
- file_to_print, "r+", encoding="utf-8", errors="ignore"
126
+ file_to_print, mode="r+", encoding="utf-8", errors="ignore"
127
127
  ) as f:
128
128
  all_code = f.read()
129
129
  all_code = all_code.replace("\t", " ")
@@ -2006,14 +2006,12 @@ def _repair_edgedriver(edge_version):
2006
2006
 
2007
2007
 
2008
2008
  def _mark_driver_repaired():
2009
- import codecs
2010
-
2011
2009
  abs_path = os.path.abspath(".")
2012
2010
  driver_repaired_lock = constants.MultiBrowser.DRIVER_REPAIRED
2013
2011
  file_path = os.path.join(abs_path, driver_repaired_lock)
2014
2012
  if not os.path.exists(DOWNLOADS_FOLDER):
2015
2013
  os.makedirs(DOWNLOADS_FOLDER)
2016
- out_file = codecs.open(file_path, "w+", encoding="utf-8")
2014
+ out_file = open(file_path, mode="w+", encoding="utf-8")
2017
2015
  out_file.writelines("")
2018
2016
  out_file.close()
2019
2017
 
@@ -2398,6 +2396,19 @@ def _set_chrome_options(
2398
2396
  and not recorder_ext
2399
2397
  and (not extension_zip and not extension_dir)
2400
2398
  ):
2399
+ if (
2400
+ binary_location
2401
+ and isinstance(binary_location, str)
2402
+ and (
2403
+ binary_location.lower().endswith("comet")
2404
+ or binary_location.lower().endswith("comet.exe")
2405
+ or binary_location.lower().endswith("atlas")
2406
+ or binary_location.lower().endswith("atlas.exe")
2407
+ )
2408
+ ):
2409
+ # AI browsers don't like Incognito / Guest Mode
2410
+ incognito = False
2411
+ guest_mode = False
2401
2412
  if incognito:
2402
2413
  # Use Chrome's Incognito Mode
2403
2414
  # Incognito Mode prevents Chrome extensions from loading,