forked from madlenkk/webtesting
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_installation.py
31 lines (23 loc) · 1.01 KB
/
test_installation.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
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
# chromedriver binary must be in PATH
browser = webdriver.Chrome('chromedriver')
browser.get('https://github.com/madlenkk/webtesting/blob/master/installation/test_page.md')
try:
img = browser.find_element_by_xpath('//*[@id="readme"]/article/p[1]/a/img')
img.click()
re = WebDriverWait(browser, 5).until(
EC.presence_of_element_located((By.ID, 'page-container'))
)
button = browser.find_element_by_class_name('ytp-fullscreen-button')
button.click()
re = WebDriverWait(browser, 50).until(
EC.visibility_of_element_located((By.CLASS_NAME, 'ytp-upnext-top'))
)
print("Všechno se povedlo - stoupni si, otoč se jednou dokola a tleskej u toho!")
except:
print("Něco je špatně - stoupni si a krátce pískni! Pokud neumíš pískat, zvolej 'ajajaj'")
finally:
browser.quit()