checkCondition

Share on Facebook1Share on LinkedIn0Share on Google+0Tweet about this on Twitter0Email this to someoneDigg this

public void checkCondition(boolean condition, String message) throws IOException {
try {
assertTrue(condition);
System.out.println(message);
} catch (AssertionError e) {
message = message.contains("is displayed") ? message.replace("is displayed",
"is not displayed") : message.contains("is disabled") ? message.replace("is disabled",
"is not disabled") : message.contains("is enabled") ? message.replace("is enabled",
"is not enabled") : message.contains("is not enabled") ? message.replace("is not enabled",
"is enabled") : message.contains("is generated") ? message.replace("is generated",
"is not generated") : message.contains("is selected") ? message.replace("is selected",
"is not selected") : message.contains("is identified") ? message.replace("is identified",
"is not identified") : message.contains("is added") ? message.replace("is added",
"is not added") : message.contains("is successfully") ? message.replace("is successfully",
"is not successfully") : message.contains("is highlighted") ? message.replace("is highlighted",
"is not highlighted") : message.contains("is being Processed") ? message.replace("is being Processed",
"has Failed") : message.contains("has warning symbol") ? message.replace("has warning symbol",
"has no warning symbol") : message;
System.err.println(message);
}
}


Leave a Reply

Your email address will not be published. Required fields are marked *