diff --git a/src/main/java/ui/components/FooterComponent.java b/src/main/java/ui/components/FooterComponent.java index 3d61e4c..da9789f 100644 --- a/src/main/java/ui/components/FooterComponent.java +++ b/src/main/java/ui/components/FooterComponent.java @@ -35,7 +35,7 @@ public class FooterComponent extends BasePage { @FindBy(linkText = "About") private WebElement aboutLink; - @FindBy(id = "footer-img") + @FindBy(xpath = "//*[@id='footer-header']/*[contains(@class,'keeper-icon-triangle-up')]") private WebElement footerFoldOutElement; @FindBy(linkText = "About Keeper") @@ -50,11 +50,11 @@ public class FooterComponent extends BasePage { @FindBy(linkText = "Download the Keeper client for Windows, Linux, Mac, Android and iPhone") private WebElement downloadClientLink; - @FindBy(id = "seafile-logo") - private WebElement seafileLogo; + @FindBy(xpath = "//img[@id='seafile-logo']/parent::a") + private WebElement seafileLink; - @FindBy(id = "MPDL-logo") - private WebElement mpdlLogo; + @FindBy(xpath = "//img[@id='MPDL-logo']/parent::a") + private WebElement mpdlLink; @FindBy(linkText = "Contact Keeper Support") private WebElement contactKeeperSupportLink; @@ -87,7 +87,7 @@ public void openHelpPage() { public void openAboutDialog() { this.aboutLink.click(); - wait.until(ExpectedConditions.elementToBeClickable(By.id("simplemodal-container"))); + wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//*[@class='modal-dialog']"))); } public void openAboutKeeper() { @@ -129,19 +129,17 @@ public void openDownloadClientPage() { public String getSeafileLink() { this.footerFoldOutElement.click(); - wait.until(ExpectedConditions.elementToBeClickable(this.seafileLogo)); - String onclick = this.seafileLogo.getAttribute("onclick"); + wait.until(ExpectedConditions.elementToBeClickable(this.seafileLink)); - String seafileLink = onclick.replace("window.open('", "").replace("');", ""); + String seafileLink = this.seafileLink.getAttribute("href"); return seafileLink; } public String getMpdlLink() { this.footerFoldOutElement.click(); - wait.until(ExpectedConditions.elementToBeClickable(this.mpdlLogo)); - String onclick = this.mpdlLogo.getAttribute("onclick"); + wait.until(ExpectedConditions.elementToBeClickable(this.mpdlLink)); - String mpdlLink = onclick.replace("window.open('", "").replace("');", ""); + String mpdlLink = this.mpdlLink.getAttribute("href"); return mpdlLink; } diff --git a/src/main/java/ui/pages/HomePage.java b/src/main/java/ui/pages/HomePage.java index 06de2c8..7e08dae 100644 --- a/src/main/java/ui/pages/HomePage.java +++ b/src/main/java/ui/pages/HomePage.java @@ -10,6 +10,7 @@ import org.openqa.selenium.JavascriptExecutor; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; +import org.openqa.selenium.interactions.Actions; import org.openqa.selenium.support.FindBy; import org.openqa.selenium.support.ui.ExpectedConditions; import org.springframework.beans.factory.annotation.Autowired; @@ -32,16 +33,19 @@ public class HomePage extends BasePage { @FindBy(id = "my-info") private WebElement userElement; - @FindBy(id = "logout") + @FindBy(xpath = "//*[@id='user-info-popup']//a[text()='Log out']") private WebElement logoutElement; - @FindBy(id = "my-repos") + @FindBy(xpath = "//h3[text()='My Libraries']") + private WebElement myLibrariesHeading; + + @FindBy(xpath = "//div[@class='cur-view-container']") private WebElement myLibrariesDiv; - @FindBy(xpath = "//*[@id='my-repos-toolbar']/button[contains(@class,'repo-create')]") + @FindBy(xpath = "//button[@title='New Library']") private WebElement newLibraryButton; - @FindBy(id = "side-nav") + @FindBy(className = "side-nav") private WebElement sideNavigationDiv; @Autowired @@ -78,28 +82,33 @@ public String lookUpUserAccountName() { WebElement userAccountButton = driver.findElement(By.id("my-info")); userAccountButton.click(); - WebElement accountName = driver.findElement(By.xpath("//div[@class='item ovhd']/div[@class='txt']")); + WebElement accountName = driver + .findElement(By.xpath("//div[@id='account']//div[@class='item o-hidden']/div[@class='txt']")); return accountName.getText(); } public HomePage createNewLibrary(String newLibraryName) { newLibraryButton.click(); WebElement newLibraryDialog = wait - .until(ExpectedConditions.visibilityOfElementLocated(By.id("simplemodal-container"))); + .until(ExpectedConditions.visibilityOfElementLocated(By.className("modal-content"))); - WebElement libraryNameInput = newLibraryDialog.findElement(By.id("repo-name")); + WebElement libraryNameInput = newLibraryDialog.findElement(By.id("repoName")); libraryNameInput.sendKeys(newLibraryName); - WebElement submit = newLibraryDialog.findElement(By.className("submit")); + WebElement submit = newLibraryDialog.findElement(By.xpath(".//button[text()='Submit']")); submit.click(); wait.until(ExpectedConditions.stalenessOf(newLibraryDialog)); + // TODO: Use different waiting strategy to wait for the success of this method + // (check AJAX request!?) + wait.until(ExpectedConditions.visibilityOfAllElementsLocatedBy( + By.xpath(".//a[contains(@href,'/library/') and text()='" + newLibraryName + "']"))); return homePage; } public List<String> readLibraryNames() { - List<WebElement> libraryLinks = this.myLibrariesDiv.findElements(By.xpath(".//*[@class='repo-name-span']/a")); + List<WebElement> libraryLinks = this.myLibrariesDiv.findElements(By.xpath(".//a[contains(@href,'/library/')]")); List<String> libraryNames = new ArrayList<>(); libraryLinks.forEach(libraryLink -> libraryNames.add(libraryLink.getText())); @@ -108,20 +117,20 @@ public List<String> readLibraryNames() { } public HomePage deleteLibrary(String libraryName) { - WebElement firstLibraryRow = wait.until(ExpectedConditions - .elementToBeClickable(By.xpath("//*[@id='my-repos']//a[text()='" + libraryName + "']/ancestor::tr"))); + WebElement firstLibraryRow = wait.until(ExpectedConditions.elementToBeClickable( + By.xpath("//div[@class='cur-view-container']//a[text()='" + libraryName + "']/ancestor::tr"))); + new Actions(driver).moveToElement(firstLibraryRow).perform(); WebElement deleteButton = firstLibraryRow.findElement(By.xpath(".//a[@title='Delete']")); - ((JavascriptExecutor) driver).executeScript("arguments[0].setAttribute('style','visibility:visible;');", - deleteButton); deleteButton.click(); wait.until(ExpectedConditions.visibilityOfElementLocated( - By.xpath("//*[@id='confirm-con']//*[contains(text(),'" + libraryName + "')]"))); - WebElement yesButton = wait.until(ExpectedConditions.elementToBeClickable(By.id("confirm-yes"))); - yesButton.click(); + By.xpath("//*[@class='modal-content']//*[contains(text(),'" + libraryName + "')]"))); + WebElement confirmDeleteButton = wait.until(ExpectedConditions + .elementToBeClickable(By.xpath("//*[@class='modal-content']//button[text()='Delete']"))); + confirmDeleteButton.click(); - wait.until(ExpectedConditions.visibilityOfElementLocated(By.id("my-libs-more-op"))); + wait.until(ExpectedConditions.visibilityOf(myLibrariesHeading)); return homePage; } @@ -131,7 +140,7 @@ public LibraryPage openLibrary(String libraryName) { WebElement libraryLink = wait.until(driver -> this.myLibrariesDiv.findElement(By.linkText(libraryName))); libraryLink.click(); - wait.until(ExpectedConditions.elementToBeClickable(By.id("share-cur-dir"))); + wait.until(ExpectedConditions.elementToBeClickable(By.xpath("//button[@title='Share']"))); wait.until(webDriver -> ((JavascriptExecutor) webDriver).executeScript("return document.readyState") .equals("complete")); @@ -142,17 +151,18 @@ public HomePage openMyLibraries() { WebElement myLibrariesButton = sideNavigationDiv.findElement(By.xpath(".//a[@title='My Libraries']")); myLibrariesButton.click(); - wait.until(ExpectedConditions.visibilityOfElementLocated(By.id("my-repos"))); - wait.until(webDriver -> ((Long) (((JavascriptExecutor) webDriver).executeScript("return jQuery.active")) == 0)); + wait.until(ExpectedConditions.visibilityOf(myLibrariesHeading)); + // TODO: Handle waiting for AJAX differently +// wait.until(webDriver -> ((Long) (((JavascriptExecutor) webDriver).executeScript("return jQuery.active")) == 0)); return homePage; } public boolean aboutDialogIsOpened() { - WebElement dialog = driver.findElement(By.id("simplemodal-container")); - List<WebElement> seafileLogo = dialog.findElements(By.xpath(".//img[@title='Seafile']")); + WebElement dialog = driver.findElement(By.xpath("//*[@class='modal-dialog']")); + List<WebElement> keeperLogo = dialog.findElements(By.xpath(".//img[@title='KEEPER']")); - return !seafileLogo.isEmpty(); + return !keeperLogo.isEmpty(); } public HomePage navigateTo() { @@ -160,8 +170,9 @@ public HomePage navigateTo() { driver.navigate().to(testDataProperties.getProperty("keeperUrl")); // Waiting for the HomePage to load by waiting for My Libraries - wait.until(ExpectedConditions.visibilityOfElementLocated(By.id("my-repos"))); - wait.until(webDriver -> ((Long) (((JavascriptExecutor) webDriver).executeScript("return jQuery.active")) == 0)); + wait.until(ExpectedConditions.visibilityOf(myLibrariesHeading)); + // TODO: Handle waiting for AJAX differently +// wait.until(webDriver -> ((Long) (((JavascriptExecutor) webDriver).executeScript("return jQuery.active")) == 0)); return homePage; } diff --git a/src/main/java/ui/pages/LibraryPage.java b/src/main/java/ui/pages/LibraryPage.java index dc01cea..660bcbb 100644 --- a/src/main/java/ui/pages/LibraryPage.java +++ b/src/main/java/ui/pages/LibraryPage.java @@ -11,6 +11,7 @@ import org.openqa.selenium.JavascriptExecutor; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; +import org.openqa.selenium.interactions.Actions; import org.openqa.selenium.support.FindBy; import org.openqa.selenium.support.ui.ExpectedConditions; import org.springframework.beans.factory.annotation.Autowired; @@ -32,10 +33,10 @@ @Scope(SCOPE_CUCUMBER_GLUE) public class LibraryPage extends BasePage { - @FindBy(id = "dir-view") + @FindBy(className = "cur-view-container") private WebElement directoryViewDiv; - @FindBy(id = "advanced-upload") + @FindBy(xpath = "//button[@title='Upload']") private WebElement uploadButton; @Autowired @@ -44,7 +45,7 @@ public LibraryPage(WebDriver driver) { } public List<String> readFileNames() { - List<WebElement> fileLinks = this.directoryViewDiv.findElements(By.xpath(".//*[@class='dirent-name']/a")); + List<WebElement> fileLinks = this.directoryViewDiv.findElements(By.xpath(".//a[contains(@href,'/lib/')]")); List<String> fileNames = new ArrayList<>(); fileLinks.forEach(fileLink -> fileNames.add(fileLink.getText())); @@ -58,7 +59,7 @@ public void openMarkdownElement(String elementName) { SeleniumUtil.switchToSecondTab(driver, wait); wait.until(ExpectedConditions.titleContains(elementName)); - wait.until(ExpectedConditions.elementToBeClickable(By.id("editButton"))); + wait.until(ExpectedConditions.elementToBeClickable(By.id("parentDirectory"))); wait.until(webDriver -> ((JavascriptExecutor) webDriver).executeScript("return document.readyState") .equals("complete")); } @@ -67,45 +68,44 @@ public void lockElement(String elementName) { WebElement elementLink = this.directoryViewDiv.findElement(By.linkText(elementName)); WebElement elementRow = elementLink.findElement(By.xpath(".//ancestor::tr")); - WebElement moreOptions = elementRow.findElement(By.className("more-op-icon")); + new Actions(driver).moveToElement(elementRow).perform(); + WebElement moreOptions = elementRow.findElement(By.xpath(".//*[@title='More Operations']")); moreOptions.click(); - WebElement lockFile = elementRow.findElement(By.className("lock-file")); + WebElement lockFile = elementRow.findElement(By.xpath(".//button[text()='Lock']")); lockFile.click(); - wait.until(ExpectedConditions.visibilityOfElementLocated(By.className("file-locked-icon"))); + wait.until(ExpectedConditions.visibilityOfElementLocated(By.className("locked"))); } public void unlockElement(String elementName) { WebElement elementLink = this.directoryViewDiv.findElement(By.linkText(elementName)); WebElement elementRow = elementLink.findElement(By.xpath(".//ancestor::tr")); - WebElement moreOptions = elementRow.findElement(By.className("more-op-icon")); + new Actions(driver).moveToElement(elementRow).perform(); + WebElement moreOptions = elementRow.findElement(By.xpath(".//*[@title='More Operations']")); // Selenium has problems hover/scroll element when clicking => Use JS to click ((JavascriptExecutor) driver).executeScript("arguments[0].click();", moreOptions); - WebElement unlockFile = elementRow.findElement(By.className("unlock-file")); + WebElement unlockFile = elementRow.findElement(By.xpath(".//button[text()='Unlock']")); unlockFile.click(); - wait.until(ExpectedConditions.invisibilityOfElementLocated(By.className("file-locked-icon"))); + wait.until(ExpectedConditions.invisibilityOfElementLocated(By.className("locked"))); } public boolean lockedIconVisible(String elementName) { WebElement elementLink = this.directoryViewDiv.findElement(By.linkText(elementName)); WebElement elementRow = elementLink.findElement(By.xpath(".//ancestor::tr")); - List<WebElement> lockIcon = elementRow.findElements(By.className("file-locked-icon")); + List<WebElement> lockIcon = elementRow.findElements(By.className("locked")); return !lockIcon.isEmpty(); } public void uploadFile(String fileName) { - // Check upload buttons are clickable: - this.uploadButton.click(); - WebElement uploadFilesButton = driver.findElement(By.className("advanced-upload-file")); - wait.until(ExpectedConditions.elementToBeClickable(uploadFilesButton)); - // Click on 'Upload' again to hide the field again + // Check upload buttons are clickable (Only to verify the buttons work): this.uploadButton.click(); + wait.until(ExpectedConditions.elementToBeClickable(By.xpath("//li[text()='Upload Files']"))); // Upload done using the upload input element: - WebElement uploadInputElement = driver.findElement(By.id("advanced-upload-file-input")); + WebElement uploadInputElement = driver.findElement(By.className("upload-input")); ((JavascriptExecutor) driver).executeScript("arguments[0].style.visibility = 'visible';", uploadInputElement); // FIXME: Move the extraction of the filepath to another class/method diff --git a/src/main/java/ui/pages/LoginPage.java b/src/main/java/ui/pages/LoginPage.java index 497f6ce..7506121 100644 --- a/src/main/java/ui/pages/LoginPage.java +++ b/src/main/java/ui/pages/LoginPage.java @@ -47,7 +47,7 @@ public HomePage login(String email, String password) { this.passwordInput.sendKeys(password); this.loginButton.click(); - wait.until(ExpectedConditions.visibilityOfElementLocated(By.id("my-libs-more-op"))); + wait.until(ExpectedConditions.visibilityOfElementLocated(By.id("account"))); return homePage; } diff --git a/src/main/java/ui/pages/MarkdownEditor.java b/src/main/java/ui/pages/MarkdownEditor.java index 8bd2d00..1e3b393 100644 --- a/src/main/java/ui/pages/MarkdownEditor.java +++ b/src/main/java/ui/pages/MarkdownEditor.java @@ -2,10 +2,14 @@ import static io.cucumber.spring.CucumberTestContext.SCOPE_CUCUMBER_GLUE; +import java.util.ArrayList; +import java.util.List; + import org.openqa.selenium.By; import org.openqa.selenium.Keys; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; +import org.openqa.selenium.support.FindBy; import org.openqa.selenium.support.ui.ExpectedConditions; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Lazy; @@ -23,11 +27,79 @@ @Scope(SCOPE_CUCUMBER_GLUE) public class MarkdownEditor extends BasePage { + // TODO: Split into a generic Markdown-Page and a specific + // ArchiveMetadata-Markdown-Page + + @FindBy(className = "file-name") + private WebElement fileName; + + @FindBy(className = "file-modifier-name") + private WebElement modifierName; + + @FindBy(className = "file-modifier-time") + private WebElement modifierTime; + + @FindBy(id = "shareBtn") + private WebElement shareButton; + + @FindBy(id = "parentDirectory") + private WebElement parentDirectroyButton; + + @FindBy(id = "saveButton") + private WebElement saveButton; + + @FindBy(className = "seafile-editor-outline") + private WebElement outline; + @Autowired public MarkdownEditor(WebDriver driver) { super(driver); } + public String getFileName() { + return fileName.getText(); + } + + public String getModifierName() { + return modifierName.getText(); + } + + public String getModifierTime() { + return modifierTime.getText(); + } + + public boolean buttonsPresent() { + return (this.shareButton.isDisplayed() && this.parentDirectroyButton.isDisplayed() + && this.saveButton.isDisplayed()); + } + + public List<String> getOutline() { + List<String> headings = new ArrayList<>(); + + this.openSidepanel(); + List<WebElement> outlineHeadings = this.outline.findElements(By.tagName("div")); + + for (WebElement heading : outlineHeadings) { + String headingTitle = heading.getText(); + headings.add(headingTitle); + } + + return headings; + } + + public List<String> getOutlineContent() { + List<String> content = new ArrayList<>(); + + List<WebElement> contentElements = driver.findElements(By.xpath("//h2/following-sibling::p")); + + for (WebElement contentElement : contentElements) { + String contentText = contentElement.getText(); + content.add(contentText); + } + + return content; + } + public MarkdownEditor editContent(String title, String author, String description, String year, String institute) { this.addTitle(title); this.addAuthor(author); @@ -38,12 +110,12 @@ public MarkdownEditor editContent(String title, String author, String descriptio // Resource Type (has default value) // License (Optional) - WebElement saveButton = driver.findElement(By.id("saveButton")); - saveButton.click(); + WebElement staleElement = driver.findElement(By.id("moreButton")); + this.saveButton.click(); driver.navigate().refresh(); - wait.until(ExpectedConditions.stalenessOf(saveButton)); - wait.until(ExpectedConditions.elementToBeClickable(By.id("editButton"))); + wait.until(ExpectedConditions.stalenessOf(staleElement)); + wait.until(ExpectedConditions.elementToBeClickable(By.id("parentDirectory"))); return this; } @@ -68,15 +140,34 @@ public void addInstitute(String institute) { this.addTextToOutline("Institute", institute); } - private void addTextToOutline(String outline, String outlineText) { + private void addTextToOutline(String outline, String text) { + this.openSidepanel(); + + // Navigate to the correct input field via Sidepanel WebElement outlineElement = driver - .findElement(By.xpath("//div[@class='outline-h2' and text()='" + outline + "']")); + .findElement(By.xpath("//div[contains(@class,'outline-h2') and text()='" + outline + "']")); outlineElement.click(); WebElement outlineInput = driver.switchTo().activeElement(); outlineInput.sendKeys(Keys.END); outlineInput.sendKeys(Keys.RETURN); WebElement beneathOutlineInput = driver.switchTo().activeElement(); - beneathOutlineInput.sendKeys(outlineText); + + // Write text into the input field + beneathOutlineInput.sendKeys(text); + } + + public MarkdownEditor openSidepanel() { + // Open Sidepanel if not open + boolean sidepanelClosed = driver.findElements(By.className("side-panel")).isEmpty(); + if (sidepanelClosed) { + WebElement showSidepanelButton = driver.findElement(By.id("showSidepanel")); + showSidepanelButton.click(); + + wait.until(ExpectedConditions.visibilityOfElementLocated(By.className("side-panel"))); + } + // else: Sidepanel already open + + return this; } } diff --git a/src/main/java/ui/pages/MarkdownViewer.java b/src/main/java/ui/pages/MarkdownViewer.java deleted file mode 100644 index b754188..0000000 --- a/src/main/java/ui/pages/MarkdownViewer.java +++ /dev/null @@ -1,108 +0,0 @@ -package ui.pages; - -import static io.cucumber.spring.CucumberTestContext.SCOPE_CUCUMBER_GLUE; - -import java.util.ArrayList; -import java.util.List; - -import org.openqa.selenium.By; -import org.openqa.selenium.WebDriver; -import org.openqa.selenium.WebElement; -import org.openqa.selenium.support.FindBy; -import org.openqa.selenium.support.ui.ExpectedConditions; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Lazy; -import org.springframework.context.annotation.Scope; -import org.springframework.stereotype.Component; - -/** - * Page Object encapsulates the Markdown viewer page. - * - * @author helk - * - */ -@Lazy -@Component -@Scope(SCOPE_CUCUMBER_GLUE) -public class MarkdownViewer extends BasePage { - - @FindBy(className = "file-name") - private WebElement fileName; - - @FindBy(className = "file-modifier-name") - private WebElement modifierName; - - @FindBy(className = "file-modifier-time") - private WebElement modifierTime; - - @FindBy(id = "shareBtn") - private WebElement shareButton; - - @FindBy(id = "parentDirectory") - private WebElement parentDirectroyButton; - - @FindBy(id = "editButton") - private WebElement editButton; - - @FindBy(className = "seafile-viewer-outline") - private WebElement outline; - - @Lazy - @Autowired - MarkdownEditor markdownEditor; - - @Autowired - public MarkdownViewer(WebDriver driver) { - super(driver); - } - - public String getFileName() { - return fileName.getText(); - } - - public String getModifierName() { - return modifierName.getText(); - } - - public String getModifierTime() { - return modifierTime.getText(); - } - - public boolean buttonsPresent() { - return (shareButton.isDisplayed() && this.parentDirectroyButton.isDisplayed() && this.editButton.isDisplayed()); - } - - public List<String> getOutline() { - List<String> headings = new ArrayList<>(); - - List<WebElement> outlineHeadings = this.outline.findElements(By.tagName("div")); - - for (WebElement heading : outlineHeadings) { - String headingTitle = heading.getText(); - headings.add(headingTitle); - } - - return headings; - } - - public List<String> getOutlineContent() { - List<String> content = new ArrayList<>(); - - List<WebElement> contentElements = driver.findElements(By.xpath("//h2/following-sibling::p")); - - for (WebElement contentElement : contentElements) { - String contentText = contentElement.getText(); - content.add(contentText); - } - - return content; - } - - public MarkdownEditor edit() { - this.editButton.click(); - wait.until(ExpectedConditions.visibilityOfElementLocated(By.className("seafile-editor"))); - - return markdownEditor; - } - -} diff --git a/src/test/java/stepdefinitions/FileSteps.java b/src/test/java/stepdefinitions/FileSteps.java index 0669485..9cbb51a 100644 --- a/src/test/java/stepdefinitions/FileSteps.java +++ b/src/test/java/stepdefinitions/FileSteps.java @@ -14,7 +14,6 @@ import io.cucumber.java.en.When; import ui.pages.FileViewer; import ui.pages.MarkdownEditor; -import ui.pages.MarkdownViewer; /** * Tests steps: Files domain @@ -29,7 +28,7 @@ public class FileSteps { @Lazy @Autowired - MarkdownViewer markdownViewer; + MarkdownEditor markdownEditor; @Lazy @Autowired @@ -37,21 +36,21 @@ public class FileSteps { @Then("Markdown file title {word} present") public void markdownFileTitlePresent(String fileName) { - String fileTitle = markdownViewer.getFileName(); + String fileTitle = markdownEditor.getFileName(); assertThat(fileTitle).isEqualTo(fileName); } @Then("Markdown-Viewer buttons present") public void markdownViewerButtonsPresent() { - boolean buttonsPresent = markdownViewer.buttonsPresent(); + boolean buttonsPresent = markdownEditor.buttonsPresent(); assertThat(buttonsPresent).as("Check presence of the Markdown-Viewer buttons.").isTrue(); } @Then("Archive metadata content consists of:") public void archiveMetadataContentConsistsOf(List<String> archiveMetadataContent) { - List<String> outline = markdownViewer.getOutline(); + List<String> outline = markdownEditor.getOutline(); // TODO: Handle Check for modifierTime and modifierName correctly // String modifierName = markdownViewer.getModifierName(); @@ -65,7 +64,7 @@ public void archiveMetadataContentConsistsOf(List<String> archiveMetadataContent @Then("Archive metadata contains:") public void archiveMetadataContains(DataTable archiveMetadataTable) { - List<String> content = markdownViewer.getOutlineContent(); + List<String> content = markdownEditor.getOutlineContent(); Map<String, String> archiveMetadataMap = archiveMetadataTable.asMap(String.class, String.class); @@ -79,7 +78,6 @@ public void editArchiveMetadata(DataTable archiveMetadataTable) { Map<String, String> archiveMetadataMap = archiveMetadataTable.asMap(String.class, String.class); - MarkdownEditor markdownEditor = markdownViewer.edit(); markdownEditor.editContent(archiveMetadataMap.get("title"), archiveMetadataMap.get("author"), archiveMetadataMap.get("description"), archiveMetadataMap.get("year"), archiveMetadataMap.get("institute")); diff --git a/src/test/resources/features/fillOutArchiveMetadata.feature b/src/test/resources/features/fillOutArchiveMetadata.feature index 77003b4..cb27f05 100644 --- a/src/test/resources/features/fillOutArchiveMetadata.feature +++ b/src/test/resources/features/fillOutArchiveMetadata.feature @@ -3,7 +3,7 @@ Feature: Fill out Archive Metadata @KP-19 @createLibrary - Scenario: Open archive metadata + Scenario: Update archive metadata Given Logged in as User And Create new Library "New UI Test Library 2" #TODO: Remove the explicte step Open new Library diff --git a/src/test/resources/features/lockArchiveMetadata.feature b/src/test/resources/features/lockArchiveMetadata.feature index 1511581..cb7c72f 100644 --- a/src/test/resources/features/lockArchiveMetadata.feature +++ b/src/test/resources/features/lockArchiveMetadata.feature @@ -55,5 +55,13 @@ Feature: Lock Archive Metadata | year | 2020 | | institute | Institute-Name; Department-Name; Director, Director-Lastname | + #Scenario: Owner can edit unlocked archive metadata +# 1. Given Authenticate as user +# 2. And Create library "" +# 3. And Lock file "" in library "" +# 4. When Unlock file "" in library "" +# 5. And Update file "" in library "" || +# 6. Then File "" updated in library "" || + #TODO: Further test case: other user (with edit rights) can not edit file while locked \ No newline at end of file diff --git a/src/test/resources/features/openFooterLinks.feature b/src/test/resources/features/openFooterLinks.feature index ee18edc..f8a905c 100644 --- a/src/test/resources/features/openFooterLinks.feature +++ b/src/test/resources/features/openFooterLinks.feature @@ -38,7 +38,7 @@ Feature: Open footer links @KP-13 Scenario: Check Seafile link Given Logged in as User - Then Seafile link is https://www.seafile.com/en/home/ + Then Seafile link is https://seafile.com/en/home/ @KP-7 Scenario: Check MPDL link