-
Notifications
You must be signed in to change notification settings - Fork 6
/
test_edge.py
40 lines (30 loc) · 1017 Bytes
/
test_edge.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
39
40
import os
import unittest
import time
from selenium import webdriver
class EdgeTestCase(unittest.TestCase):
@classmethod
def setUpClass(cls):
dir = os.getenv('IEWebDriver')
driver = os.path.join(dir, 'IEDriverServer.exe')
cls.browser = webdriver.Ie(executable_path=driver)
@classmethod
def tearDownClass(cls):
cls.browser.quit()
def testGoogle(self):
self.browser.get('http://www.google.com')
self.assertIn('Google', self.browser.title)
time.sleep(2)
def testBing(self):
self.browser.get('http://www.bing.com')
self.assertIn('Bing', self.browser.title)
time.sleep(2)
def testYahoo(self):
self.browser.get('http://www.yahoo.com')
self.assertIn('Yahoo', self.browser.title)
def testOutlook(self):
self.browser.get('http://www.outlook.com')
self.assertIn('Outlook', self.browser.title)
time.sleep(2)
if __name__ == '__main__':
unittest.main(verbosity=2)