seleniumUts 1.2.2__tar.gz → 1.2.4__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: seleniumUts
3
- Version: 1.2.2
3
+ Version: 1.2.4
4
4
  Summary: Zdek Util libraries for Pythom coding
5
5
  Home-page: https://github.com/ZdekPyPi/SeleniumUts
6
6
  Author: Zdek Development team
@@ -10,6 +10,7 @@ from glob import glob
10
10
  import base64
11
11
  import secrets
12
12
  import string
13
+ import os
13
14
 
14
15
  from contextlib import contextmanager
15
16
  import tempfile
@@ -288,7 +289,7 @@ class SeleniumUts:
288
289
 
289
290
  self.driver.switch_to.window(new_window)
290
291
 
291
- def back_main_tab(self):
292
+ def back_main_tab(self,close_others=False):
292
293
  """
293
294
  Desc:
294
295
  Switch back to the first browser tab.\n
@@ -296,6 +297,12 @@ class SeleniumUts:
296
297
  """
297
298
  windows = self.driver.window_handles
298
299
  self.driver.switch_to.window(windows[0])
300
+ if close_others and len(windows) > 1:
301
+ for window in windows[1:]:
302
+ self.driver.switch_to.window(window)
303
+ self.driver.close()
304
+ self.driver.switch_to.window(windows[0])
305
+
299
306
 
300
307
  def go_to_tab(self, index):
301
308
  """
@@ -610,6 +617,7 @@ class SeleniumUts:
610
617
  web_options.add_argument(op)
611
618
 
612
619
  if profile:
620
+ os.makedirs(profile, exist_ok=True)
613
621
  web_options.add_argument(r"user-data-dir={}".format(profile))
614
622
 
615
623
  web_options.headless = False
@@ -150,7 +150,7 @@ class CWebElement(WebElement):
150
150
  thickness: A espessura da borda (ex: '3px', '5px').
151
151
  """
152
152
  if not mark:
153
- return
153
+ return self
154
154
  # Define o novo estilo da borda
155
155
  new_style = f"{thickness} solid {color}"
156
156
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: seleniumUts
3
- Version: 1.2.2
3
+ Version: 1.2.4
4
4
  Summary: Zdek Util libraries for Pythom coding
5
5
  Home-page: https://github.com/ZdekPyPi/SeleniumUts
6
6
  Author: Zdek Development team
@@ -10,7 +10,7 @@ classifiers = [
10
10
 
11
11
  setup(
12
12
  name="seleniumUts",
13
- version="1.2.2",
13
+ version="1.2.4",
14
14
  packages=find_packages(),
15
15
  long_description=open("README.md", encoding="utf-8").read(),
16
16
  long_description_content_type="text/markdown",
File without changes
File without changes