From f603c5dc21c8f02cb7b119bf1a2aaa6e17d2d564 Mon Sep 17 00:00:00 2001 From: Dirk Jahnke Date: Thu, 25 Jul 2019 10:17:58 +0200 Subject: [PATCH] Addded new test for FreDL content after login --- src/test/java/BasicTest.java | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/src/test/java/BasicTest.java b/src/test/java/BasicTest.java index a1004d0..0dc0ced 100644 --- a/src/test/java/BasicTest.java +++ b/src/test/java/BasicTest.java @@ -1,9 +1,8 @@ package org.fremo.fredl.test; -//import org.openqa.selenium.By; +import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; -//import org.openqa.selenium.WebElement; -//import org.openqa.selenium.firefox.FirefoxDriver; +import org.openqa.selenium.WebElement; import org.openqa.selenium.htmlunit.HtmlUnitDriver; //import org.openqa.selenium.support.ui.ExpectedCondition; //import org.openqa.selenium.support.ui.WebDriverWait; @@ -28,6 +27,24 @@ public class BasicTest { String getTitle = driver.getTitle(); Assert.assertEquals(getTitle, "FREDL"); } + + @Test + public void verifyLoginAsSystemUser() { + driver.navigate().to(URL); + WebElement element = + driver.findElement(By.name("name")).sendKeys("system"); + driver.findElement(By.name("password")).sendKeys("system"); + driver.submit(); + driver.switchTo().frame("oben"); + String versionInfo = driver.findElement(By.xpath("/table/tr/td/b")).getText(); + String userInfo = driver.findElement(By.xpath("/table/tr/td[3]")).getText(); + System.out.println("Version info found: " + versionInfo); + System.out.println("User info found: " + userInfo); + driver.switchTo().frame("rechts"); + String welcomeMessage = driver.findElement(By.xpath("/h1")).getText(); + System.out.println("Welcome message is: " + welcomeMessage); + Assert.assertEquals(welcomeMessage, "Willkommen bei FreDL"); + } @AfterClass public void tearDown() {