Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 86 lines (65 sloc) 3.128 kb
f6d61e6 @glennhoward adding 2 new tests to view the history page of the mainpage.
glennhoward authored
1 #!/usr/bin/env python
2
3 # This Source Code Form is subject to the terms of the Mozilla Public
4 # License, v. 2.0. If a copy of the MPL was not distributed with this
5 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
6
7 from selenium.webdriver.common.by import By
8 from page import Page
9
954d07a @glennhoward fixing pep8 issues.
glennhoward authored
10
f6d61e6 @glennhoward adding 2 new tests to view the history page of the mainpage.
glennhoward authored
11 class HeaderRegion(Page):
12
13 _page_locator = (By.CSS_SELECTOR, '#ca-nstab-main a')
14 _discussion_locator = (By.CSS_SELECTOR, '#ca-talk a')
15 _view_source_locator = (By.CSS_SELECTOR, '#ca-viewsource a')
16 _history_locator = (By.CSS_SELECTOR, '#ca-history a')
17 _watch_locator = (By.CSS_SELECTOR, '#ca-watch a')
18 _unwatch_locator = (By.CSS_SELECTOR, '#ca-unwatch a')
19 _refresh_locator = (By.CSS_SELECTOR, '#ca-watch a')
20 _search_field_locator = (By.CSS_SELECTOR, '#quick-search div input#q')
c2e6345 @glennhoward moved clicking search button into header region.
glennhoward authored
21 _search_button_locator = (By.ID, 'quick-search-btn')
f6d61e6 @glennhoward adding 2 new tests to view the history page of the mainpage.
glennhoward authored
22
23 @property
24 def is_main_page_visible(self):
25 return self.is_element_visible(self._page_locator)
26
27 def click_main_page(self):
28 self.selenium.find_element(*self._page_locator).click()
29
30 @property
31 def is_view_source_visible(self):
32 return self.is_element_visible(self._view_source_locator)
33
34 def click_view_source(self):
35 self.selenium.find_element(*self._view_source_locator).click()
36 from view_source import ViewSourcePage
37 return ViewSourcePage(self.testsetup)
38
39 @property
40 def is_history_visible(self):
41 return self.is_element_visible(self._history_locator)
42
43 def click_history(self):
44 self.selenium.find_element(*self._history_locator).click()
45 from view_history import ViewHistoryPage
46 return ViewHistoryPage(self.testsetup)
47
48 @property
49 def is_watch_visible(self):
50 return self.is_element_visible(self._watch_locator)
51
52 def click_watch(self):
53 self.selenium.find_element(*self._watch_locator).click()
54 from watch_page import WatchPage
55 return WatchPage(self.testsetup)
56
57 @property
58 def is_unwatch_visible(self):
59 return self.is_element_visible(self._unwatch_locator)
60
61 def click_unwatch(self):
62 self.selenium.find_element(*self._unwatch_locator).click()
63 from watch_page import WatchPage
64 return WatchPage(self.testsetup)
65
66 @property
67 def is_refresh_visible(self):
68 return self.is_element_visible(self._refresh_locator)
69
70 def click_refresh(self):
71 self.selenium.find_element(*self._refresh_locator).click()
72
73 @property
74 def is_search_visible(self):
75 return self.is_element_visible(self._search_field_locator)
76
0b775fa @glennhoward adding test to search for a term and verify that term is returned.
glennhoward authored
77 def enter_text_into_search_field(self):
78 from search_results import SearchResultsPage
79 self.selenium.find_element(*self._search_field_locator).send_keys(SearchResultsPage._search_term)
80 return SearchResultsPage(self.testsetup)
81
f6d61e6 @glennhoward adding 2 new tests to view the history page of the mainpage.
glennhoward authored
82 def click_search_button(self):
c2e6345 @glennhoward moved clicking search button into header region.
glennhoward authored
83 self.selenium.find_element(*self._search_button_locator).click()
84 from search_results import SearchResultsPage
85 return SearchResultsPage(self.testsetup)
Something went wrong with that request. Please try again.