Skip to content

Commit

Permalink
#2 Move fileIsViewed() method from ContentInformationSteps to FileSteps
Browse files Browse the repository at this point in the history
  • Loading branch information
helkv committed Jan 20, 2020
1 parent 84fa85a commit 3266d2a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
11 changes: 0 additions & 11 deletions src/test/java/stepdefinitions/ContentInformationSteps.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -46,10 +45,6 @@ public class ContentInformationSteps {
@Autowired
DownloadClientPage downloadClientPage;

@Lazy
@Autowired
FileViewer fileViewer;

@When("Open Project Catalog")
public void openProjectCatalog() {
footerComponent.openProjectCatalog();
Expand Down Expand Up @@ -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);
}

}
10 changes: 10 additions & 0 deletions src/test/java/stepdefinitions/FileSteps.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
Expand All @@ -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();
Expand Down Expand Up @@ -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);
}

}

0 comments on commit 3266d2a

Please sign in to comment.