Bug 1260656 - Fix firefox-puppeteer documentation generation for Readthedocs. r?maja_zf
MozReview-Commit-ID: 4r7arjvMyWN
--- a/testing/puppeteer/firefox/firefox_puppeteer/ui/menu.py
+++ b/testing/puppeteer/firefox/firefox_puppeteer/ui/menu.py
@@ -36,18 +36,17 @@ class MenuBar(BaseLib):
'label "{}"'.format(label))
return menu[0]
def get_menu_by_id(self, menu_id):
"""Get a :class:`MenuElement` instance corresponding to the specified
ID.
- :param menu_id: The ID of the menu, e.g., **file-menu** or
- **view-menu**.
+ :param menu_id: The ID of the menu, e.g., **file-menu** or **view-menu**.
:returns: A :class:`MenuElement` instance.
"""
menu = [m for m in self.menus if m.get_attribute('id') == menu_id]
if not menu:
raise NoSuchElementException('Could not find a menu with '
'id "{}"'.format(menu_id))
@@ -59,19 +58,18 @@ class MenuBar(BaseLib):
:param label: The label of the menu, e.g., **File** or **View**.
:param item: The label of the item in the menu, e.g., **New Tab**.
"""
return self.get_menu(label).select(item)
def select_by_id(self, menu_id, item_id):
"""Select an item in a menu.
- :param menu_id: The ID of the menu, e.g., **file-menu** or **view-menu**.
- :param item_id: The ID of the item in the menu, e.g.,
- **menu_newNavigatorTab**.
+ :param menu_id: The ID of the menu, e.g. **file-menu** or **view-menu**.
+ :param item_id: The ID of the item in the menu, e.g. **menu_newNavigatorTab**.
"""
return self.get_menu_by_id(menu_id).select_by_id(item_id)
class MenuElement(DOMElement):
"""Wraps a menu element DOM element."""
@property
def items(self):
@@ -94,18 +92,17 @@ class MenuBar(BaseLib):
.format(label, self.get_attribute('label')))
raise NoSuchElementException(message)
return item[0].click()
def select_by_id(self, menu_item_id):
"""Click on a menu item within this menu.
- :param menu_item_id: The ID of the menu item, e.g.,
- **menu_newNavigatorTab**.
+ :param menu_item_id: The ID of the menu item, e.g. **menu_newNavigatorTab**.
"""
item = [l for l in self.items if l.get_attribute('id') ==
menu_item_id]
if not item:
message = ("Item with ID '{}' not found in the '{}' menu"
.format(menu_item_id, self.get_attribute('id')))
raise NoSuchElementException(message)
new file mode 100644
--- /dev/null
+++ b/testing/puppeteer/firefox/requirements-docs.txt
@@ -0,0 +1,5 @@
+sphinx
+sphinx_rtd_theme
+
+# Required by Readthedocs to install the firefox-puppeteer package
+-e .