setup-selenium-testing 0.1.8__py3-none-any.whl → 0.3.0__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
@@ -160,6 +160,7 @@ class SetupSelenium:
160
160
  @staticmethod
161
161
  def log_options(options: ArgOptions) -> None:
162
162
  """Logs the browser option in clean format"""
163
+ # logger.debug(f"{json.dumps(options.capabilities, indent=2)}") # noqa: ERA001
163
164
  opts = "\n".join(options.arguments)
164
165
  logger.debug(f"{opts}")
165
166
 
@@ -282,6 +283,24 @@ class SetupSelenium:
282
283
  options.set_preference(
283
284
  "extensions.formautofill.addresses.capture.enabled", False
284
285
  )
286
+ # By default, headless Firefox runs as though no pointers capabilities
287
+ # are available.
288
+ # https://github.com/microsoft/playwright/issues/7769#issuecomment-966098074
289
+ #
290
+ # This impacts React Spectrum which uses an '(any-pointer: fine)'
291
+ # media query to determine font size. It also causes certain chart
292
+ # elements to always be visible that should only be visible on
293
+ # hover.
294
+ #
295
+ # Available values for pointer capabilities:
296
+ # NO_POINTER 0x00
297
+ # COARSE_POINTER 0x01
298
+ # FINE_POINTER 0x02
299
+ # HOVER_CAPABLE_POINTER 0x04
300
+ #
301
+ # Setting to 0x02 | 0x04 says the system supports a mouse
302
+ options.set_preference("ui.primaryPointerCapabilities", 0x02 | 0x04)
303
+ options.set_preference("ui.allPointerCapabilities", 0x02 | 0x04)
285
304
  return options
286
305
 
287
306
  @staticmethod
@@ -338,9 +357,29 @@ class SetupSelenium:
338
357
  def chrome_options() -> webdriver.ChromeOptions:
339
358
  """Default options for chrome"""
340
359
  logger.debug("Setting up chrome options")
360
+ # the ultimate list of flags (created by the chromium dev group)
361
+ # https://peter.sh/experiments/chromium-command-line-switches/
362
+
341
363
  # The list of options set below mostly came from this StackOverflow post
342
364
  # https://stackoverflow.com/q/48450594/2532408
343
365
  opts = (
366
+ # "--disable-features=ImprovedCookieControls,LazyFrameLoading,GlobalMediaControls,DestroyProfileOnBrowserClose,MediaRouter,DialMediaRouteProvider,AcceptCHFrame,AutoExpandDetailsElement,CertificateTransparencyComponentUpdater,AvoidUnnecessaryBeforeUnloadCheckSync", # noqa: ERA001
367
+ "--disable-back-forward-cache",
368
+ "--disable-background-timer-throttling",
369
+ "--disable-breakpad",
370
+ "--disable-component-extensions-with-background-pages",
371
+ "--disable-ipc-flooding-protection",
372
+ "--enable-features=NetworkService,NetworkServiceInProcess",
373
+ "--enable-logging",
374
+ "--export-tagged-pdf",
375
+ "--force-color-profile=srgb",
376
+ "--metrics-recording-only",
377
+ "--mute-audio",
378
+ "--remote-debugging-pipe",
379
+ # fixes MUI fade issue
380
+ "--disable-renderer-backgrounding",
381
+ # fixes actionchains in headless
382
+ "--disable-backgrounding-occluded-windows",
344
383
  "--disable-extensions",
345
384
  "--allow-running-insecure-content",
346
385
  "--ignore-certificate-errors",
@@ -378,7 +417,7 @@ class SetupSelenium:
378
417
  options.binary_location = binary
379
418
 
380
419
  if headless:
381
- options.add_argument("--headless")
420
+ options.add_argument("--headless=new")
382
421
 
383
422
  logging_prefs = {"browser": "OFF", "performance": "OFF", "driver": "OFF"}
384
423
 
@@ -475,9 +514,29 @@ class SetupSelenium:
475
514
  def edge_options() -> webdriver.EdgeOptions:
476
515
  """Default options for edgedriver"""
477
516
  logger.debug("Setting up edge options")
517
+ # the ultimate list of flags (created by the chromium dev group)
518
+ # https://peter.sh/experiments/chromium-command-line-switches/
519
+
478
520
  # The list of options set below mostly came from this StackOverflow post
479
521
  # https://stackoverflow.com/q/48450594/2532408
480
522
  opts = (
523
+ # "--disable-features=ImprovedCookieControls,LazyFrameLoading,GlobalMediaControls,DestroyProfileOnBrowserClose,MediaRouter,DialMediaRouteProvider,AcceptCHFrame,AutoExpandDetailsElement,CertificateTransparencyComponentUpdater,AvoidUnnecessaryBeforeUnloadCheckSync", # noqa: ERA001
524
+ "--disable-back-forward-cache",
525
+ "--disable-background-timer-throttling",
526
+ "--disable-breakpad",
527
+ "--disable-component-extensions-with-background-pages",
528
+ "--disable-ipc-flooding-protection",
529
+ "--enable-features=NetworkService,NetworkServiceInProcess",
530
+ "--enable-logging",
531
+ "--export-tagged-pdf",
532
+ "--force-color-profile=srgb",
533
+ "--metrics-recording-only",
534
+ "--mute-audio",
535
+ "--remote-debugging-pipe",
536
+ # fixes MUI fade issue
537
+ "--disable-renderer-backgrounding",
538
+ # fixes actionchains in headless
539
+ "--disable-backgrounding-occluded-windows",
481
540
  "--disable-extensions",
482
541
  "--allow-running-insecure-content",
483
542
  "--ignore-certificate-errors",
@@ -523,12 +582,11 @@ class SetupSelenium:
523
582
  # by default performance is disabled.
524
583
  if enable_log_performance:
525
584
  logging_prefs["performance"] = "ALL"
526
- options.set_capability(
585
+ options.add_experimental_option(
527
586
  "perfLoggingPrefs",
528
587
  {
529
588
  "enableNetwork": True,
530
589
  "enablePage": False,
531
- "enableTimeline": False,
532
590
  },
533
591
  )
534
592
 
@@ -1,18 +1,16 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: setup-selenium-testing
3
- Version: 0.1.8
3
+ Version: 0.3.0
4
4
  Summary: Setup Selenium for automation testing
5
- Home-page: https://github.com/bandophahita/setup_selenium
6
5
  License: MIT
7
6
  Author: Marcel Wilson
8
- Author-email: trenchrats@gmail.com
9
- Requires-Python: >=3.8,<4.0
7
+ Author-email: trenchrats+pypi@gmail.com
8
+ Requires-Python: >=3.9,<4.0
10
9
  Classifier: Intended Audience :: Developers
11
10
  Classifier: License :: OSI Approved :: MIT License
12
11
  Classifier: Natural Language :: English
13
12
  Classifier: Operating System :: OS Independent
14
13
  Classifier: Programming Language :: Python :: 3
15
- Classifier: Programming Language :: Python :: 3.8
16
14
  Classifier: Programming Language :: Python :: 3.9
17
15
  Classifier: Programming Language :: Python :: 3.10
18
16
  Classifier: Programming Language :: Python :: 3.11
@@ -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=WyYo_VsqD_Z5wo54K_B8FfXRzNCyd6M9Nw1kqkFPH3k,25170
4
+ setup_selenium_testing-0.3.0.dist-info/LICENSE,sha256=KGdE-1D1chm3UNFtfE8x-EpVxhmv2zFx8oltbO8M1qE,1070
5
+ setup_selenium_testing-0.3.0.dist-info/METADATA,sha256=JQ7bnIg03oQ-7rez5TjR-Bg_9eN7ub66LD8PK6WZMxA,5305
6
+ setup_selenium_testing-0.3.0.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
7
+ setup_selenium_testing-0.3.0.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: poetry-core 2.0.0
2
+ Generator: poetry-core 2.1.1
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
@@ -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=asqQhE6fXcivb2MK3PL90TcQcCBVr_2Mgx-_CULxfUk,21921
4
- setup_selenium_testing-0.1.8.dist-info/LICENSE,sha256=KGdE-1D1chm3UNFtfE8x-EpVxhmv2zFx8oltbO8M1qE,1070
5
- setup_selenium_testing-0.1.8.dist-info/METADATA,sha256=QMQyQUZEXF78zxdc30b9WS_OPJz57zRflBSI1Onzkno,5408
6
- setup_selenium_testing-0.1.8.dist-info/WHEEL,sha256=RaoafKOydTQ7I_I3JTrPCg6kUmTgtm4BornzOqyEfJ8,88
7
- setup_selenium_testing-0.1.8.dist-info/RECORD,,