Merge pull request #641 from seleniumbase/bug-fixes-and-test-updates
Bug fixes and test updates
This commit is contained in:
commit
cf59159138
|
@ -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)
|
||||
|
|
|
@ -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 Safari’s WebDriver", h3 % "1")
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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"]')
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue