Пример #1
0
def test_wait_for_element_with_on_screenshoting():
    try:
        settings.screenshot_on_element_fail = True
        s("#i-do-not-exist").insist()
        raise Exception("ExpiredWaitingException must be")
    except ExpiredWaitingException as e:
        assert 'settings.screenshot_on_element_fail = False' not in e.message
    finally:
        settings.screenshot_on_element_fail = False
Пример #2
0
def test_has_text_for_not_populated_locator():
    assert not s('.css').has_text()
Пример #3
0
def test_is_present_for_existent_locator():
    assert s('.css').is_present()
Пример #4
0
def test_is_present_for_not_existent_locator():
    assert not s('.dddh').is_present()
Пример #5
0
def test_is_visible_for_visible_locator():
    assert s('.css').is_visible()
Пример #6
0
def test_is_visible_for_hidden_locator():
    assert not s('h', By.ID).is_visible()
Пример #7
0
def test_find_element_by_name():
    s('last_name', By.NAME).insist()
Пример #8
0
def test_present_condition():
    s('.css').insist(present)
Пример #9
0
def test_find_element_by_id():
    s('item_31', By.ID).insist()
Пример #10
0
def test_find_element_by_css_for_existent_locator():
    s('.css').insist()
Пример #11
0
def test_find_element_by_css_for_not_existent_locator():
    with pytest.raises(ExpiredWaitingException):
        s("#i-do-not-exist").insist()
Пример #12
0
def test_wait_for_element_which_does_not_exist():
    with pytest.raises(ExpiredWaitingException):
        s("#i-do-not-exist").insist()
Пример #13
0
 def init(self):
     self.details = self.Details('#order_details')
     self.add_item = s('#add_item')
     self.items = ss('[id^="item"]').of(self.Item)
Пример #14
0
def test_has_test_condition():
    s('ol > li').insist(has_text)
Пример #15
0
def test_has_test_for_populated_locator():
    assert s('ol > li').has_text()
Пример #16
0
def test_find_element_by_xpath():
    s('//input[@id="item_31"]', By.XPATH).insist()
Пример #17
0
def test_collection_of_elements_loading_with_custom_time():
    try:
        s("#i-do-not-exist", loading_time=0.2).insist()
        raise Exception("ExpiredWaitingException must be")
    except ExpiredWaitingException as e:
        assert 'During: 0.2s' in e.message
Пример #18
0
def test_absent_condition():
    s('.ffff').insist(absent)