Skip to content

Commit 976f082

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 1909f03 commit 976f082

File tree

2 files changed

+25
-9
lines changed

2 files changed

+25
-9
lines changed

jules-scratch/verification/verify_home_screen.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
11
import asyncio
22
import random
33
import string
4+
45
from playwright.async_api import async_playwright, expect
56

7+
68
async def main():
79
async with async_playwright() as p:
810
browser = await p.chromium.launch()
911
context = await browser.new_context()
1012
page = await context.new_page()
1113

1214
# Generate random user credentials
13-
random_suffix = ''.join(random.choices(string.ascii_lowercase + string.digits, k=8))
15+
random_suffix = "".join(
16+
random.choices(string.ascii_lowercase + string.digits, k=8)
17+
)
1418
email = f"testuser_{random_suffix}@example.com"
1519
password = "securepassword123"
1620
name = "Test User"
@@ -39,5 +43,6 @@ async def main():
3943

4044
await browser.close()
4145

46+
4247
if __name__ == "__main__":
4348
asyncio.run(main())

jules-scratch/verification/verify_home_screen_selenium.py

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,26 @@
11
import random
22
import string
33
import time
4+
45
from selenium import webdriver
56
from selenium.webdriver.common.by import By
6-
from selenium.webdriver.support.ui import WebDriverWait
77
from selenium.webdriver.support import expected_conditions as EC
8+
from selenium.webdriver.support.ui import WebDriverWait
9+
810

911
def main():
1012
options = webdriver.ChromeOptions()
11-
options.add_argument('--headless')
12-
options.add_argument('--no-sandbox')
13-
options.add_argument('--disable-dev-shm-usage')
13+
options.add_argument("--headless")
14+
options.add_argument("--no-sandbox")
15+
options.add_argument("--disable-dev-shm-usage")
1416

1517
driver = webdriver.Chrome(options=options)
1618

1719
try:
1820
# Generate random user credentials
19-
random_suffix = ''.join(random.choices(string.ascii_lowercase + string.digits, k=8))
21+
random_suffix = "".join(
22+
random.choices(string.ascii_lowercase + string.digits, k=8)
23+
)
2024
email = f"testuser_{random_suffix}@example.com"
2125
password = "securepassword123"
2226
name = "Test User"
@@ -26,14 +30,20 @@ def main():
2630

2731
# Wait for the "Don't have an account? Sign Up" button to be clickable
2832
signup_button = WebDriverWait(driver, 30).until(
29-
EC.element_to_be_clickable((By.XPATH, "//*[contains(text(), 'Don\\'t have an account? Sign Up')]"))
33+
EC.element_to_be_clickable(
34+
(By.XPATH, "//*[contains(text(), 'Don\\'t have an account? Sign Up')]")
35+
)
3036
)
3137
signup_button.click()
3238

3339
# Fill in the signup form
34-
WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.XPATH, "//*[@placeholder='Name']"))).send_keys(name)
40+
WebDriverWait(driver, 10).until(
41+
EC.presence_of_element_located((By.XPATH, "//*[@placeholder='Name']"))
42+
).send_keys(name)
3543
driver.find_element(By.XPATH, "//*[@placeholder='Email']").send_keys(email)
36-
driver.find_element(By.XPATH, "//*[@placeholder='Password']").send_keys(password)
44+
driver.find_element(By.XPATH, "//*[@placeholder='Password']").send_keys(
45+
password
46+
)
3747

3848
# Submit the form
3949
# It's better to wait for the element to be clickable
@@ -53,5 +63,6 @@ def main():
5363
finally:
5464
driver.quit()
5565

66+
5667
if __name__ == "__main__":
5768
main()

0 commit comments

Comments
 (0)