forked from coding-ai/EasyApply-Linkedin
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathe2e_tests.py
113 lines (107 loc) · 2.73 KB
/
e2e_tests.py
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
import pytest
from selenium import webdriver
from selenium.webdriver.firefox.service import Service as FirefoxService
from main import EasyApplyLinkedin
@pytest.fixture
def setup_browser():
service = FirefoxService(executable_path="/usr/local/bin/geckodriver")
driver = webdriver.Firefox(service=service)
yield driver
driver.quit()
@pytest.fixture
def setup_bot(setup_browser):
data = {
"email": "[email protected]",
"password": "***,****,****",
"keywords": [
"TypeScript",
"Angular",
"React",
"React Native",
"Node",
"JavaScript",
"Frontend Engineer",
"Full-Stack Engineer",
"Backend Engineer"
],
"keywordsToAvoid": [
"C++",
".NET",
"Analyst",
"PHP",
"Python",
"C",
"Java",
"Go",
"Rust",
"Kotlin",
"Swift",
"Objective-C",
"Rust",
"Kotlin",
"Swift",
"C#",
".Net",
".net",
"Robotic",
"Data",
"Science",
"Cloud",
"Robotics",
"AI",
"ML",
"DL",
"NLP",
"CV",
"DevOps",
"Solidity"
],
"locations": [
"Canada",
"Portugal",
"Switzerland",
"Belgium",
"Netherlands",
"DACH",
"Benelux",
"European Union",
"European Economic Area",
"Germany",
"Spain",
"United States",
"United Kingdom"
],
"driver_path": "/usr/local/bin/geckodriver",
"sortBy": "R",
"filters": {
"easy_apply": True,
"experience": [],
"jobType": [
"Full-time",
"Contract"
],
"timePostedRange": [],
"workplaceType": [
"Remote",
"Hybrid"
],
"less_than_10_applicants": False
}
}
bot = EasyApplyLinkedin(data)
bot.driver = setup_browser
return bot
def test_login_linkedin(setup_bot):
setup_bot.login_linkedin()
assert "feed" in setup_bot.driver.current_url
def test_job_search(setup_bot):
setup_bot.login_linkedin()
setup_bot.job_search()
assert "jobs/search" in setup_bot.driver.current_url
def test_find_offers(setup_bot):
setup_bot.login_linkedin()
setup_bot.job_search()
setup_bot.find_offers()
assert len(setup_bot.applied_companies) > 0
if __name__ == "__main__":
pytest.main()