Advertisement
ridwan100

main

Jan 17th, 2023
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.68 KB | None | 0 0
  1. import unittest
  2.  
  3. import page
  4.  
  5. from selenium import webdriver
  6.  
  7.  
  8. class PythonOrgSearch(unittest.TestCase):
  9.     def setUp(self):
  10.         self.driver = webdriver.Chrome("C:\Program Files\chromedriver.exe")
  11.         self.driver.get("https://www.python.org")
  12.     def test_search_python(self):
  13.         mainPage = page.MainPage(self.driver)
  14.         assert mainPage.is_title_matches()
  15.         mainPage.search_text_element = 'pycon'
  16.         mainPage.click_go_button()
  17.         search_result_page = page.SearchResultPage()
  18.         assert search_result_page.is_results_found()
  19.     def tearDown(self):
  20.         self.driver.close()  
  21.  
  22. if __name__ == '__main__':
  23.     unittest.main()        
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement