diff --git a/examples/swag_labs_suite.py b/examples/swag_labs_suite.py index 284a64454cb..1b5802da946 100755 --- a/examples/swag_labs_suite.py +++ b/examples/swag_labs_suite.py @@ -73,7 +73,7 @@ def test_swag_labs_basic_functional_flow(self, username): # Finish Checkout and verify the item was removed from the cart self.click("link=FINISH") self.assert_exact_text("THANK YOU FOR YOUR ORDER", "h2") - self.assert_element("div.pony_express") + self.assert_element("img.pony_express") self.click("#shopping_cart_container path") self.assert_element_absent("div.inventory_item_name") self.click(continue_shopping_button) diff --git a/examples/test_apple_site.py b/examples/test_apple_site.py index f3bf97caab0..ba603bb918e 100755 --- a/examples/test_apple_site.py +++ b/examples/test_apple_site.py @@ -12,9 +12,9 @@ def test_apple_developer_site_webdriver_instructions(self): title = "Testing with WebDriver in Safari" self.type('[placeholder*="developer.apple.com"]', title + "\n") self.click("link=%s" % title) - self.assert_element('[href="/documentation"]') + self.assert_element('div.localnav-content [href*="/documentation/"]') self.assert_text(title, "h1") - self.highlight("div.topic-description p") + self.highlight("div.description div.abstract") self.highlight("h2") h3 = "h3:nth-of-type(%s)" self.assert_text("Make Sure You Have Safari’s WebDriver", h3 % "1") diff --git a/examples/test_swag_labs.py b/examples/test_swag_labs.py index 97a2fcdc4b1..453694792a6 100755 --- a/examples/test_swag_labs.py +++ b/examples/test_swag_labs.py @@ -65,7 +65,7 @@ def test_swag_labs_basic_flow(self): # Finish Checkout and verify item is no longer in cart self.click("link=FINISH") self.assert_exact_text("THANK YOU FOR YOUR ORDER", "h2") - self.assert_element("div.pony_express") + self.assert_element("img.pony_express") self.click("#shopping_cart_container path") self.assert_element_absent("div.inventory_item_name") self.click(continue_shopping_button) diff --git a/examples/test_usefixtures.py b/examples/test_usefixtures.py index 9fa0b6e9cd5..f4d710951c7 100644 --- a/examples/test_usefixtures.py +++ b/examples/test_usefixtures.py @@ -8,7 +8,7 @@ def test_usefixtures_on_class(self): sb.open("https://google.com/ncr") sb.update_text('input[title="Search"]', 'SeleniumBase\n') sb.click('a[href*="github.com/seleniumbase/SeleniumBase"]') - sb.assert_text("SeleniumBase", "h1.public") + sb.assert_text("SeleniumBase", 'strong[itemprop="name"]') sb.assert_text("integrations") sb.assert_element('a[title="help_docs"]') sb.click('a[title="examples"]') diff --git a/seleniumbase/fixtures/base_case.py b/seleniumbase/fixtures/base_case.py index 82f3f493bea..0db2808e273 100755 --- a/seleniumbase/fixtures/base_case.py +++ b/seleniumbase/fixtures/base_case.py @@ -229,6 +229,16 @@ def double_click(self, selector, by=By.CSS_SELECTOR, timeout=None): self.driver, selector, by, timeout=timeout) actions = ActionChains(self.driver) actions.double_click(element).perform() + except Exception: + css_selector = self.convert_to_css_selector(selector, by=by) + css_selector = re.escape(css_selector) + css_selector = self.__escape_quotes_if_needed(css_selector) + double_click_script = ( + """var targetElement1 = document.querySelector('%s'); + var clickEvent1 = document.createEvent('MouseEvents'); + clickEvent1.initEvent('dblclick', true, true); + targetElement1.dispatchEvent(clickEvent1);""" % css_selector) + self.execute_script(double_click_script) if settings.WAIT_FOR_RSC_ON_CLICKS: self.wait_for_ready_state_complete() if self.demo_mode: @@ -3875,6 +3885,8 @@ def display_chart(self, chart_name=None, filename=None, interval=0): interval - The delay time for auto-advancing charts. (in seconds) If set to 0 (default), auto-advancing is disabled. """ + if self.headless: + interval = 1 # Race through chart if running in headless mode if not chart_name: chart_name = "default" if not filename: diff --git a/setup.py b/setup.py index 0d85cde3d15..6e1c0f90d30 100755 --- a/setup.py +++ b/setup.py @@ -54,7 +54,7 @@ setup( name='seleniumbase', - version='1.44.2', + version='1.44.3', description='Fast, Easy, and Reliable Browser Automation & Testing.', long_description=long_description, long_description_content_type='text/markdown',