Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

add sidebar category test case (Test for Litmus 25792)

  • Loading branch information...
commit bc031c970751998d304397cdab5eed61d31e2b77 1 parent 72c81af
fitram authored
View
1  .gitignore
@@ -1,5 +1,6 @@
*.swp
*.pyc
*.komodoproject
+*.idea
results*
.DS_store
View
77 pages/desktop/category.py
@@ -11,8 +11,83 @@
class Category(Base):
- _category_title_locator = (By.CSS_SELECTOR, "div.island > h1")
+ _categories_side_navigation_header_locator = (By.CSS_SELECTOR, "#side-nav > h2:nth-of-type(2)")
+ _categories_alert_update_link_locator = (By.CSS_SELECTOR, "#side-categories > li:nth-of-type(1) > a")
+ _categories_appearance_link_locator = (By.CSS_SELECTOR, "#side-categories > li:nth-of-type(2) > a")
+ _categories_bookmarks_link_locator = (By.CSS_SELECTOR, "#side-categories > li:nth-of-type(3) > a")
+ _categories_download_management_link_locator = (By.CSS_SELECTOR, "#side-categories > li:nth-of-type(4) > a")
+ _categories_feed_news_blog_link_locator = (By.CSS_SELECTOR, "#side-categories > li:nth-of-type(5) > a")
+ _categories_games_entertainment_link_locator = (By.CSS_SELECTOR, "#side-categories > li:nth-of-type(6) > a")
+ _categories_language_support_link_locator = (By.CSS_SELECTOR, "#side-categories > li:nth-of-type(7) > a")
+ _categories_photo_music_video_link_locator = (By.CSS_SELECTOR, "#side-categories > li:nth-of-type(8) > a")
+ _categories_privacy_security_link_locator = (By.CSS_SELECTOR, "#side-categories > li:nth-of-type(9) > a")
+ _categories_shopping_link_locator = (By.CSS_SELECTOR, "#side-categories > li:nth-of-type(10) > a")
+ _categories_social_communication_link_locator = (By.CSS_SELECTOR, "#side-categories > li:nth-of-type(11) > a")
+ _categories_tabs_link_locator = (By.CSS_SELECTOR, "#side-categories > li:nth-of-type(12) > a")
+ _categories_web_development_link_locator = (By.CSS_SELECTOR, "#side-categories > li:nth-of-type(13) > a")
+ _categories_other_link_locator = (By.CSS_SELECTOR, "#side-categories > li:nth-of-type(14) > a")
+
+
+ @property
+ def categories_side_navigation_header_text(self):
+ return self.selenium.find_element(*self._categories_side_navigation_header_locator).text
@property
def category_header_title(self):
return self.selenium.find_element(*self._category_title_locator).text
+
+ @property
+ def categories_alert_updates_header_text(self):
+ return self.selenium.find_element(*self._categories_alert_update_link_locator).text
+
+ @property
+ def categories_appearance_header_text(self):
+ return self.selenium.find_element(*self._categories_appearance_link_locator).text
+
+ @property
+ def categories_bookmark_header_text(self):
+ return self.selenium.find_element(*self._categories_bookmarks_link_locator).text
+
+ @property
+ def categories_download_management_header_text(self):
+ return self.selenium.find_element(*self._categories_download_management_link_locator).text
+
+ @property
+ def categories_feed_news_blog_header_text(self):
+ return self.selenium.find_element(*self._categories_feed_news_blog_link_locator).text
+
+ @property
+ def categories_games_entertainment_header_text(self):
+ return self.selenium.find_element(*self._categories_games_entertainment_link_locator).text
+
+ @property
+ def categories_language_support_header_text(self):
+ return self.selenium.find_element(*self._categories_language_support_link_locator).text
+
+ @property
+ def categories_photo_music_video_header_text(self):
+ return self.selenium.find_element(*self._categories_photo_music_video_link_locator).text
+
+ @property
+ def categories_privacy_security_header_text(self):
+ return self.selenium.find_element(*self._categories_privacy_security_link_locator).text
+
+ @property
+ def categories_shopping_header_text(self):
+ return self.selenium.find_element(*self._categories_shopping_link_locator).text
+
+ @property
+ def categories_social_communication_header_text(self):
+ return self.selenium.find_element(*self._categories_social_communication_link_locator).text
+
+ @property
+ def categories_tabs_header_text(self):
+ return self.selenium.find_element(*self._categories_tabs_link_locator).text
+
+ @property
+ def categories_web_development_header_text(self):
+ return self.selenium.find_element(*self._categories_web_development_link_locator).text
+
+ @property
+ def categories_other_header_text(self):
+ return self.selenium.find_element(*self._categories_other_link_locator).text
View
4 pages/desktop/home.py
@@ -75,6 +75,10 @@ def click_to_explore(self, what):
from pages.desktop.extensions import ExtensionsHome
return ExtensionsHome(self.testsetup)
+ def click_to_category(self):
+ from pages.desktop.category import Category
+ return Category(self.testsetup)
+
@property
def most_popular_count(self):
return len(self.selenium.find_elements(*self._most_popular_item_locator))
View
26 tests/desktop/test_homepage.py
@@ -314,3 +314,29 @@ def test_that_clicking_see_all_extensions_link_works(self, mozwebqa):
featured_extension_page = home_page.click_featured_extensions_see_all_link()
Assert.true(featured_extension_page.is_the_current_page)
Assert.true(featured_extension_page.get_url_current_page().endswith('/extensions/?sort=featured'))
+
+ @pytest.mark.litmus([25792])
+ @pytest.mark.nondestructive
+ def test_that_checks_all_categories_side_navigation(self, mozwebqa):
+ """
+ Test for Litmus 25792.
+ https://litmus.mozilla.org/show_test.cgi?searchType=by_id&id=25792
+ """
+ home_page = Home(mozwebqa)
+ category_region = home_page.click_to_category()
+
+ Assert.equal('CATEGORIES', category_region.categories_side_navigation_header_text)
+ Assert.equal('Alerts & Updates', category_region.categories_alert_updates_header_text)
+ Assert.equal('Appearance', category_region.categories_appearance_header_text)
+ Assert.equal('Bookmarks', category_region.categories_bookmark_header_text)
+ Assert.equal('Download Management', category_region.categories_download_management_header_text)
+ Assert.equal('Feeds, News & Blogging', category_region.categories_feed_news_blog_header_text)
+ Assert.equal('Games & Entertainment', category_region.categories_games_entertainment_header_text)
+ Assert.equal('Language Support', category_region.categories_language_support_header_text)
+ Assert.equal('Photos, Music & Videos', category_region.categories_photo_music_video_header_text)
+ Assert.equal('Privacy & Security', category_region.categories_privacy_security_header_text)
+ Assert.equal('Shopping', category_region.categories_shopping_header_text)
+ Assert.equal('Social & Communication', category_region.categories_social_communication_header_text)
+ Assert.equal('Tabs', category_region.categories_tabs_header_text)
+ Assert.equal('Web Development', category_region.categories_web_development_header_text)
+ Assert.equal('Other', category_region.categories_other_header_text)
Please sign in to comment.
Something went wrong with that request. Please try again.