use of uk.nhs.digital.ps.test.acceptance.models.PublicationArchive in project hippo by NHS-digital-website.
the class TestDataSteps method discardEditedDocument.
/**
* <p>
* Closes the current publication discarding current changes.
* </p><p>
* Only applicable to scenarios that leave the document in editable state; implemented as an {@linkplain After}
* hook rather than a step because this is really a test cleanup/tear-down activity that doesn't warrant expressing
* explicitly as a scenario step.
* </p><p>
* To ensure that this method gets called at the end of your scenario, tag the scenario with
* {@code @DiscardAfter}.
* </p>
*/
@After(value = "@DiscardAfter", order = 500)
public void discardEditedDocument() throws Throwable {
Publication currentPublication = testDataRepo.getCurrentPublication();
if (currentPublication != null) {
final String currentPublicationName = currentPublication.getName();
log.debug("Discarding and closing current publication: {}.", currentPublicationName);
contentPage.discardUnsavedChanges(currentPublicationName);
}
Dataset dataset = testDataRepo.getDataset();
if (dataset != null) {
String datasetName = dataset.getName();
log.debug("Discarding and closing current dataset: {}.", datasetName);
contentPage.discardUnsavedChanges(datasetName);
}
PublicationSeries series = testDataRepo.getPublicationSeries();
if (series != null) {
final String currentSeriesName = series.getName();
log.debug("Discarding and closing current series: {}.", currentSeriesName);
contentPage.discardUnsavedChanges(currentSeriesName);
}
PublicationArchive archive = testDataRepo.getPublicationArchive();
if (archive != null) {
final String currentArchiveName = archive.getName();
log.debug("Discarding and closing current archive: {}.", currentArchiveName);
contentPage.discardUnsavedChanges(currentArchiveName);
}
}
use of uk.nhs.digital.ps.test.acceptance.models.PublicationArchive in project hippo by NHS-digital-website.
the class CmsSteps method createArchiveInEditableState.
private void createArchiveInEditableState() throws Throwable {
loginSteps.loginAsCiEditor();
contentPage.openContentTab();
final PublicationArchive publicationArchive = TestDataFactory.createArchive().build();
testDataRepo.setPublicationArchive(publicationArchive);
contentPage.newArchive(publicationArchive);
}
Aggregations