Search in sources :

Example 31 with Filter

use of com.seleniumtests.core.Filter in project seleniumRobot by bhecquet.

the class TestFilter method inWrong.

/**
 ******* IN *****************************
 * Test if the parameters contain a Filter's name (key)
 * IN without a value of the filter's array, then match is false
 */
@Test(groups = { "ut" })
public void inWrong() {
    // 
    String[] t = { "whatever1", "whatever3" };
    Filter f = Filter.in("in", t);
    boolean result = f.match(parameters1);
    Assert.assertEquals(result, false);
}
Also used : Filter(com.seleniumtests.core.Filter) Test(org.testng.annotations.Test) GenericTest(com.seleniumtests.GenericTest)

Example 32 with Filter

use of com.seleniumtests.core.Filter in project seleniumRobot by bhecquet.

the class TestFilter method contains.

/**
 ******* CONTAINS ************************
 * Test if the parameters contain a Filter's name (key)
 * CONTAINS with a value that contains the Filter's value, then match is true
 */
@Test(groups = { "ut" })
public void contains() {
    Filter f = Filter.contains("contains", "whatever1");
    boolean result = f.match(parameters1);
    Assert.assertEquals(result, true);
}
Also used : Filter(com.seleniumtests.core.Filter) Test(org.testng.annotations.Test) GenericTest(com.seleniumtests.GenericTest)

Example 33 with Filter

use of com.seleniumtests.core.Filter in project seleniumRobot by bhecquet.

the class TestFilter method lessThanDateHigherF.

/**
 ******* LESS_THAN **********************
 * Test if the parameters contain a Filter's name (key)
 * LESS_THAN with a lower Date value (than the filter), then match is true.
 */
@Test(groups = { "ut" })
public void lessThanDateHigherF() {
    Date dateF = new Date();
    dateF = dateFromString(dateF, "07-30-2016");
    Filter f = Filter.lt("lessThanDate", dateF);
    boolean result = f.match(parameters1);
    Assert.assertEquals(result, true);
}
Also used : Filter(com.seleniumtests.core.Filter) Date(java.util.Date) Test(org.testng.annotations.Test) GenericTest(com.seleniumtests.GenericTest)

Example 34 with Filter

use of com.seleniumtests.core.Filter in project seleniumRobot by bhecquet.

the class TestSpreadSheetHelper method testgetEntitiesWithFilterFromSpreadSheet.

/**
 * Test read Entities from CSV file (no headers), with filter: select line containing "jaune".
 * @throws Exception
 */
@Test(groups = { "ut" })
public void testgetEntitiesWithFilterFromSpreadSheet() throws Exception {
    Filter filter = Filter.contains("test;test2", "jaune");
    Iterator<Object[]> dataIterator = SpreadSheetHelper.getEntitiesFromSpreadsheet(null, null, "src/test/resources/ti/excel/test.csv", filter);
    Assert.assertTrue(dataIterator.next()[0].equals("jaune;vert"));
    Assert.assertFalse(dataIterator.hasNext());
}
Also used : Filter(com.seleniumtests.core.Filter) Test(org.testng.annotations.Test) GenericTest(com.seleniumtests.GenericTest)

Aggregations

Filter (com.seleniumtests.core.Filter)34 GenericTest (com.seleniumtests.GenericTest)32 Test (org.testng.annotations.Test)32 Date (java.util.Date)3 CustomSeleniumTestsException (com.seleniumtests.customexception.CustomSeleniumTestsException)1 DatasetException (com.seleniumtests.customexception.DatasetException)1 FileInputStream (java.io.FileInputStream)1 IOException (java.io.IOException)1 InputStream (java.io.InputStream)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1