diff --git a/src/test/java/stepdefinitions/ContentInformationSteps.java b/src/test/java/stepdefinitions/ContentInformationSteps.java index 93ade5e..04b0660 100644 --- a/src/test/java/stepdefinitions/ContentInformationSteps.java +++ b/src/test/java/stepdefinitions/ContentInformationSteps.java @@ -11,7 +11,6 @@ import ui.components.FooterComponent; import ui.pages.CatalogPage; import ui.pages.DownloadClientPage; -import ui.pages.FileViewer; import ui.pages.HelpPage; import ui.pages.HomePage; @@ -46,10 +45,6 @@ public class ContentInformationSteps { @Autowired DownloadClientPage downloadClientPage; - @Lazy - @Autowired - FileViewer fileViewer; - @When("Open Project Catalog") public void openProjectCatalog() { footerComponent.openProjectCatalog(); @@ -131,10 +126,4 @@ public void openPrivacyPolicy() { footerComponent.openPrivacyPolicy(); } - @Then("File {word} is viewed") - public void fileIsViewed(String fileName) { - // TODO: Move this method to FileSteps? - assertThat(fileViewer.getFileTitle()).isEqualTo(fileName); - } - } diff --git a/src/test/java/stepdefinitions/FileSteps.java b/src/test/java/stepdefinitions/FileSteps.java index 1d43573..0fc0b77 100644 --- a/src/test/java/stepdefinitions/FileSteps.java +++ b/src/test/java/stepdefinitions/FileSteps.java @@ -12,6 +12,7 @@ import io.cucumber.datatable.DataTable; import io.cucumber.java.en.Then; import io.cucumber.java.en.When; +import ui.pages.FileViewer; import ui.pages.MarkdownViewer; /** @@ -29,6 +30,10 @@ public class FileSteps { @Autowired MarkdownViewer markdownViewer; + @Lazy + @Autowired + FileViewer fileViewer; + @Then("Markdown file title {word} present") public void markdownFileTitlePresent(String fileName) { String fileTitle = markdownViewer.getFileName(); @@ -78,4 +83,9 @@ public void editArchiveMetadata(DataTable archiveMetadataTable) { archiveMetadataMap.get("institute")); } + @Then("File {word} is viewed") + public void fileIsViewed(String fileName) { + assertThat(fileViewer.getFileTitle()).isEqualTo(fileName); + } + }