Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Check click author link lands on right page

  • Loading branch information...
commit 2a6fa38a8e88796d2c13f11f638900b57a190765 1 parent a18c638
@AlinT authored
Showing with 35 additions and 2 deletions.
  1. +21 −2 pages/desktop/home.py
  2. +14 −0 tests/desktop/test_homepage.py
View
23 pages/desktop/home.py
@@ -3,7 +3,6 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
from selenium.webdriver.common.by import By
from selenium.webdriver.common.action_chains import ActionChains
@@ -14,8 +13,10 @@
class Home(Base):
_page_title = "Add-ons for Firefox"
- _first_addon_locator = (By.CSS_SELECTOR, "div.summary > a > h3")
+ _first_addon_locator = (By.CSS_SELECTOR, ".summary > a > h3")
_other_applications_link_locator = (By.ID, "other-apps")
+ _addons_locator = (By.CSS_SELECTOR, '.addon.hovercard')
+ _authors_link_locator = (By.CSS_SELECTOR, '.byline > a')
#Most Popular List
_most_popular_item_locator = (By.CSS_SELECTOR, "ol.toplist li")
@@ -46,6 +47,24 @@ def __init__(self, testsetup, open_url=True):
if open_url:
self.selenium.get(self.base_url)
+ def hover_over_first_addon_and_click_author_link(self):
+ addon_item = self.selenium.find_element(*self._addons_locator)
+ author_item = self.selenium.find_element(*self._authors_link_locator)
+ ActionChains(self.selenium).\
+ move_to_element(addon_item).\
+ move_to_element(author_item).click().\
+ perform()
+ from pages.desktop.user import User
+ return User(self.testsetup)
+
+ def first_addon_author(self):
+ addons = self.selenium.find_element(*self._addons_locator)
+ item = self.selenium.find_element(*self._authors_link_locator)
+ ActionChains(self.selenium).\
+ move_to_element(addons).\
+ perform()
+ return item.text
+
def hover_over_addons_home_title(self):
home_item = self.selenium.find_element(*self._amo_logo_link_locator)
ActionChains(self.selenium).\
View
14 tests/desktop/test_homepage.py
@@ -236,3 +236,17 @@ def test_top_three_items_in_each_site_navigation_menu_are_featured(self, mozwebq
# first 3 are featured, the others are not
[Assert.true(item.is_featured) for item in actual_menu.items[:3]]
[Assert.false(item.is_featured) for item in actual_menu.items[3:]]
+
+ @pytest.mark.nondestructive
+ def test_addons_author_link(self, mozwebqa):
+ """
+ https://litmus.mozilla.org/show_test.cgi?searchType=by_id&id=25815
+ """
+
+ home_page = Home(mozwebqa)
+
+ first_author = home_page.first_addon_author()
+ user_page = home_page.hover_over_first_addon_and_click_author_link()
+
+ Assert.equal(user_page.username, first_author)
+ Assert.contains('user', user_page.get_url_current_page())
Please sign in to comment.
Something went wrong with that request. Please try again.