-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathoffer.py
42 lines (33 loc) · 1.59 KB
/
offer.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
import unittest
from selenium import webdriver
from selenium.webdriver.support.ui import Select
class AutomatedTesterOffer(unittest.TestCase):
def setUp(self):
self.driver = webdriver.Chrome()
self.driver.get("https://stxnext.com/job-offers/test-automation-specialist-wroclaw/")
def test_salary(self):
seniority = Select(self.driver.find_element_by_css_selector(
'select[name="seniority"]'
))
seniority.select_by_value('regular')
salary_min = self.driver.find_element_by_id('salary-net-min')
salary_max = self.driver.find_element_by_id('salary-net-max')
self.assertEqual(salary_min.text, '4700')
self.assertEqual(salary_max.text, '8400')
seniority.select_by_value('senior')
salary_min = self.driver.find_element_by_id('salary-net-min')
salary_max = self.driver.find_element_by_id('salary-net-max')
self.assertEqual(salary_min.text, '6700')
self.assertEqual(salary_max.text, '12100')
def test_skills(self):
skills = self.driver.find_element_by_class_name('skill')
text_skills = [skill.text for skill in skills]
self.assertIn('English B1', text_skills)
self.assertIn('Communication', text_skills)
self.assertIn('Test Rail', text_skills)
def test_apply(self):
self.driver.find_element_by_xpath('//button[text()="Apply"]').click()
thanks_message = self.driver.find_element_by_class_name('thank-you')
self.assertEqual(thanks_message.text, 'Thanks for applying to STX!')
if __name__ == '__main__':
unittest.main()