Skip to content
Browse files

code review update

  • Loading branch information...
1 parent d8d68b3 commit 129b70536d99c0fb89ab1dcad6091388a994912b Bebe committed Mar 20, 2012
Showing with 9 additions and 8 deletions.
  1. +7 −6 pages/mobile/feedback.py
  2. +2 −2 tests/mobile/test_search.py
View
13 pages/mobile/feedback.py
@@ -5,6 +5,7 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from selenium.webdriver.common.by import By
+
from pages.base import BasePage
@@ -21,9 +22,9 @@ class FeedbackPage(BasePage):
_trends_page_locator = (By.ID, 'trends')
_settings_page_locator = (By.ID, 'settings')
- _search_box = (By.ID, 'id_q')
+ _search_box_locator = (By.ID, 'id_q')
- _messages_locator = (By.CSS_SELECTOR, 'div.block > ul.messages > li.list-item')
+ _messages_locator = (By.CSS_SELECTOR, '.messages .message')
def go_to_feedback_page(self):
print 'opening: ' + self.base_url + '/'
@@ -39,9 +40,9 @@ def click_statistics_tab(self):
def click_settings_tab(self):
self.selenium.find_element(*self._settings_tab_locator).click()
- def search_for(self, search_string):
- search_box = self.selenium.find_element(*self._search_box)
- search_box.send_keys(search_string)
+ def search_for(self, search_term):
+ search_box = self.selenium.find_element(*self._search_box_locator)
+ search_box.send_keys(search_term)
search_box.submit()
@property
@@ -58,7 +59,7 @@ def is_settings_visible(self):
@property
def search_box_placeholder(self):
- return self.selenium.find_element(*self._search_box).get_attribute('placeholder')
+ return self.selenium.find_element(*self._search_box_locator).get_attribute('placeholder')
@property
def messages(self):
View
4 tests/mobile/test_search.py
@@ -20,10 +20,10 @@ def test_that_search_returns_results(self, mozwebqa):
feedback_pg.go_to_feedback_page()
feedback_pg.search_for(self.positive_search_term)
- messages = feedback_pg.messages
Assert.equal(self.positive_search_term, feedback_pg.search_term_from_url)
- Assert.greater(len(messages), 0)
+ Assert.greater(len(feedback_pg.messages), 0)
+
@pytest.mark.nondestructive
def test_that_empty_search_of_feedback_returns_some_data(self, mozwebqa):

0 comments on commit 129b705

Please sign in to comment.
Something went wrong with that request. Please try again.