diff --git a/src/main/java/ui/pages/LibraryPage.java b/src/main/java/ui/pages/LibraryPage.java index 660bcbb..60f81ec 100644 --- a/src/main/java/ui/pages/LibraryPage.java +++ b/src/main/java/ui/pages/LibraryPage.java @@ -81,9 +81,10 @@ public void unlockElement(String elementName) { WebElement elementLink = this.directoryViewDiv.findElement(By.linkText(elementName)); WebElement elementRow = elementLink.findElement(By.xpath(".//ancestor::tr")); - new Actions(driver).moveToElement(elementRow).perform(); + // Selenium sometimes has problems hovering over elements => Use an additional click + new Actions(driver).moveToElement(elementRow).click().perform(); WebElement moreOptions = elementRow.findElement(By.xpath(".//*[@title='More Operations']")); - // Selenium has problems hover/scroll element when clicking => Use JS to click + // Selenium sometimes has problems hover/scroll element when clicking => Use JS to click ((JavascriptExecutor) driver).executeScript("arguments[0].click();", moreOptions); WebElement unlockFile = elementRow.findElement(By.xpath(".//button[text()='Unlock']")); unlockFile.click(); diff --git a/src/main/java/ui/pages/MarkdownEditor.java b/src/main/java/ui/pages/MarkdownEditor.java index 1e3b393..207cb84 100644 --- a/src/main/java/ui/pages/MarkdownEditor.java +++ b/src/main/java/ui/pages/MarkdownEditor.java @@ -148,7 +148,10 @@ private void addTextToOutline(String outline, String text) { .findElement(By.xpath("//div[contains(@class,'outline-h2') and text()='" + outline + "']")); outlineElement.click(); WebElement outlineInput = driver.switchTo().activeElement(); - outlineInput.sendKeys(Keys.END); + //Keys.END does not work anymore. Reason unknown. +// outlineInput.sendKeys(Keys.END); + //Workaround: Go to the end of the line with the RIGHT key! + outline.chars().forEach(i -> outlineInput.sendKeys(Keys.RIGHT)); outlineInput.sendKeys(Keys.RETURN); WebElement beneathOutlineInput = driver.switchTo().activeElement();