Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

browser.click(buttuon, ignore_ajax=True) any way call browser.plugin.ensure_page_safe #221

Open
ldjebran opened this issue Oct 10, 2018 · 1 comment
Labels
bug Something isn't working medium Medium priority issue

Comments

@ldjebran
Copy link
Contributor

browser.click(buttuon, ignore_ajax=True) any way call browser.plugin.ensure_page_safe before and after click
in widgetastic browser click we have this code

  @retry_stale_element
    def click(self, locator, *args, **kwargs):
        """Clicks at a specific element using two separate events (mouse move, mouse click).

        Args: See :py:meth:`elements`
        """
        self.logger.debug('click: %r', locator)
        ignore_ajax = kwargs.pop('ignore_ajax', False)
        el = self.move_to_element(locator, *args, **kwargs)
        self.plugin.before_click(el, locator)
        # and then click on current mouse position
        self.perform_click()
        if not ignore_ajax:
            try:
                self.plugin.ensure_page_safe()
            except UnexpectedAlertPresentException:
                pass
        try:
            self.plugin.after_click(el, locator)
        except UnexpectedAlertPresentException:
            pass

in airgun browser plugin we have this code

class class AirgunBrowserPlugin(DefaultPlugin):
    def before_click(self, element, locator=None):
        """Invoked before clicking on an element. Ensure page is fully loaded
        before clicking.
        """
        self.ensure_page_safe()

    def after_click(self, element, locator=None):
        """Invoked after clicking on an element. Ensure page is fully loaded
        before proceeding further.
        """
        self.ensure_page_safe()
@ldjebran ldjebran added bug Something isn't working critical Critical issue. Requires resolving ASAP labels Oct 10, 2018
@abalakh
Copy link
Contributor

abalakh commented Nov 23, 2018

@ldjebran i think you've already fixed this in one of your PRs, haven't you?

@mirekdlugosz mirekdlugosz added medium Medium priority issue and removed critical Critical issue. Requires resolving ASAP labels Jun 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working medium Medium priority issue
Projects
None yet
Development

No branches or pull requests

3 participants