automated.assertions.TestAssertion Maven / Gradle / Ivy
The newest version!
package automated.assertions;
import automated.reporting.TestReporter;
/**
* Created by Ismail on 12/25/2017.
* This class Manage Test Assertions and Provide Methods that will be
* used inside any outside class in framework
*/
public class TestAssertion {
/*************** Class Methods Section ***************/
// This method to execute assertion for current title
public static void assertCurrentTitle(String expectedTitle, String errMessage) {
// Call assertCurrentTitle method from SeleniumAssertion class
SeleniumAssertion.assertCurrentTitle(expectedTitle, errMessage);
}
// This method to execute assertion between strings
public static void assertStringEquals(String actual, String expected, String errMessage) {
// Call verifyTwoStrings method from StringAssertion class
StringAssertion.verifyTwoStrings(actual, expected, errMessage);
// If assertion passed then will write step passed in report
TestReporter.pass("The Provided Strings are equals, actual: " + actual
+ " and Expected: " + expected);
}
// This method to execute assertion for current URL
public static void verifyCurrentURL(String expectedURL, String errMessage) {
// Call assertCurrentURL method from SeleniumAssertion class
SeleniumAssertion.assertCurrentURL(expectedURL, errMessage);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy