-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_harmonogram.py
38 lines (31 loc) · 1.77 KB
/
test_harmonogram.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
# Generated by Selenium IDE
import pytest
import time
import json
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.support import expected_conditions
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
class TestOlxmotokategorie():
def setup_method(self, method):
self.driver = webdriver.Chrome()
self.vars = {}
def teardown_method(self, method):
self.driver.quit()
def test_harmonogram(self):
self.driver.get("http://ii.up.krakow.pl/")
harm = self.driver.find_element_by_xpath("/html/body/div[1]/div[3]/div[2]/div[4]/div[2]/a[1]")
time.sleep(2)
harm.click()
time.sleep(2)
assert self.driver.find_element_by_xpath("/html/body/div/div[4]/div/div/div/h1[1]").text == "STUDIA STACJONARNE I STOPNIA"
assert self.driver.find_element_by_xpath("/html/body/div/div[4]/div/div/div/div[1]/table/tbody/tr[1]/td[3]").text == "III rok"
assert self.driver.find_element_by_xpath("/html/body/div/div[4]/div/div/div/div[1]/table/tbody/tr[2]/td[3]/ul/li/span[4]").text == "mgr Imie Nazwisko"
assert self.driver.find_element_by_xpath("/html/body/div/div[4]/div/div/div/div[1]/table/tbody/tr[2]/td[3]/ul/li/span[2]").text == "21.02.2020"
assert self.driver.find_element_by_xpath("/html/body/div/div[4]/div/div/div/div[1]/table/tbody/tr[2]/td[3]/ul/li/div/a[2]").text == "Harmonogram"
self.driver.find_element_by_xpath("/html/body/div/div[4]/div/div/div/div[1]/table/tbody/tr[2]/td[3]/ul/li/div/a[1]").click()
if __name__ == '__main__':
pytest.main()