Search in sources :

Example 21 with Filter

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

the class TestFilter method isEqual.

/**
 ******* EQUALS ************************
 * Test if the parameters contain a Filter's name (key)
 * EQUALS with the exact same value, then match is true.
 */
@Test(groups = { "ut" })
public void isEqual() {
    Filter f = Filter.isEqual("isEqual", "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 22 with Filter

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

the class TestFilter method notWrong.

/**
 ******* NOT ****************************
 * Test if the match result is the opposite,
 * NOT what the given Filter would output.
 * i.e, true when it should be false
 */
@Test(groups = { "ut" })
public void notWrong() {
    final Filter f1 = Filter.contains("contains", "whatever2");
    Filter fNot = Filter.not(f1);
    boolean result = fNot.match(parameters1);
    Assert.assertEquals(result, true);
}
Also used : Filter(com.seleniumtests.core.Filter) Test(org.testng.annotations.Test) GenericTest(com.seleniumtests.GenericTest)

Example 23 with Filter

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

the class TestFilter method in.

/*
     * BETWEEN filters (number and date) not created yet.
     */
/**
 ******* IN *****************************
 * Test if the parameters contain a Filter's name (key)
 * IN with a value of the filter's array, then match is true
 */
@Test(groups = { "ut" })
public void in() {
    String[] t = { "whatever1", "whatever2", "whatever3" };
    Filter f = Filter.in("in", t);
    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 24 with Filter

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

the class TestFilter method lessThanNumberSameF.

/**
 ******* LESS_THAN **********************
 * Test if the parameters contain a Filter's name (key)
 * LESS_THAN with the same Number value (than the filter), then match is false.
 */
@Test(groups = { "ut" })
public void lessThanNumberSameF() {
    Filter f = Filter.lt("lessThanNumber", 5);
    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 25 with Filter

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

the class TestFilter method lessThanNumberLowerF.

/**
 ******* LESS_THAN **********************
 * Test if the parameters contain a Filter's name (key)
 * LESS_THAN with a higher Number value (than the filter), then match is true.
 */
@Test(groups = { "ut" })
public void lessThanNumberLowerF() {
    Filter f = Filter.lt("lessThanNumber", 4);
    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)

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