use of com.seleniumtests.connectors.selenium.fielddetector.Label in project seleniumRobot by bhecquet.
the class TestLabel method testMatchesNull.
@Test(groups = { "ut" })
public void testMatchesNull() {
Label l1 = new Label(0, 100, 0, 20, "foobar");
Assert.assertFalse(l1.match(null));
}
use of com.seleniumtests.connectors.selenium.fielddetector.Label in project seleniumRobot by bhecquet.
the class TestLabel method testNoMatchByText.
@Test(groups = { "ut" })
public void testNoMatchByText() {
Label l1 = new Label(0, 100, 0, 20, "foobar");
Label l2 = new Label(0, 99, 0, 20, "barfoo");
Assert.assertFalse(l1.match(l2));
}
use of com.seleniumtests.connectors.selenium.fielddetector.Label in project seleniumRobot by bhecquet.
the class TestLabel method testMatchesEmptyText.
@Test(groups = { "ut" })
public void testMatchesEmptyText() {
Label l1 = new Label(0, 100, 0, 20, "");
Label l2 = new Label(0, 99, 0, 20, "");
Assert.assertTrue(l1.match(l2));
}
use of com.seleniumtests.connectors.selenium.fielddetector.Label in project seleniumRobot by bhecquet.
the class TestLabel method testMatches.
@Test(groups = { "ut" })
public void testMatches() {
Label l1 = new Label(0, 100, 0, 20, "foobar");
Label l2 = new Label(0, 99, 0, 20, "fooba");
Assert.assertTrue(l1.match(l2));
}
use of com.seleniumtests.connectors.selenium.fielddetector.Label in project seleniumRobot by bhecquet.
the class TestLabel method testFieldAndLabelNotAligned2.
/**
* Field on the right, but not aligned horizontally
*
* ------
* Field
* ------
*
* -----
* Label
* -----
*/
@Test(groups = { "ut" })
public void testFieldAndLabelNotAligned2() {
Label label = Label.fromJson(new JSONObject("{" + " \"top\": 200," + " \"left\": 300," + " \"width\": 100," + " \"height\": 20," + " \"right\": 400," + " \"bottom\": 220," + " \"text\": \"My link Parent\"" + " }"));
Field field = Field.fromJson(new JSONObject("{" + " \"class_id\": 3," + " \"top\": 100," + " \"left\": 200," + " \"width\": 100," + " \"height\": 20," + " \"right\": 300," + " \"bottom\": 120," + " \"class_name\": \"radio_with_label\"," + " \"text\": \"= Value 4\"," + " \"related_field\": null," + " \"with_label\": true" + " }"));
Assert.assertFalse(label.isInside(field));
Assert.assertFalse(label.isFieldLeftOf(field));
Assert.assertFalse(label.isFieldRightOf(field));
Assert.assertFalse(label.isFieldAbove(field));
Assert.assertFalse(label.isFieldBelow(field));
}
Aggregations