Beispiel #1
0
def test_is_present_always_refreshes_dom_element(browser):
    el = WebElement(browser, "some_tag[@some_attr='some_value']")
    el._find_dom_element = Mock(wraps=el._find_dom_element)  # pylint: disable=protected-access
    dom_el = el.dom_element
    el.is_present()
    assert el.dom_element is not dom_el
    assert el._find_dom_element.call_count == 2  # pylint: disable=protected-access
Beispiel #2
0
def test_is_not_present(browser):
    browser.find_elements_by_xpath = Mock(return_value=[])
    el = WebElement(browser, "some_tag[@some_attr='some_value']")
    assert not el.is_present()
Beispiel #3
0
def test_is_present(browser):
    el = WebElement(browser, "some_tag[@some_attr='some_value']")
    assert el.is_present()