com.codacy.scoobydoo.web.SoftAssertionsWrapper Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of scooby-doo-fwk Show documentation
Show all versions of scooby-doo-fwk Show documentation
Automated testing framework
package com.codacy.scoobydoo.web;
import com.codacy.scoobydoo.LoggingHelper;
import org.testng.asserts.SoftAssert;
public class SoftAssertionsWrapper extends SoftAssert {
private final SoftAssert softAssert;
// TODO: this method should be static / Utils class.
public SoftAssertionsWrapper() {
this.softAssert = new SoftAssert();
}
public SoftAssert getSoftAssert() {
return softAssert;
}
public void assertAll() {
try {
softAssert.assertAll();
} catch (AssertionError e) {
LoggingHelper.error("Error on soft assertion.", e);
throw e;
}
LoggingHelper.info("All the assertions were right.");
}
public void assertEqualsWithLogs(Object actualObject, Object expectedObject, String errorMessage, String loggingMessage) {
LoggingHelper.info(loggingMessage);
softAssert.assertEquals(actualObject, expectedObject, errorMessage);
}
public void assertTrueWithLogs(Boolean actualBoolean, String errorMessage, String loggingMessage) {
LoggingHelper.info(loggingMessage);
softAssert.assertTrue(actualBoolean, errorMessage);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy