Advertisement
ridwan100

page

Jan 17th, 2023 (edited)
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.64 KB | None | 0 0
  1. from element import BasePageElement
  2. from locator import *
  3.  
  4.  
  5. class SearchTextElement(BasePageElement):
  6.     locator = 'q'
  7. class BasePage(object):
  8.     def __init__(self, driver):
  9.           self.driver = driver
  10.      
  11. class MainPage(BasePage):
  12.     search_text_element = SearchTextElement()
  13.     def is_title_matches(self):
  14.         return "Python" in self.driver.title
  15.     def click_go_button(self):
  16.         element = self.driver.find_element(*MainPageLocators.GO_BUTTON)
  17.         element.click()
  18. class SearchResultPage():
  19.     def is_results_found(self):
  20.         return "No results found. " not in self.driver.page_source                    
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement