setup-selenium-testing 1.0.2__py3-none-any.whl → 1.0.4__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.
@@ -128,6 +128,9 @@ class SetupSelenium:
128
128
 
129
129
  sm = SeleniumManager()
130
130
 
131
+ if browser == Browser.EDGE:
132
+ os.environ["SE_DRIVER_MIRROR_URL"] = "https://msedgedriver.microsoft.com"
133
+
131
134
  if NEW_SELENIUM:
132
135
  args = [f"{sm._get_binary()}", "--browser", browser]
133
136
  else:
@@ -432,7 +435,7 @@ class SetupSelenium:
432
435
  return driver
433
436
 
434
437
  @staticmethod
435
- def set_throttle(driver: webdriver.Chrome):
438
+ def set_network_throttle(driver: webdriver.Chrome, network_type: str = "SLOW3G"):
436
439
  """Experimental settings to slow down browser"""
437
440
  # experimental settings to slow down browser
438
441
  # @formatter:off
@@ -448,8 +451,7 @@ class SetupSelenium:
448
451
  }
449
452
  # fmt: on
450
453
  # @formatter:on
451
- net_type = "SLOW3G"
452
- net_lat, net_down, net_up = network_conditions[net_type]
454
+ net_lat, net_down, net_up = network_conditions[network_type]
453
455
  net_down = net_down / 8 * 1024
454
456
  net_up = net_up / 8 * 1024
455
457
  driver.set_network_conditions(
@@ -458,7 +460,11 @@ class SetupSelenium:
458
460
  download_throughput=net_down,
459
461
  upload_throughput=net_up,
460
462
  )
461
- driver.execute_cdp_cmd("Emulation.setCPUThrottlingRate", {"rate": 100})
463
+
464
+ @staticmethod
465
+ def set_cpu_throttle(driver: webdriver.Chrome, rate: int = 10):
466
+ """Experimental settings to slow down browser"""
467
+ driver.execute_cdp_cmd("Emulation.setCPUThrottlingRate", {"rate": rate})
462
468
 
463
469
  @staticmethod
464
470
  def edge_options() -> webdriver.EdgeOptions:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: setup-selenium-testing
3
- Version: 1.0.2
3
+ Version: 1.0.4
4
4
  Summary: Setup Selenium for automation testing
5
5
  License: MIT
6
6
  Author: Marcel Wilson
@@ -0,0 +1,7 @@
1
+ setup_selenium/__init__.py,sha256=-w9Vvo72ZLaEyIEfc_Nh0bDDJz9W0pOy4rkRXurIJHI,63
2
+ setup_selenium/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
+ setup_selenium/setup_selenium.py,sha256=gp1RqWGXdgxVotFmq_IJVGQURrb3laOoGcVP0c4dWBc,22139
4
+ setup_selenium_testing-1.0.4.dist-info/LICENSE,sha256=KGdE-1D1chm3UNFtfE8x-EpVxhmv2zFx8oltbO8M1qE,1070
5
+ setup_selenium_testing-1.0.4.dist-info/METADATA,sha256=9ZaLVTdseyRKL-Mv0jD6gryHNcv3PFHo5-3c8j0OA2I,6071
6
+ setup_selenium_testing-1.0.4.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
7
+ setup_selenium_testing-1.0.4.dist-info/RECORD,,
@@ -1,7 +0,0 @@
1
- setup_selenium/__init__.py,sha256=-w9Vvo72ZLaEyIEfc_Nh0bDDJz9W0pOy4rkRXurIJHI,63
2
- setup_selenium/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
- setup_selenium/setup_selenium.py,sha256=qqnq-jErsovCJW2qMyx2mtNUqVl-h_VQXGh8Vzh4uJM,21857
4
- setup_selenium_testing-1.0.2.dist-info/LICENSE,sha256=KGdE-1D1chm3UNFtfE8x-EpVxhmv2zFx8oltbO8M1qE,1070
5
- setup_selenium_testing-1.0.2.dist-info/METADATA,sha256=iIGM3X1I_PlyFcXL7lHpRlYzcNPeIsdTD4YgpXKRFf0,6071
6
- setup_selenium_testing-1.0.2.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
7
- setup_selenium_testing-1.0.2.dist-info/RECORD,,