forked from gunesmes/page-object-python-selenium
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbase_test.py
More file actions
31 lines (23 loc) · 1.03 KB
/
base_test.py
File metadata and controls
31 lines (23 loc) · 1.03 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
import unittest
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
# I am using python unittest for asserting cases.
# In this module, there should be test cases.
# If you want to run it, you should type: python <module-name.py>
class BaseTest(unittest.TestCase):
def setUp(self):
options = Options()
# options.add_argument("--headless") # Runs Chrome in headless mode.
options.add_argument('--no-sandbox') # # Bypass OS security model
options.add_argument('disable-infobars')
options.add_argument("--disable-extensions")
options.add_argument("--start-fullscreen")
options.add_argument('--disable-gpu')
self.driver = webdriver.Chrome(options=options)
# self.driver = webdriver.Firefox()
self.driver.get("http://www.amazon.com")
def tearDown(self):
self.driver.close()
if __name__ == "__main__":
suite = unittest.TestLoader().loadTestsFromTestCase(TestPages)
unittest.TextTestRunner(verbosity=1).run(suite)