/pages/desktop/about.py

https://github.com/bebef1987/mcom-tests · Python · 55 lines · 41 code · 10 blank · 4 comment · 0 complexity · 7e877e0caf858e39d1a6e21476726cd1 MD5 · raw file

  1. #!/usr/bin/env python
  2. # This Source Code Form is subject to the terms of the Mozilla Public
  3. # License, v. 2.0. If a copy of the MPL was not distributed with this
  4. # file, You can obtain one at http://mozilla.org/MPL/2.0/.
  5. from selenium.webdriver.common.by import By
  6. from pages.desktop.base import Base
  7. class AboutPage(Base):
  8. def go_to_page(self):
  9. self.open('/about/')
  10. _mission_header_link = (By.CSS_SELECTOR, '#nav-main li:nth-child(1) > a')
  11. _about_header_link = (By.CSS_SELECTOR, '#nav-main li:nth-child(2) > a')
  12. _projects_header_link = (By.CSS_SELECTOR, '#nav-main li:nth-child(3) > a')
  13. _get_involved_header_link = (By.CSS_SELECTOR, '#nav-main li:nth-child(4) > a')
  14. _get_to_know_mozilla_header = (By.CSS_SELECTOR, '.large.center')
  15. _career_center_link = (By.CSS_SELECTOR, '.links:nth-of-type(1) > li:nth-of-type(1) > h4 > a')
  16. _press_center_link = (By.CSS_SELECTOR, '.links:nth-of-type(1) > li:nth-of-type(2) > h4 > a')
  17. _mozilla_blog_link = (By.CSS_SELECTOR, '.links:nth-of-type(1) > li:nth-of-type(3) > h4 > a')
  18. _privacy_center_link = (By.CSS_SELECTOR, '.links:nth-of-type(1) > li:nth-of-type(4) > h4 > a')
  19. _forums_link = (By.CSS_SELECTOR, '.links:nth-of-type(1) > li:nth-of-type(5) > h4 > a')
  20. _governance_link = (By.CSS_SELECTOR, '.links:nth-of-type(2) > li:nth-of-type(5) > h4 > a')
  21. _get_involved_link = (By.CSS_SELECTOR, '.links:nth-of-type(2) > li:nth-of-type(4) > h4 > a')
  22. _locations_link = (By.CSS_SELECTOR, '.links:nth-of-type(2) > li:nth-of-type(3) > h4 > a')
  23. _partnerships_link = (By.CSS_SELECTOR, '.links:nth-of-type(2) > li:nth-of-type(2) > h4 > a')
  24. _brand_toolkit_link = (By.CSS_SELECTOR, '.links:nth-of-type(2) > li:nth-of-type(1) > h4 > a')
  25. major_links_list = [
  26. _career_center_link,
  27. _press_center_link,
  28. _mozilla_blog_link,
  29. _privacy_center_link,
  30. _forums_link,
  31. _governance_link,
  32. _get_involved_header_link,
  33. _locations_link,
  34. _partnerships_link,
  35. _brand_toolkit_link,
  36. ]
  37. nav_links_list = [
  38. _mission_header_link,
  39. _about_header_link,
  40. _projects_header_link,
  41. _get_involved_link,
  42. ]
  43. @property
  44. def is_know_mozilla_header_present(self):
  45. return self.is_element_present(*self._get_to_know_mozilla_header)