fix: added 'short' function
This commit is contained in:
@@ -3,6 +3,7 @@ from common.utils.selenium import (
|
||||
sleep,
|
||||
locate,
|
||||
click,
|
||||
short,
|
||||
setup,
|
||||
)
|
||||
|
||||
@@ -11,5 +12,6 @@ __all__ = [
|
||||
'sleep',
|
||||
'locate',
|
||||
'click',
|
||||
'short',
|
||||
'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)
|
||||
except: pass
|
||||
|
||||
def short():
|
||||
return ''.join(random.choices(string.digits + string.ascii_uppercase + string.ascii_lowercase, k=8))
|
||||
|
||||
def setup(a: WebDriver, b: dict):
|
||||
global identity, driver
|
||||
identity = ''.join(random.choices(string.ascii_uppercase + string.digits, k=8))
|
||||
identity = short()
|
||||
driver = a
|
||||
parameters.update(b)
|
||||
|
||||
Reference in New Issue
Block a user