-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
76 lines (66 loc) · 1.73 KB
/
main.py
File metadata and controls
76 lines (66 loc) · 1.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
""""
author: fabri
update: 20/01/2025
"""
from helium import *
import configparser
import time
def setup():
"""Initial configuration"""
config = configparser.ConfigParser()
config.read('config.ini')
url = config['web']['url']
start_chrome("https://www.google.com/")
go_to(url)
time.sleep(2)
return url
def test_filters():
"""Test the filters button"""
try:
if Button("Filters").exists():
click("Filters")
print("✓ Filters opened")
time.sleep(1)
#TODO ADD NEW INTERACTIONS HERE
return True
except Exception as e:
print(f"✗ Error in filters: {e}")
return False
def test_navigation():
"""Test navigation between tabs"""
try:
# Go to past events
click("PAST EVENTS")
print("✓ Navigated to PAST EVENTS")
time.sleep(2)
# Return to coming events
click("COMING EVENTS")
print("✓ Navigated to COMING EVENTS")
time.sleep(2)
return True
except Exception as e:
print(f"✗ Error in navigation: {e}")
return False
def test_search(query):
"""Test the search functionality"""
try:
write(query, into="Search")
press(ENTER)
print(f"✓ Search performed: {query}")
time.sleep(2)
return True
except Exception as e:
print(f"✗ Error in search: {e}")
return False
def main():
url = setup()
print(f"Navigating to: {url}\n")
# Execute tests
test_filters()
test_navigation()
test_search("code quality")
print("\n=== Tests completed ===")
input("Press Enter to close...")
kill_browser()
if __name__ == "__main__":
main()