Skip to content

Commit 8d7fe9d

Browse files
committed
v1.0.5
1 parent 93f5f9c commit 8d7fe9d

File tree

2 files changed

+8
-17
lines changed

2 files changed

+8
-17
lines changed

selenium_helpers/__init__.py

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
from typing import Union
88

9+
910
def click(driver: WebDriver, element):
1011
"""
1112
Used to resolve issues caused while clicking an element.
@@ -23,10 +24,7 @@ def __init__(self, text: str):
2324
self.text = text
2425

2526
def __call__(self, driver):
26-
element = driver.find_element(
27-
By.XPATH,
28-
f'//input[@placeholder="{self.text}"]'
29-
)
27+
element = driver.find_element(By.XPATH, f'//input[@placeholder="{self.text}"]')
3028
return element or False
3129

3230

@@ -54,8 +52,7 @@ def __init__(self, text: str):
5452

5553
def __call__(self, driver: WebDriver):
5654
elements = driver.find_elements(
57-
By.XPATH,
58-
f'//*[contains(text(), "{self.text}")]',
55+
By.XPATH, f'//*[contains(text(), "{self.text}")]',
5956
)
6057
return elements or False
6158

@@ -76,11 +73,8 @@ def __call__(self, driver: WebDriver):
7673

7774

7875
def wait_until(
79-
driver: WebDriver,
80-
expected_condition,
81-
value,
82-
timeout: int = 10
83-
):
76+
driver: WebDriver, expected_condition, value, timeout: int = 10,
77+
):
8478
"""
8579
Allows you to wait until some condition is met.
8680
@@ -120,11 +114,8 @@ def wait_until(
120114

121115

122116
def potential_refresh(
123-
driver: WebDriver,
124-
expected_condition,
125-
value,
126-
chance: float = 0.99
127-
):
117+
driver: WebDriver, expected_condition, value, chance: float = 0.99,
118+
):
128119
if random.uniform(0, 1) > chance:
129120
driver.refresh()
130121
return wait_until(driver, expected_condition, value)

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ def readme():
88

99
setuptools.setup(
1010
name='selenium-helpers',
11-
version='1.0.4',
11+
version='1.0.5',
1212
description='Tools to make certain selenium tasks more straightforward.',
1313
long_description=readme(),
1414
long_description_content_type='text/markdown',

0 commit comments

Comments
 (0)