Addded new test for FreDL content after login

This commit is contained in:
Dirk Jahnke 2019-07-25 10:17:58 +02:00
parent f205184052
commit f603c5dc21
1 changed files with 20 additions and 3 deletions

View File

@ -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() {