use of uk.nhs.digital.ps.test.acceptance.pages.widgets.SectionWidget in project hippo by NHS-digital-website.
the class PublicationSteps method iCanSeeTheSectionedPublicationBody.
@Then("^I can see the sectioned publication body$")
public void iCanSeeTheSectionedPublicationBody() throws Throwable {
Publication publication = testDataRepo.getCurrentPublication();
List<Matcher<? super SectionWidget>> matchers = publication.getBodySections().stream().map(BodySection::getMatcher).collect(Collectors.toList());
assertThat("Body sections are as expected", publicationPage.getBodySections(), contains(matchers));
}
use of uk.nhs.digital.ps.test.acceptance.pages.widgets.SectionWidget 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