fix: added 'short' function
This commit is contained in:
@@ -3,6 +3,7 @@ from common.utils.selenium import (
|
|||||||
sleep,
|
sleep,
|
||||||
locate,
|
locate,
|
||||||
click,
|
click,
|
||||||
|
short,
|
||||||
setup,
|
setup,
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -11,5 +12,6 @@ __all__ = [
|
|||||||
'sleep',
|
'sleep',
|
||||||
'locate',
|
'locate',
|
||||||
'click',
|
'click',
|
||||||
|
'short',
|
||||||
'setup',
|
'setup',
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -73,8 +73,11 @@ def click(selector: str|WebElement, wait=True, condition=False):
|
|||||||
try: driver.execute_script("arguments[0].removeEventListener('click', __%s__);" % identity, element)
|
try: driver.execute_script("arguments[0].removeEventListener('click', __%s__);" % identity, element)
|
||||||
except: pass
|
except: pass
|
||||||
|
|
||||||
|
def short():
|
||||||
|
return ''.join(random.choices(string.digits + string.ascii_uppercase + string.ascii_lowercase, k=8))
|
||||||
|
|
||||||
def setup(a: WebDriver, b: dict):
|
def setup(a: WebDriver, b: dict):
|
||||||
global identity, driver
|
global identity, driver
|
||||||
identity = ''.join(random.choices(string.ascii_uppercase + string.digits, k=8))
|
identity = short()
|
||||||
driver = a
|
driver = a
|
||||||
parameters.update(b)
|
parameters.update(b)
|
||||||
|
|||||||
Reference in New Issue
Block a user