/*
 * Copyright 2015 www.seleniumtests.com
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * http://www.apache.org/licenses/LICENSE-2.0
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.seleniumtests.tests;

import static com.seleniumtests.core.CustomAssertion.assertEquals;
import static com.seleniumtests.core.CustomAssertion.assertTrue;

import org.testng.annotations.Test;

import com.seleniumtests.core.SeleniumTestPlan;
import com.seleniumtests.core.TestLogging;

/**
 * Demonstrate test execution continues even though assertions fail.
 *
 * <p/>Date: 10/2/13 Time: 4:59 PM
 */
public class SoftAssertionTest extends SeleniumTestPlan {

    /**
     * Continues with test execution even though assertions fail.
     */
    @Test(groups = "softAssertionTest", description = "Continues with test execution even though assertions fail")
    public void softAssertionTest() {
        assertEquals(true, false, "boolean test failure");
        assertTrue(false, "another boolean test failure");
        assertEquals("selenium", "qtp", "universal test failure :)");
        assertTrue(1 == 1, "never fails");
        TestLogging.log(
            "This message is logged after initial assertion failures. Hence test execution continues even in the wake of test failures");
    }
}

@@ -619,39 +619,32 @@
 .tests;%0A%0Aimport 
-static 
 com.seleniumtest
@@ -669,21 +669,8 @@
 tion
-.assertEquals
 ;%0Aim
@@ -678,15 +678,8 @@
 ort 
-static 
 com.
@@ -701,36 +701,68 @@
 ore.
-CustomAssertion.assertTrue;%0A
+SeleniumTestPlan;%0Aimport com.seleniumtests.core.TestLogging;
 %0Aimp
@@ -794,32 +794,39 @@
 s.Test;%0A%0Aimport 
+static 
 com.seleniumtest
@@ -832,32 +832,44 @@
 ts.core.
-SeleniumTestPlan
+CustomAssertion.assertEquals
 ;%0Aimport
@@ -861,32 +861,39 @@
 tEquals;%0Aimport 
+static 
 com.seleniumtest
@@ -899,27 +899,42 @@
 ts.core.
-TestLogging
+CustomAssertion.assertTrue
 ;%0A%0A/**%0A 
@@ -1727,20 +1727,181 @@
 failures%22);%0A
+        // with out assertion check, soft failures would not be caught%0A        assert CustomAssertion.getVerificationFailures().isEmpty():%22Verification Errors%22;%0A
     %7D%0A%7D%0A

check soft failures