Search in sources :

Example 26 with Filter

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

the class TestFilter method containsIgnoreCase.

/**
 ******* CONTAINS_IGNORE_CASE *************
 * Test if the parameters contain a Filter's name (key)
 * CONTAINS_IGNORE_CASE with a value that contains the Filter's value,
 * but with different case, then match is true
 */
@Test(groups = { "ut" })
public void containsIgnoreCase() {
    Filter f = Filter.containsIgnoreCase("containsIgnoreCase", "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 27 with Filter

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

the class TestFilter method greaterThanNumberHigherF.

/*
     * GREATER_THAN filter (date) not created yet.
     */
/**
 ******* GREATER_THAN *******************
 * Test if the parameters contain a Filter's name (key)
 * GREATER_THAN with a lower Number value (than the filter), then match is false.
 */
@Test(groups = { "ut" })
public void greaterThanNumberHigherF() {
    Filter f = Filter.greaterThan("greaterThanNumber", 6);
    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 28 with Filter

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

the class TestFilter method wrongName.

/**
 * Test if the parameters do not contain a Filter's name (key)
 */
@Test(groups = { "ut" })
public void wrongName() {
    Filter f = Filter.isEqual("equals", "whatever1");
    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 29 with Filter

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

the class TestFilter method lessThanDateSameF.

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

Example 30 with Filter

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

the class TestFilter method not.

/*
     * IS_NULL filter not created yet.
     */
/**
 ******* NOT ****************************
 * Test if the match result is the opposite,
 * NOT what the given Filter would output.
 * i.e, false when it should be true
 */
@Test(groups = { "ut" })
public void not() {
    final Filter f1 = Filter.contains("contains", "whatever1");
    Filter fNot = Filter.not(f1);
    boolean result = fNot.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