KEYCLOAK-8836 Add test to check product name on welcome page
Modify import KEYCLOAK-8836 Add test to check product name on welcome page
This commit is contained in:
parent
33314ae3ca
commit
2945eb63b7
2 changed files with 19 additions and 1 deletions
|
@ -21,6 +21,7 @@ import org.openqa.selenium.By;
|
||||||
import org.openqa.selenium.WebElement;
|
import org.openqa.selenium.WebElement;
|
||||||
import org.openqa.selenium.support.FindBy;
|
import org.openqa.selenium.support.FindBy;
|
||||||
|
|
||||||
|
import static org.keycloak.testsuite.util.UIUtils.getTextFromElement;
|
||||||
import static org.keycloak.testsuite.util.UIUtils.setTextInputValue;
|
import static org.keycloak.testsuite.util.UIUtils.setTextInputValue;
|
||||||
import static org.keycloak.testsuite.util.UIUtils.clickLink;
|
import static org.keycloak.testsuite.util.UIUtils.clickLink;
|
||||||
|
|
||||||
|
@ -41,6 +42,9 @@ public class WelcomePage extends AuthServer {
|
||||||
@FindBy(id = "create-button")
|
@FindBy(id = "create-button")
|
||||||
private WebElement createButton;
|
private WebElement createButton;
|
||||||
|
|
||||||
|
@FindBy(css = ".welcome-header h1")
|
||||||
|
private WebElement welcomeMessage;
|
||||||
|
|
||||||
public boolean isPasswordSet() {
|
public boolean isPasswordSet() {
|
||||||
return !(driver.getPageSource().contains("Please create an initial admin user to get started.") ||
|
return !(driver.getPageSource().contains("Please create an initial admin user to get started.") ||
|
||||||
driver.getPageSource().contains("You need local access to create the initial admin user."));
|
driver.getPageSource().contains("You need local access to create the initial admin user."));
|
||||||
|
@ -61,5 +65,9 @@ public class WelcomePage extends AuthServer {
|
||||||
public void navigateToAdminConsole() {
|
public void navigateToAdminConsole() {
|
||||||
clickLink(driver.findElement(By.linkText("Administration Console")));
|
clickLink(driver.findElement(By.linkText("Administration Console")));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getWelcomeMessage() {
|
||||||
|
return getTextFromElement(welcomeMessage);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -161,4 +161,14 @@ public class WelcomePageTest extends AbstractKeycloakTest {
|
||||||
driver.getPageSource().contains("Invalid username or password."));
|
driver.getPageSource().contains("Invalid username or password."));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void test_6_CheckProductNameOnWelcomePage() {
|
||||||
|
welcomePage.navigateTo();
|
||||||
|
|
||||||
|
String actualMessage = welcomePage.getWelcomeMessage();
|
||||||
|
String expectedMessage = suiteContext.getAuthServerInfo().isEAP() ? "Red Hat Single Sign-On" : "Keycloak";
|
||||||
|
|
||||||
|
Assert.assertEquals("Welcome to " + expectedMessage, actualMessage);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue