Beispiel #1
0
    def test_uncheck_return_True(self):
        instance = WebElementMock()
        instance.expect("is_selected", False)

        driver = WebDriverMock()
        driver.expect("find_element_by_xpath", instance)

        element = Element("name", "identifier")
        element.driver = driver

        assert element.uncheck() == True
        assert instance.called("is_selected") == 1
        assert instance.called("click") == 0
Beispiel #2
0
    def test_send_keys_return_True(self):
        instance = WebElementMock()

        driver = WebDriverMock()
        driver.expect("find_element_by_xpath", instance)

        element = Element("name", "identifier")
        element.driver = driver

        assert element.send_keys("keystroke") == True
        assert instance.called("send_keys") == 1