-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain_page.py
More file actions
27 lines (20 loc) · 750 Bytes
/
main_page.py
File metadata and controls
27 lines (20 loc) · 750 Bytes
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
"""
Main Page Classes
"""
from selenium.webdriver.common.by import By
from pages.base_page import BasePage
from elements.search_elements import SearchTextElement
class MainPage(BasePage):
"""Home page action methods come here. I.e. Python.org"""
GO_BUTTON = (By.ID, 'submit')
search_text_element = SearchTextElement()
def load(self):
"""Loads the python.org page"""
self.driver.get("http://www.python.org")
def is_title_matches(self):
"""Verifies that the hardcoded text "Python" appears in page title"""
return "Python" in self.driver.title
def click_go_button(self):
"""Triggers the search"""
element = self.driver.find_element(*self.GO_BUTTON)
element.click()