-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_google.py
37 lines (24 loc) · 954 Bytes
/
test_google.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
import unittest
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from webdriver_manager.chrome import ChromeDriverManager
from selenium.webdriver.common.by import By
from time import sleep
from google_page import GooglePage
class GoogleTest(unittest.TestCase):
@classmethod
def setUpClass(cls):
options = webdriver.ChromeOptions()
options.add_experimental_option('excludeSwitches', ['enable-logging'])
s = Service(ChromeDriverManager().install())
cls.driver = webdriver.Chrome(service = s, options = options)
def test_search(self):
google = GooglePage(self.driver)
google.open()
google.search('Platzi')
self.assertEqual('Platzi',google.keyword)
@classmethod
def tearDownClass(cls):
cls.driver.close()
if __name__ == '__main__':
unittest.main(verbosity = 2)