예제 #1
0
def test_type_value(fixture_session: Context):
    fixture_session.browser.get('file:///D:/code/ppo/test/html/click_test.html')
    panel = fixture_session.wait_for(LoginPanel)
    assert (panel.get_attribute('name', 'value') == 'John')
    panel.clear('name')
    panel.type('name', 'xuzg')
    assert (panel.get_attribute('name', 'value') == 'xuzg')
예제 #2
0
def test_get_element_by_name(fixture_session: Context):
    fixture_session.browser.get('file:///D:/code/ppo/test/html/click_test.html')
    panel = fixture_session.wait_for(ClickPanel)
    element = panel.get_element_by_name('jump')
    assert (isinstance(element, WebElement))
예제 #3
0
def test_outer_html(fixture_session: Context):
    fixture_session.browser.get('file:///D:/code/ppo/test/html/click_test.html')
    panel = fixture_session.wait_for(ClickPanel)
    outer_html = panel.outer_html('jump')
    assert ('id="jump"' in outer_html)
    assert ('a href=' in outer_html)
예제 #4
0
def test_find_ui_node(fixture_session: Context):
    fixture_session.browser.get('file:///D:/code/ppo/test.html')
    panel = fixture_session.wait_for(PostPanel1)
    node = panel.find_ui_node('post1')
    assert (node['selector'] == 'body div:nth-child(1)')
    assert (node['name'] == 'post1')
예제 #5
0
def test_text_of(fixture_session: Context):
    fixture_session.browser.get('file:///D:/code/ppo/test/html/click_test.html')
    panel = fixture_session.wait_for(ClickPanel)
    text = panel.text_of('double')
    assert (text == 'Double-click me')
예제 #6
0
def test_mouse_over(fixture_session: Context):
    fixture_session.browser.get('file:///D:/code/ppo/test/html/click_test.html')
    panel = fixture_session.wait_for(MouseOverPanel)
    panel.hover('hover')
    assert (panel.text_of('hover') == 'I was Mouse-over!')
예제 #7
0
def test_page_jump_new(fixture_session: Context):
    fixture_session.browser.get('file:///D:/code/ppo/test/html/click_test.html')
    panel = fixture_session.wait_for(ClickPanel)
    panel.click('jump new')
    assert (panel.context.browser.current_url == 'file:///D:/code/ppo/test.html')
예제 #8
0
def test_double_click_element(fixture_session: Context):
    fixture_session.browser.get('file:///D:/code/ppo/test/html/click_test.html')
    panel = fixture_session.wait_for(ClickPanel)
    assert (panel.text_of('double') == 'Double-click me')
    panel.double_click('double')
    assert (panel.text_of('double') == 'I was double-clicked!')
예제 #9
0
def test_wait_for_element_locate_with_css_selector(fixture_session: Context):
    fixture_session.browser.get('file:///D:/code/ppo/test/html/click_test.html')
    panel = fixture_session.wait_for(ClickPanel)
    panel.wait_for_all_element_locate(css_selector='#single_click')
예제 #10
0
def test_wait_for_element_locate_with_name(fixture_session: Context):
    fixture_session.browser.get('file:///D:/code/ppo/test/html/click_test.html')
    panel = fixture_session.wait_for(ClickPanel)
    panel.wait_for_all_element_locate(name='single')
예제 #11
0
def test_get_attributes(fixture_session: Context):
    fixture_session.browser.get('file:///D:/code/ppo/test/html/click_test.html')
    panel = fixture_session.wait_for(ClickPanel)
    attrs = panel.get_attributes('single')
    assert (attrs['id'] == 'single_click')
    assert (attrs['onclick'] == 'SingleClick()')