this.property = property;
this.value = value;
}
public void play(ComponentFinder resolver) {
MComponent component = resolver.getMComponentById(getComponentId());
Object actual;
Object expected;
if (property.equals("Text")) {
actual = component.getComparableObject();
expected = component.getComparableObject(value);
} else {
actual = component.getProperty(property);
expected = value;
}
if (actual == null && expected == null)
return;
if (actual == null || expected == null) {
AssertionFailedError e = new AssertionFailedError("component <" + component.getMComponentName() + ">", expected,
actual, scriptModel, windowMonitor);
e.captureScreen();
throw e;
}
String expectedString = expected.toString();
if (isRegex(expectedString) && Pattern.matches(expectedString.substring(1), actual.toString())) {
return;
}
if ((expectedString.startsWith("//") && expectedString.substring(1).equals(actual.toString()))
|| expectedString.equals(actual.toString()))
return;
AssertionFailedError e = new AssertionFailedError("component <" + component.getMComponentName() + ">", expected, actual,
scriptModel, windowMonitor);
e.captureScreen();
throw e;
}