예제 #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
파일: order.py 프로젝트: extsoft/selene
 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)