Skip to content
This repository has been archived by the owner on Sep 16, 2021. It is now read-only.

Commit

Permalink
Fix locator for add-on name in popup due to changes in bug 1431242 (#152
Browse files Browse the repository at this point in the history
)
  • Loading branch information
davehunt authored and jrbenny35 committed Feb 23, 2018
1 parent 9b95c4b commit d8fc35b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
11 changes: 8 additions & 3 deletions foxpuppet/windows/browser/notifications/addons.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ def allow(self):
class AddOnInstallConfirmation(BaseNotification):
"""Add-on install confirmation notification."""

_addon_name_locator = (By.CSS_SELECTOR, '#addon-webext-perm-header')
_cancel_locator = (By.ID, 'addon-install-confirmation-cancel')
_confirm_locator = (By.ID, 'addon-install-confirmation-accept')

Expand All @@ -34,8 +33,14 @@ def addon_name(self):
"""
with self.selenium.context(self.selenium.CONTEXT_CHROME):
if self.window.firefox_version >= 55:
name = self.root.find_element(*self._addon_name_locator).text
if self.window.firefox_version >= 59: # Bug 1431242
el = self.root.find_anonymous_element_by_attribute(
'class', 'popup-notification-description')
return el.find_element(By.CSS_SELECTOR, 'b').text
elif self.window.firefox_version >= 55:
_addon_name_locator = (
By.CSS_SELECTOR, '#addon-webext-perm-header')
name = self.root.find_element(*_addon_name_locator).text
return name.split()[1]
else:
_addon_name_locator = (
Expand Down
2 changes: 2 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ def browser(foxpuppet):
def firefox_options(firefox_options):
"""Fixture for configuring Firefox."""
firefox_options.log.level = 'trace'
# firefox_options.set_preference('devtools.chrome.enabled', True)
# firefox_options.set_preference('devtools.debugger.remote-enabled', True)
return firefox_options


Expand Down

0 comments on commit d8fc35b

Please sign in to comment.