Merge pull request #641 from seleniumbase/bug-fixes-and-test-updates

Bug fixes and test updates
This commit is contained in:
Michael Mintz 2020-07-28 12:09:57 -04:00 committed by GitHub
commit cf59159138
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 18 additions and 6 deletions

View File

@ -73,7 +73,7 @@ class SwagLabsTests(BaseCase):
# 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)

View File

@ -12,9 +12,9 @@ class AppleTestClass(BaseCase):
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 Safaris WebDriver", h3 % "1")

View File

@ -65,7 +65,7 @@ class SwagLabsTests(BaseCase):
# 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)

View File

@ -8,7 +8,7 @@ class Test_UseFixtures():
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"]')

View File

@ -229,6 +229,16 @@ class BaseCase(unittest.TestCase):
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 @@ class BaseCase(unittest.TestCase):
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:

View File

@ -54,7 +54,7 @@ if sys.argv[-1] == 'publish':
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',