package com.seleniumtests.tests;

import static com.seleniumtests.core.CustomAssertion.*;
import com.seleniumtests.core.SeleniumTestPlan;
import static org.hamcrest.CoreMatchers.*;
import org.hamcrest.MatcherAssert;
import org.hamcrest.Matchers;
import org.testng.annotations.Test;

/**
 * Using Matchers
 */
public class RetryTest2 extends SeleniumTestPlan {

    /**
     * Will not retry as test would never fail
     */
	@Test(groups="retryTest2", description = "Will retry failed assertions in this test")
	public void retryFailedTest() {
        assertThat("1 is always equal to 1", 1==1);  // This won't fail
        assertThat("1 can not be equal to 2", 1, is(2));
        assertThat("2 is always equal to 2", 2, equalTo(2));   // This won't fail
        assertThat("2 is always equal to 2", 2, is(equalTo(2)));   // Same as previous statement
        assertThat("2 can not be equal to 3", 2, is(3));
        MatcherAssert.assertThat("Hello", allOf(equalTo("Hello1"), equalTo("Hello")));
	}
}

@@ -276,16 +276,42 @@
 .Test;%0A%0A
+import java.util.Arrays;%0A%0A
 /**%0A * U
@@ -940,22 +940,328 @@
     
-MatcherAssert.
+assertThat(%22Hello%22, is(allOf(equalTo(%22Hello%22), containsString(%22selenium%22), startsWith(%22YouTube%22), endsWith(%22Tellurium%22)))); // This fails%0A        assertThat(%22Hello%22, is(not(allOf(equalTo(%22Hello%22), containsString(%22selenium%22), startsWith(%22YouTube%22), endsWith(%22Tellurium%22))))); // Negative condition hence succeeds%0A        
 asse
@@ -1276,16 +1276,19 @@
 Hello%22, 
+is(
 allOf(eq
@@ -1303,13 +1303,117 @@
 ello
-1
 %22), 
+containsString(%22Hello%22), startsWith(%22Hello%22), endsWith(%22Hello%22))));%0A        assertThat(%22Hello%22, is(anyOf(
 equa
@@ -1426,15 +1426,115 @@
 ello
+1
 %22)
-));%0A%09%7D
+, is(%22Hello2%22), containsString(%22ell1%22), startsWith(%221Hell%22), endsWith(%22llo123%22)))); // This fails%0A%0A    %7D%0A
 %0A%7D%0A

add hamcrest test