Beispiel #1
0
def test_build_selector_widget_has_href():
    # Arrange
    widget = {'properties': {'tagName': 'tag_name', 'href': 'href_1'}}
    selectors = {}

    # Act
    result = StateAbstracter.build_selector(widget, selectors)

    # Assert
    assert selectors["tag_name[href='href_1']"] == 0
    assert result == "tag_name[href='href_1']:visible:eq(0)"
Beispiel #2
0
def test_build_selector_does_already_exist():
    # Arrange
    widget = {'properties': {'tagName': 'tag_name'}}
    selectors = {'tag_name': 0}

    # Act
    result = StateAbstracter.build_selector(widget, selectors)

    # Assert
    assert selectors['tag_name'] == 1
    assert result == 'tag_name:visible:eq(1)'