-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathHeadless (1).py
More file actions
32 lines (26 loc) · 1.04 KB
/
Headless (1).py
File metadata and controls
32 lines (26 loc) · 1.04 KB
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
import enum
import unittest
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.chrome.options import Options
class Test_Data(enum.Enum):
"""Test data for login test case"""
email = "lsssol@gmail.com"
password = "12345678"
class Test_01_login(unittest.TestCase):
"""verify Login functionality with valid email id and valid password."""
def setUp(self):
"""this function run before every test"""
options = webdriver.ChromeOptions()
options.headless = True
self.driver = webdriver.Chrome(executable_path="C:\\Program Files (x86)\\chromedriver.exe", options=options)
self.driver.implicitly_wait(10)
self.driver.get("https://facebook.com")
def tearDown(self):
"""this function run after every test"""
self.driver.quit()
def test_01_login(self):
assert "Facebook" in self.driver.title
if __name__ == "__main__":
"""This is the main function will Run the Unit Test if this Moudle is not imported"""
unittest.main()