use of uk.nhs.digital.ps.test.acceptance.pages.widgets.ImageSectionWidget in project hippo by NHS-digital-website.
the class ImagePairSection method getMatcher.
public Matcher<? super SectionWidget> getMatcher() {
return new TypeSafeDiagnosingMatcher<SectionWidget>(ImagePairSectionWidget.class) {
@Override
protected boolean matchesSafely(SectionWidget item, Description desc) {
ImagePairSectionWidget widget = (ImagePairSectionWidget) item;
List<ImageSectionWidget> imageSectionWidgets = widget.getImageSectionWidgets();
// pad with nulls for the 2 slots we could have had images in
while (imageSectionWidgets.size() < 2) {
imageSectionWidgets.add(null);
}
return compare(first.getMatcher(), imageSectionWidgets.get(0), desc) && compare(second == null ? nullValue() : second.getMatcher(), imageSectionWidgets.get(1), desc);
}
@Override
public void describeTo(Description description) {
description.appendValue(ImagePairSection.this);
}
};
}
Aggregations