Added Selenium test
This commit is contained in:
parent
1bef4bf914
commit
a2e99c0b35
1
selenium/.gitignore
vendored
Normal file
1
selenium/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
venv
|
1
selenium/requirements.txt
Normal file
1
selenium/requirements.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
selenium==3.141.0
|
29
selenium/test.py
Executable file
29
selenium/test.py
Executable file
@ -0,0 +1,29 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
|
import unittest
|
||||||
|
from selenium import webdriver
|
||||||
|
|
||||||
|
|
||||||
|
class ClearBowlTest(unittest.TestCase):
|
||||||
|
def __init__(self, *args, **kwargs):
|
||||||
|
super().__init__(*args, **kwargs)
|
||||||
|
self.driver = webdriver.Chrome()
|
||||||
|
self.driver.implicitly_wait(15)
|
||||||
|
self.base_url = "https://clearbowl.herokuapp.com"
|
||||||
|
|
||||||
|
def test_login(self):
|
||||||
|
email = 'artnow@st.amu.edu.pl'
|
||||||
|
password = 'Tester#123'
|
||||||
|
|
||||||
|
self.driver.get(f'{self.base_url}/login')
|
||||||
|
self.driver.find_element_by_xpath("//input[@placeholder='Email']").send_keys(email)
|
||||||
|
self.driver.find_element_by_xpath("//input[@placeholder='Hasło']").send_keys(password)
|
||||||
|
self.driver.find_element_by_xpath("//button[@class='ivu-btn ivu-btn-primary']").click()
|
||||||
|
self.driver.find_element_by_xpath(f"//div[contains(text(),'Witaj, {email}')]")
|
||||||
|
|
||||||
|
def tearDown(self):
|
||||||
|
self.driver.quit()
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
unittest.main()
|
Loading…
Reference in New Issue
Block a user