use of uk.nhs.digital.ps.test.acceptance.models.Publication in project hippo by NHS-digital-website.
the class PublicationSteps method thenItIsVisibleToConsumers.
@Then(("^it is visible to consumers"))
public void thenItIsVisibleToConsumers() throws Throwable {
final Publication publication = testDataRepo.getCurrentPublication();
publicationPage.open(publication);
assertThat("Publication title is as expected", sitePage.getDocumentTitle(), is(publication.getTitle()));
assertThat("Publication summary is as expected", publicationPage.getSummaryText(), is(publication.getSummary()));
assertThat("Geographic coverage is as expected", publicationPage.getGeographicCoverage(), is(publication.getGeographicCoverage().getDisplayValue()));
assertThat("Publication information type is as expected", publicationPage.getInformationType(), is(publication.getInformationType().getDisplayName()));
assertThat("Granularity is as expected", publicationPage.getGranularity(), is(publication.getGranularity().getDisplayValue()));
iCanSeeTheSectionedPublicationBody();
assertAttachmentsUpload(publication.getAttachments());
}
use of uk.nhs.digital.ps.test.acceptance.models.Publication 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.models.Publication in project hippo by NHS-digital-website.
the class CmsSteps method givenIHaveAPublishedPublicationWithNominalDateFallingBeforeWeeksFromNow.
@Given("^I have a published publication with nominal date falling before (-?\\d+) (days|weeks|years) from now$")
public void givenIHaveAPublishedPublicationWithNominalDateFallingBeforeWeeksFromNow(final int valueFromNow, final String unit) throws Throwable {
ChronoUnit chronoUnit = ChronoUnit.valueOf(unit.toUpperCase());
final Publication publicationWithNominalDateBeforeCutOff = TestDataFactory.createBareMinimumPublication().withNominalDate(LocalDateTime.now().plus(valueFromNow, chronoUnit).toInstant(ZoneOffset.UTC)).build();
testDataRepo.setPublication(publicationWithNominalDateBeforeCutOff);
createPublishedPublication(publicationWithNominalDateBeforeCutOff);
}
use of uk.nhs.digital.ps.test.acceptance.models.Publication in project hippo by NHS-digital-website.
the class CmsSteps method givenIHaveAReleasedPublicationFlaggedAsUpcoming.
// Scenario: Details are hidden from the end users in a published upcoming publication ==============================
@Given("^I have a published publication flagged as upcoming$")
public void givenIHaveAReleasedPublicationFlaggedAsUpcoming() throws Throwable {
final Publication publication = ExpectedTestDataProvider.getPublishedUpcomingPublications().build().get(0);
testDataRepo.setPublication(publication);
createPublicationInEditableState(publication);
whenIPopulateAndSaveThePublication();
whenIPublishThePublication();
}
use of uk.nhs.digital.ps.test.acceptance.models.Publication in project hippo by NHS-digital-website.
the class CmsSteps method whenICreateANewPublicationWithTaxonomy.
@When("^I create a publication with taxonomy$")
public void whenICreateANewPublicationWithTaxonomy() throws Throwable {
final Publication publication = TestDataFactory.createBareMinimumPublication().withTaxonomy(Taxonomy.createNew("Conditions", "Accidents and injuries", "Falls")).build();
testDataRepo.setPublication(publication);
assertThat("New publication created.", contentPage.newPublication(publication), is(true));
}
Aggregations