Merge pull request #1459 from stianst/master

Some fixes to integration-arquillian
This commit is contained in:
Stian Thorgersen 2015-07-16 16:10:37 +02:00
commit 02997b593f
60 changed files with 278 additions and 218 deletions

View file

@ -7,8 +7,10 @@
</ol>
<h1 data-ng-show="create">Add Client</h1>
<h1 data-ng-hide="create">{{client.clientId|capitalize}}<i style="padding-left: 20px" class="pficon pficon-delete" data-ng-show="!create && access.manageClients"
data-ng-hide="changed" data-ng-click="remove()"></i></h1>
<h1 data-ng-hide="create">
{{client.clientId|capitalize}}
<i id="removeClient" style="padding-left: 20px" class="pficon pficon-delete" data-ng-show="!create && access.manageClients" data-ng-hide="changed" data-ng-click="remove()"></i>
</h1>
<kc-tabs-client></kc-tabs-client>

View file

@ -19,8 +19,8 @@
</div>
<div class="pull-right" data-ng-show="access.manageRealm">
<a class="btn btn-default" href="#/create/client/{{realm.realm}}">Create</a>
<a class="btn btn-default" href="#/import/client/{{realm.realm}}" data-ng-show="importButton">Import</a>
<a id="createClient" class="btn btn-default" href="#/create/client/{{realm.realm}}">Create</a>
<a id="importClient" class="btn btn-default" href="#/import/client/{{realm.realm}}" data-ng-show="importButton">Import</a>
</div>
</div>
</th>

View file

@ -6,8 +6,10 @@
<li data-ng-show="create">Add Role</li>
</ol>
<h1 data-ng-hide="create">{{role.name|capitalize}} <i style="padding-left: 20px" class="pficon pficon-delete" data-ng-show="!create && access.manageRealm"
data-ng-hide="changed" data-ng-click="remove()"></i></h1>
<h1 data-ng-hide="create">
{{role.name|capitalize}}
<i id="removeRole" style="padding-left: 20px" class="pficon pficon-delete" data-ng-show="!create && access.manageRealm" data-ng-hide="changed" data-ng-click="remove()"></i>
</h1>
<h1 data-ng-show="create">Add Role</h1>
<form class="form-horizontal clearfix" name="realmForm" novalidate kc-read-only="!access.manageRealm">

View file

@ -21,7 +21,7 @@
</div>
<div class="pull-right" data-ng-show="access.manageRealm">
<a class="btn btn-default" href="#/create/role/{{realm.realm}}">Add Role</a>
<a id="createRole" class="btn btn-default" href="#/create/role/{{realm.realm}}">Add Role</a>
</div>
</div>
</th>

View file

@ -11,7 +11,7 @@
<tr>
<th class="kc-table-actions" colspan="3">
<div class="pull-right">
<a class="btn btn-default" ng-click="logoutAll()">Logout All</a>
<a id="logoutAllSessions" class="btn btn-default" ng-click="logoutAll()">Logout All</a>
</div>
</th>
</tr>

View file

@ -5,8 +5,10 @@
<li data-ng-show="create">Add User</li>
</ol>
<h1 data-ng-hide="create">{{user.username|capitalize}}<i style="padding-left: 20px" class="pficon pficon-delete" data-ng-show="!create && access.manageUsers && !changed"
data-ng-click="remove()"></i></h1>
<h1 data-ng-hide="create">
{{user.username|capitalize}}
<i id="removeUser" style="padding-left: 20px" class="pficon pficon-delete" data-ng-show="!create && access.manageUsers && !changed" data-ng-click="remove()"></i>
</h1>
<h1 data-ng-show="create">Add User</h1>
<kc-tabs-user></kc-tabs-user>

View file

@ -15,10 +15,10 @@
</div>
</div>
</div>
<button class="btn btn-default" ng-click="query.search = null; firstPage()">View all users</button>
<button id="viewAllUsers" class="btn btn-default" ng-click="query.search = null; firstPage()">View all users</button>
<div class="pull-right" data-ng-show="access.manageUsers">
<a class="btn btn-default" href="#/create/user/{{realm.realm}}">Add User</a>
<a id="createUser" class="btn btn-default" href="#/create/user/{{realm.realm}}">Add User</a>
</div>
</div>
</th>

View file

@ -11,9 +11,9 @@
<table class="table table-striped table-bordered">
<thead>
<tr data-ng-show="access.manageUsers">
<th class="kc-table-actions" colspan="6">
<th class="kc-table-actions" colspan="6">
<div class="pull-right" data-ng-show="access.manageUsers">
<a class="btn btn-default" ng-click="logoutAll()">Logout All Sessions</a>
<a id="logoutAllSessions" class="btn btn-default" ng-click="logoutAll()">Logout All Sessions</a>
</div>
</th>
</tr>

View file

@ -9,8 +9,8 @@
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>arquillian-integration</artifactId>
<name>KeyCloak Admin UI TestSuite</name>
<artifactId>keycloak-testsuite-integration-arquillian</artifactId>
<name>KeyCloak Arquillian TestSuite</name>
<properties>
<browser>phantomjs</browser>
@ -87,6 +87,16 @@
<version>${arquillian-phantomjs.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.keycloak</groupId>
<artifactId>keycloak-server-dist</artifactId>
<scope>test</scope>
<type>zip</type>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</dependency>
</dependencies>
<profiles>
@ -151,7 +161,6 @@
<artifactItem>
<groupId>org.keycloak</groupId>
<artifactId>keycloak-server-dist</artifactId>
<version>${project.version}</version>
<type>zip</type>
<overWrite>false</overWrite>
</artifactItem>

View file

@ -16,28 +16,28 @@
* limitations under the License.
*/
package org.keycloak.testsuite.ui.test.account;
package org.keycloak.testsuite.account;
import org.jboss.arquillian.graphene.findby.FindByJQuery;
import org.jboss.arquillian.graphene.page.Page;
import org.junit.After;
import org.junit.Test;
import static org.keycloak.testsuite.ui.util.Constants.ADMIN_PSSWD;
import static org.keycloak.testsuite.admin.util.Constants.ADMIN_PSSWD;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import org.junit.Before;
import org.keycloak.testsuite.ui.AbstractKeyCloakTest;
import org.keycloak.testsuite.ui.fragment.FlashMessage;
import org.keycloak.testsuite.ui.model.Account;
import org.keycloak.testsuite.ui.page.account.AccountPage;
import org.keycloak.testsuite.ui.page.account.PasswordPage;
import org.keycloak.testsuite.admin.AbstractKeycloakTest;
import org.keycloak.testsuite.admin.fragment.FlashMessage;
import org.keycloak.testsuite.admin.model.Account;
import org.keycloak.testsuite.admin.page.account.AccountPage;
import org.keycloak.testsuite.admin.page.account.PasswordPage;
/**
*
* @author Petr Mensik
*/
public class AccountManagementTest extends AbstractKeyCloakTest<AccountPage> {
public class AccountManagementTest extends AbstractKeycloakTest<AccountPage> {
@FindByJQuery(".alert")
private FlashMessage flashMessage;

View file

@ -16,20 +16,20 @@
* limitations under the License.
*/
package org.keycloak.testsuite.ui;
package org.keycloak.testsuite.admin;
import java.util.concurrent.TimeUnit;
import org.jboss.arquillian.graphene.page.Page;
import org.junit.After;
import org.junit.Before;
import org.keycloak.testsuite.ui.page.AbstractPage;
import org.keycloak.testsuite.admin.page.AbstractPage;
/**
*
* @author Petr Mensik
* @param <P>
*/
public abstract class AbstractKeyCloakTest<P extends AbstractPage> extends AbstractTest {
public abstract class AbstractKeycloakTest<P extends AbstractPage> extends AbstractTest {
@Page
protected P page;

View file

@ -16,19 +16,21 @@
* limitations under the License.
*/
package org.keycloak.testsuite.ui;
package org.keycloak.testsuite.admin;
import org.jboss.arquillian.drone.api.annotation.Drone;
import org.jboss.arquillian.graphene.page.Page;
import org.jboss.arquillian.junit.Arquillian;
import org.junit.runner.RunWith;
import org.keycloak.testsuite.ui.fragment.Navigation;
import org.keycloak.testsuite.ui.fragment.MenuPage;
import org.keycloak.testsuite.ui.page.LoginPage;
import org.keycloak.testsuite.ui.page.account.PasswordPage;
import static org.keycloak.testsuite.ui.util.Constants.ADMIN_PSSWD;
import org.keycloak.testsuite.admin.fragment.Navigation;
import org.keycloak.testsuite.admin.fragment.MenuPage;
import org.keycloak.testsuite.admin.page.LoginPage;
import org.keycloak.testsuite.admin.page.account.PasswordPage;
import static org.keycloak.testsuite.admin.util.Constants.ADMIN_PSSWD;
import static org.keycloak.testsuite.admin.util.URL.ACCOUNT_URL;
import static org.keycloak.testsuite.admin.util.URL.ADMIN_URL;
import static org.keycloak.testsuite.ui.util.URL.BASE_URL;
import org.openqa.selenium.WebDriver;
/**
@ -38,8 +40,11 @@ import org.openqa.selenium.WebDriver;
@RunWith(Arquillian.class)
public abstract class AbstractTest {
private static boolean firstAdminLogin = Boolean.parseBoolean(
System.getProperty("firstAdminLogin", "true"));
private static Boolean firstAdminLogin;
static {
String s = System.getProperty("firstAdminLogin");
firstAdminLogin = s != null ? Boolean.parseBoolean(s) : null;
}
@Page
protected LoginPage loginPage;
@ -61,8 +66,13 @@ public abstract class AbstractTest {
}
public void loginAsAdmin() {
driver.get(BASE_URL);
openAdmin();
loginPage.loginAsAdmin();
if (firstAdminLogin == null) {
firstAdminLogin = driver.getTitle().contains("Update password");
}
if (firstAdminLogin) {
passwordPage.confirmNewPassword(ADMIN_PSSWD);
passwordPage.submit();
@ -70,4 +80,12 @@ public abstract class AbstractTest {
}
}
public void openAdmin() {
driver.get(ADMIN_URL);
}
public void openAccount() {
driver.get(ACCOUNT_URL);
}
}

View file

@ -16,7 +16,7 @@
* limitations under the License.
*/
package org.keycloak.testsuite.ui.fragment;
package org.keycloak.testsuite.admin.fragment;
import org.jboss.arquillian.drone.api.annotation.Drone;
import static org.openqa.selenium.By.id;

View file

@ -16,12 +16,12 @@
* limitations under the License.
*/
package org.keycloak.testsuite.ui.fragment;
package org.keycloak.testsuite.admin.fragment;
import static org.jboss.arquillian.graphene.Graphene.waitGui;
import org.jboss.arquillian.graphene.fragment.Root;
import static org.keycloak.testsuite.ui.util.SeleniumUtils.waitGuiForElement;
import static org.keycloak.testsuite.admin.util.SeleniumUtils.waitGuiForElement;
import org.openqa.selenium.WebElement;
/**

View file

@ -16,10 +16,10 @@
* limitations under the License.
*/
package org.keycloak.testsuite.ui.fragment;
package org.keycloak.testsuite.admin.fragment;
import java.util.List;
import static org.keycloak.testsuite.ui.util.SeleniumUtils.waitGuiForElement;
import static org.keycloak.testsuite.admin.util.SeleniumUtils.waitGuiForElement;
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;

View file

@ -15,11 +15,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.keycloak.testsuite.ui.fragment;
package org.keycloak.testsuite.admin.fragment;
import org.jboss.arquillian.drone.api.annotation.Drone;
import static org.jboss.arquillian.graphene.Graphene.waitModel;
import static org.keycloak.testsuite.ui.util.SeleniumUtils.waitGuiForElement;
import static org.keycloak.testsuite.admin.util.SeleniumUtils.waitGuiForElement;
import org.jboss.arquillian.graphene.findby.FindByJQuery;
import org.openqa.selenium.support.FindBy;
@ -75,8 +75,11 @@ public class Navigation {
@FindByJQuery("a:contains('Add Realm')")
private WebElement addRealm;
@FindByJQuery("a:contains('Credentials')")
private WebElement credentials;
@FindByJQuery("a:contains('Authentication')")
private WebElement authentication;
@FindByJQuery("a:contains('Password Policy')")
private WebElement passwordPolicy;
@FindByJQuery("a:contains('Attributes')")
private WebElement attributes;
@ -142,8 +145,9 @@ public class Navigation {
openPage(addRealm, "Add Realm");
}
public void credentials() {
openPage(credentials, "Settings");
public void passwordPolicy() {
openPage(authentication, "Authentication");
openPage(passwordPolicy, "Authentication");
}
public void attributes() {

View file

@ -16,7 +16,7 @@
* limitations under the License.
*/
package org.keycloak.testsuite.ui.fragment;
package org.keycloak.testsuite.admin.fragment;
import org.jboss.arquillian.graphene.fragment.Root;
import org.jboss.arquillian.test.api.ArquillianResource;

View file

@ -16,7 +16,7 @@
* limitations under the License.
*/
package org.keycloak.testsuite.ui.fragment;
package org.keycloak.testsuite.admin.fragment;
import org.jboss.arquillian.graphene.fragment.Root;
import org.openqa.selenium.By;

View file

@ -16,7 +16,7 @@
* limitations under the License.
*/
package org.keycloak.testsuite.ui.model;
package org.keycloak.testsuite.admin.model;
/**
*

View file

@ -16,7 +16,7 @@
* limitations under the License.
*/
package org.keycloak.testsuite.ui.model;
package org.keycloak.testsuite.admin.model;
/**
*

View file

@ -16,7 +16,7 @@
* limitations under the License.
*/
package org.keycloak.testsuite.ui.model;
package org.keycloak.testsuite.admin.model;
/**
*

View file

@ -16,7 +16,7 @@
* limitations under the License.
*/
package org.keycloak.testsuite.ui.model;
package org.keycloak.testsuite.admin.model;
/**
*

View file

@ -16,7 +16,7 @@
* limitations under the License.
*/
package org.keycloak.testsuite.ui.model;
package org.keycloak.testsuite.admin.model;
/**
*

View file

@ -16,7 +16,7 @@
* limitations under the License.
*/
package org.keycloak.testsuite.ui.model;
package org.keycloak.testsuite.admin.model;
/**
*

View file

@ -16,7 +16,7 @@
* limitations under the License.
*/
package org.keycloak.testsuite.ui.model;
package org.keycloak.testsuite.admin.model;
/**
*

View file

@ -16,7 +16,7 @@
* limitations under the License.
*/
package org.keycloak.testsuite.ui.model;
package org.keycloak.testsuite.admin.model;
/**
*

View file

@ -16,7 +16,7 @@
* limitations under the License.
*/
package org.keycloak.testsuite.ui.model;
package org.keycloak.testsuite.admin.model;
/**
*

View file

@ -15,11 +15,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.keycloak.testsuite.ui.page;
package org.keycloak.testsuite.admin.page;
import java.util.List;
import org.jboss.arquillian.drone.api.annotation.Drone;
import org.keycloak.testsuite.ui.util.Constants;
import org.keycloak.testsuite.admin.util.Constants;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
@ -36,14 +35,9 @@ public class AbstractPage {
@FindBy(css = ".btn-danger")
protected WebElement dangerButton;
//@FindByJQuery(".btn-primary:visible")
@FindBy(css = ".btn-primary")
protected WebElement primaryButton;
@FindBy(css = ".btn-primary")
protected List<WebElement> primaryButtons;
@FindBy(css = ".ng-binding.btn.btn-danger")
protected WebElement deleteConfirmationButton;

View file

@ -16,10 +16,10 @@
* limitations under the License.
*/
package org.keycloak.testsuite.ui.page;
package org.keycloak.testsuite.admin.page;
import static org.keycloak.testsuite.ui.util.Constants.ADMIN_PSSWD;
import static org.keycloak.testsuite.ui.util.SeleniumUtils.waitGuiForElement;
import static org.keycloak.testsuite.admin.util.Constants.ADMIN_PSSWD;
import static org.keycloak.testsuite.admin.util.SeleniumUtils.waitGuiForElement;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;

View file

@ -16,15 +16,15 @@
* limitations under the License.
*/
package org.keycloak.testsuite.ui.page;
package org.keycloak.testsuite.admin.page;
import org.keycloak.testsuite.ui.model.User;
import org.keycloak.testsuite.admin.model.User;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import java.util.concurrent.TimeUnit;
import static org.keycloak.testsuite.ui.util.SeleniumUtils.waitGuiForElement;
import static org.keycloak.testsuite.admin.util.SeleniumUtils.waitGuiForElement;
/**
*

View file

@ -16,11 +16,11 @@
* limitations under the License.
*/
package org.keycloak.testsuite.ui.page.account;
package org.keycloak.testsuite.admin.page.account;
import org.jboss.arquillian.graphene.findby.FindByJQuery;
import org.keycloak.testsuite.ui.model.Account;
import org.keycloak.testsuite.ui.page.AbstractPage;
import org.keycloak.testsuite.admin.model.Account;
import org.keycloak.testsuite.admin.page.AbstractPage;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;

View file

@ -16,7 +16,7 @@
* limitations under the License.
*/
package org.keycloak.testsuite.ui.page.account;
package org.keycloak.testsuite.admin.page.account;
import org.jboss.arquillian.graphene.findby.FindByJQuery;
import org.openqa.selenium.WebElement;

View file

@ -16,9 +16,11 @@
* limitations under the License.
*/
package org.keycloak.testsuite.ui.page.session;
package org.keycloak.testsuite.admin.page.session;
import org.keycloak.testsuite.ui.page.AbstractPage;
import org.keycloak.testsuite.admin.page.AbstractPage;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
/**
*
@ -26,7 +28,10 @@ import org.keycloak.testsuite.ui.page.AbstractPage;
*/
public class SessionsPage extends AbstractPage {
@FindBy(id = "logoutAllSessions")
private WebElement logoutAllSessions;
public void logoutAllSessions() {
primaryButton.click();
logoutAllSessions.click();
}
}

View file

@ -16,19 +16,18 @@
* limitations under the License.
*/
package org.keycloak.testsuite.ui.page.settings;
package org.keycloak.testsuite.admin.page.settings;
import org.keycloak.testsuite.ui.model.Client;
import org.keycloak.testsuite.ui.page.AbstractPage;
import org.keycloak.testsuite.admin.model.Client;
import org.keycloak.testsuite.admin.page.AbstractPage;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import java.util.ArrayList;
import java.util.List;
import org.jboss.arquillian.graphene.findby.ByJQuery;
import static org.junit.Assert.assertEquals;
import static org.keycloak.testsuite.ui.util.SeleniumUtils.waitAjaxForElement;
import static org.keycloak.testsuite.admin.util.SeleniumUtils.waitAjaxForElement;
import static org.openqa.selenium.By.cssSelector;
import static org.openqa.selenium.By.linkText;
import static org.openqa.selenium.By.tagName;
@ -60,6 +59,12 @@ public class ClientPage extends AbstractPage {
@FindBy(css = "input[class*='search']")
private WebElement searchInput;
@FindBy(id = "createClient")
private WebElement createButton;
@FindBy(id = "removeClient")
protected WebElement removeButton;
public void addClient(Client client) {
primaryButton.click();
waitAjaxForElement(clientId);
@ -87,8 +92,8 @@ public class ClientPage extends AbstractPage {
public void deleteClient(String clientName) {
searchInput.sendKeys(clientName);
driver.findElement(linkText(clientName)).click();
waitAjaxForElement(dangerButton);
dangerButton.click();
waitAjaxForElement(removeButton);
removeButton.click();
waitAjaxForElement(deleteConfirmationButton);
deleteConfirmationButton.click();
}
@ -124,6 +129,6 @@ public class ClientPage extends AbstractPage {
}
public void goToCreateClient() {
driver.findElements(ByJQuery.selector(".btn.btn-primary")).get(0).click();
createButton.click();
}
}

View file

@ -16,13 +16,13 @@
* limitations under the License.
*/
package org.keycloak.testsuite.ui.page.settings;
package org.keycloak.testsuite.admin.page.settings;
import java.util.ArrayList;
import java.util.List;
import org.keycloak.testsuite.ui.fragment.PickList;
import org.keycloak.testsuite.ui.page.AbstractPage;
import org.keycloak.testsuite.ui.model.Role;
import org.keycloak.testsuite.admin.fragment.PickList;
import org.keycloak.testsuite.admin.page.AbstractPage;
import org.keycloak.testsuite.admin.model.Role;
import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.support.ui.Select;

View file

@ -16,10 +16,10 @@
* limitations under the License.
*/
package org.keycloak.testsuite.ui.page.settings;
package org.keycloak.testsuite.admin.page.settings;
import org.keycloak.testsuite.ui.page.AbstractPage;
import org.keycloak.testsuite.ui.model.Theme;
import org.keycloak.testsuite.admin.page.AbstractPage;
import org.keycloak.testsuite.admin.model.Theme;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.support.ui.Select;

View file

@ -16,11 +16,11 @@
* limitations under the License.
*/
package org.keycloak.testsuite.ui.page.settings;
package org.keycloak.testsuite.admin.page.settings;
import org.jboss.arquillian.graphene.findby.FindByJQuery;
import org.keycloak.testsuite.ui.fragment.OnOffSwitch;
import org.keycloak.testsuite.ui.page.AbstractPage;
import org.keycloak.testsuite.admin.fragment.OnOffSwitch;
import org.keycloak.testsuite.admin.page.AbstractPage;
/**
*

View file

@ -16,12 +16,12 @@
* limitations under the License.
*/
package org.keycloak.testsuite.ui.page.settings;
package org.keycloak.testsuite.admin.page.settings;
import java.util.List;
import org.jboss.arquillian.graphene.findby.ByJQuery;
import org.keycloak.testsuite.ui.model.PasswordPolicy;
import org.keycloak.testsuite.ui.page.AbstractPage;
import org.keycloak.testsuite.admin.model.PasswordPolicy;
import org.keycloak.testsuite.admin.page.AbstractPage;
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
@ -30,7 +30,7 @@ import org.openqa.selenium.support.ui.Select;
*
* @author Petr Mensik
*/
public class CredentialsPage extends AbstractPage {
public class PasswordPolicyPage extends AbstractPage {
@FindBy(tagName = "select")
private Select addPolicySelect;

View file

@ -16,19 +16,19 @@
* limitations under the License.
*/
package org.keycloak.testsuite.ui.page.settings;
package org.keycloak.testsuite.admin.page.settings;
import java.util.ArrayList;
import java.util.List;
import static org.junit.Assert.assertEquals;
import org.keycloak.testsuite.ui.page.AbstractPage;
import org.keycloak.testsuite.ui.model.Role;
import org.keycloak.testsuite.admin.page.AbstractPage;
import org.keycloak.testsuite.admin.model.Role;
import static org.openqa.selenium.By.cssSelector;
import static org.openqa.selenium.By.linkText;
import static org.openqa.selenium.By.tagName;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import static org.keycloak.testsuite.ui.util.SeleniumUtils.*;
import static org.keycloak.testsuite.admin.util.SeleniumUtils.*;
/**
*
* @author Petr Mensik
@ -49,14 +49,20 @@ public class RolesPage extends AbstractPage {
@FindBy(id = "compositeSwitch")
private WebElement compositeSwitchToggle;
@FindBy(id = "createRole")
private WebElement createButton;
@FindBy(id = "removeRole")
protected WebElement removeButton;
public boolean isRoleComposite(String roleName) {
return findRole(roleName).isComposite();
}
public void addRole(Role role) {
primaryButton.click();
createButton.click();
waitAjaxForElement(nameInput);
nameInput.sendKeys(role.getName());
if (role.isComposite()) {
@ -86,8 +92,8 @@ public class RolesPage extends AbstractPage {
public void deleteRole(Role role) {
driver.findElement(linkText(role.getName())).click();
waitAjaxForElement(dangerButton);
dangerButton.click();
waitAjaxForElement(removeButton);
removeButton.click();
deleteConfirmationButton.click();
}

View file

@ -16,12 +16,12 @@
* limitations under the License.
*/
package org.keycloak.testsuite.ui.page.settings;
package org.keycloak.testsuite.admin.page.settings;
import org.jboss.arquillian.graphene.findby.FindByJQuery;
import org.keycloak.testsuite.ui.fragment.OnOffSwitch;
import org.keycloak.testsuite.ui.page.AbstractPage;
import org.keycloak.testsuite.ui.util.SeleniumUtils;
import org.keycloak.testsuite.admin.fragment.OnOffSwitch;
import org.keycloak.testsuite.admin.page.AbstractPage;
import org.keycloak.testsuite.admin.util.SeleniumUtils;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.support.ui.Select;

View file

@ -16,15 +16,15 @@
* limitations under the License.
*/
package org.keycloak.testsuite.ui.page.settings;
package org.keycloak.testsuite.admin.page.settings;
import java.util.ArrayList;
import java.util.List;
import org.jboss.arquillian.graphene.findby.FindByJQuery;
import static org.junit.Assert.assertNotNull;
import org.keycloak.testsuite.ui.model.Provider;
import org.keycloak.testsuite.ui.model.SocialProvider;
import org.keycloak.testsuite.ui.page.AbstractPage;
import org.keycloak.testsuite.admin.model.Provider;
import org.keycloak.testsuite.admin.model.SocialProvider;
import org.keycloak.testsuite.admin.page.AbstractPage;
import static org.openqa.selenium.By.tagName;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;

View file

@ -16,15 +16,15 @@
* limitations under the License.
*/
package org.keycloak.testsuite.ui.page.settings;
package org.keycloak.testsuite.admin.page.settings;
import org.keycloak.testsuite.ui.page.AbstractPage;
import org.keycloak.testsuite.admin.page.AbstractPage;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.support.ui.Select;
import static org.keycloak.testsuite.ui.util.SeleniumUtils.waitGuiForElement;
import static org.keycloak.testsuite.ui.util.SeleniumUtils.waitGuiForElementNotPresent;
import static org.keycloak.testsuite.admin.util.SeleniumUtils.waitGuiForElement;
import static org.keycloak.testsuite.admin.util.SeleniumUtils.waitGuiForElementNotPresent;
import org.openqa.selenium.By;
/**

View file

@ -16,16 +16,16 @@
* limitations under the License.
*/
package org.keycloak.testsuite.ui.page.settings;
package org.keycloak.testsuite.admin.page.settings;
import java.util.concurrent.TimeUnit;
import org.keycloak.testsuite.ui.page.AbstractPage;
import org.keycloak.testsuite.admin.page.AbstractPage;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.support.ui.Select;
import static java.lang.String.valueOf;
import static org.keycloak.testsuite.ui.util.SeleniumUtils.waitGuiForElement;
import static org.keycloak.testsuite.admin.util.SeleniumUtils.waitGuiForElement;
import static org.apache.commons.lang3.text.WordUtils.capitalize;
/**

View file

@ -1,12 +1,12 @@
package org.keycloak.testsuite.ui.page.settings.user;
package org.keycloak.testsuite.admin.page.settings.user;
import org.keycloak.testsuite.ui.page.AbstractPage;
import org.keycloak.testsuite.admin.page.AbstractPage;
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.support.ui.Select;
import static org.keycloak.testsuite.ui.util.SeleniumUtils.waitGuiForElement;
import static org.keycloak.testsuite.admin.util.SeleniumUtils.waitGuiForElement;
/**
* Created by fkiss.

View file

@ -16,11 +16,11 @@
* limitations under the License.
*/
package org.keycloak.testsuite.ui.page.settings.user;
package org.keycloak.testsuite.admin.page.settings.user;
import org.jboss.arquillian.graphene.findby.FindByJQuery;
import org.keycloak.testsuite.ui.model.User;
import org.keycloak.testsuite.ui.page.AbstractPage;
import org.keycloak.testsuite.admin.model.User;
import org.keycloak.testsuite.admin.page.AbstractPage;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
@ -28,8 +28,8 @@ import java.util.ArrayList;
import java.util.List;
import static org.junit.Assert.assertEquals;
import org.keycloak.testsuite.ui.model.UserAction;
import static org.keycloak.testsuite.ui.util.SeleniumUtils.waitAjaxForElement;
import org.keycloak.testsuite.admin.model.UserAction;
import static org.keycloak.testsuite.admin.util.SeleniumUtils.waitAjaxForElement;
import static org.openqa.selenium.By.*;
import org.openqa.selenium.support.ui.Select;
@ -69,6 +69,15 @@ public class UserPage extends AbstractPage {
@FindBy(id = "confirmPassword")
private WebElement confirmPassword;
@FindBy(id = "viewAllUsers")
private WebElement viewAllUsers;
@FindBy(id = "createUser")
private WebElement createUser;
@FindBy(id = "removeUser")
private WebElement removeUser;
@FindBy(css = "input[class*='search']")
private WebElement searchInput;
@ -82,7 +91,7 @@ public class UserPage extends AbstractPage {
private WebElement searchButton;
public void addUser(User user) {
primaryButtons.get(1).click();
createUser.click();
waitAjaxForElement(usernameInput);
usernameInput.sendKeys(user.getUserName());
emailInput.sendKeys(user.getEmail());
@ -139,8 +148,8 @@ public class UserPage extends AbstractPage {
searchInput.sendKeys(username);
searchButton.click();
driver.findElement(linkText(username)).click();
waitAjaxForElement(dangerButton);
dangerButton.click();
waitAjaxForElement(removeUser);
removeUser.click();
waitAjaxForElement(deleteConfirmationButton);
deleteConfirmationButton.click();
}
@ -150,7 +159,7 @@ public class UserPage extends AbstractPage {
}
public void showAllUsers() {
primaryButtons.get(0).click();
viewAllUsers.click();
}
public void goToUser(User user) {

View file

@ -16,25 +16,25 @@
* limitations under the License.
*/
package org.keycloak.testsuite.ui.test.client;
package org.keycloak.testsuite.admin.test.client;
import org.jboss.arquillian.graphene.findby.FindByJQuery;
import org.junit.Test;
import org.keycloak.testsuite.ui.fragment.FlashMessage;
import org.keycloak.testsuite.ui.model.Client;
import org.keycloak.testsuite.ui.page.settings.ClientPage;
import org.keycloak.testsuite.admin.fragment.FlashMessage;
import org.keycloak.testsuite.admin.model.Client;
import org.keycloak.testsuite.admin.page.settings.ClientPage;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import org.junit.Before;
import org.keycloak.testsuite.ui.AbstractKeyCloakTest;
import org.keycloak.testsuite.admin.AbstractKeycloakTest;
/**
*
* @author Filip Kiss
*/
public class AddNewClientTest extends AbstractKeyCloakTest<ClientPage> {
public class AddNewClientTest extends AbstractKeycloakTest<ClientPage> {
@FindByJQuery(".alert")
private FlashMessage flashMessage;

View file

@ -3,20 +3,20 @@
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package org.keycloak.testsuite.ui.test.role;
package org.keycloak.testsuite.admin.test.role;
import org.jboss.arquillian.graphene.findby.FindByJQuery;
import org.jboss.arquillian.graphene.page.Page;
import org.junit.Test;
import org.keycloak.testsuite.ui.page.settings.RolesPage;
import org.keycloak.testsuite.ui.model.Role;
import org.keycloak.testsuite.admin.page.settings.RolesPage;
import org.keycloak.testsuite.admin.model.Role;
import static org.junit.Assert.*;
import org.junit.Before;
import org.junit.Ignore;
import org.keycloak.testsuite.ui.AbstractKeyCloakTest;
import org.keycloak.testsuite.ui.fragment.FlashMessage;
import org.keycloak.testsuite.ui.page.settings.user.UserPage;
import org.keycloak.testsuite.admin.AbstractKeycloakTest;
import org.keycloak.testsuite.admin.fragment.FlashMessage;
import org.keycloak.testsuite.admin.page.settings.user.UserPage;
import static org.openqa.selenium.By.id;
import org.openqa.selenium.support.ui.Select;
@ -24,7 +24,7 @@ import org.openqa.selenium.support.ui.Select;
*
* @author Petr Mensik
*/
public class AddNewRoleTest extends AbstractKeyCloakTest<RolesPage> {
public class AddNewRoleTest extends AbstractKeycloakTest<RolesPage> {
@Page
private UserPage userPage;

View file

@ -16,19 +16,19 @@
* limitations under the License.
*/
package org.keycloak.testsuite.ui.test.session;
package org.keycloak.testsuite.admin.test.session;
import org.junit.Before;
import org.junit.Test;
import org.keycloak.testsuite.ui.AbstractKeyCloakTest;
import org.keycloak.testsuite.ui.page.session.SessionsPage;
import static org.keycloak.testsuite.ui.util.SeleniumUtils.waitGuiForElement;
import org.keycloak.testsuite.admin.AbstractKeycloakTest;
import org.keycloak.testsuite.admin.page.session.SessionsPage;
import static org.keycloak.testsuite.admin.util.SeleniumUtils.waitGuiForElement;
/**
*
* @author Petr Mensik
*/
public class SessionsTest extends AbstractKeyCloakTest<SessionsPage> {
public class SessionsTest extends AbstractKeycloakTest<SessionsPage> {
@Before
public void beforeSessionTest() {

View file

@ -16,23 +16,23 @@
* limitations under the License.
*/
package org.keycloak.testsuite.ui.test.session;
package org.keycloak.testsuite.admin.test.session;
import java.util.concurrent.TimeUnit;
import org.junit.Before;
import org.junit.Test;
import org.keycloak.testsuite.ui.page.settings.TokensPage;
import org.keycloak.testsuite.admin.page.settings.TokensPage;
import static org.jboss.arquillian.graphene.Graphene.waitModel;
import org.keycloak.testsuite.ui.AbstractKeyCloakTest;
import static org.keycloak.testsuite.ui.util.SeleniumUtils.waitGuiForElement;
import org.keycloak.testsuite.admin.AbstractKeycloakTest;
import static org.keycloak.testsuite.admin.util.SeleniumUtils.waitGuiForElement;
/**
*
* @author Petr Mensik
*/
public class TokensTest extends AbstractKeyCloakTest<TokensPage> {
public class TokensTest extends AbstractKeycloakTest<TokensPage> {
private static final int TIMEOUT = 10;
private static final TimeUnit TIME_UNIT = TimeUnit.SECONDS;

View file

@ -16,23 +16,24 @@
* limitations under the License.
*/
package org.keycloak.testsuite.ui.test.settings;
package org.keycloak.testsuite.admin.test.settings;
import org.junit.Before;
import org.junit.Test;
import org.keycloak.testsuite.ui.AbstractKeyCloakTest;
import org.keycloak.testsuite.ui.model.PasswordPolicy;
import org.keycloak.testsuite.ui.page.settings.CredentialsPage;
import org.keycloak.testsuite.admin.AbstractKeycloakTest;
import org.keycloak.testsuite.admin.model.PasswordPolicy;
import org.keycloak.testsuite.admin.page.settings.PasswordPolicyPage;
/**
*
* @author Petr Mensik
*/
public class CredentialsTest extends AbstractKeyCloakTest<CredentialsPage> {
public class PasswordPolicyTest extends AbstractKeycloakTest<PasswordPolicyPage> {
@Before
public void beforeCredentialsTest() {
navigation.credentials();
navigation.passwordPolicy();
}
@Test

View file

@ -16,17 +16,17 @@
* limitations under the License.
*/
package org.keycloak.testsuite.ui.test.settings;
package org.keycloak.testsuite.admin.test.settings;
import org.junit.Test;
import org.keycloak.testsuite.ui.AbstractKeyCloakTest;
import org.keycloak.testsuite.ui.page.settings.SecurityPage;
import org.keycloak.testsuite.admin.AbstractKeycloakTest;
import org.keycloak.testsuite.admin.page.settings.SecurityPage;
/**
*
* @author Filip Kiss
*/
public class SecuritySettingsTest extends AbstractKeyCloakTest<SecurityPage>{
public class SecuritySettingsTest extends AbstractKeycloakTest<SecurityPage> {
@Test
public void securitySettingsTest() {

View file

@ -16,23 +16,23 @@
* limitations under the License.
*/
package org.keycloak.testsuite.ui.test.settings;
package org.keycloak.testsuite.admin.test.settings;
import org.jboss.arquillian.graphene.findby.FindByJQuery;
import static org.junit.Assert.*;
import org.junit.Test;
import org.keycloak.testsuite.ui.page.settings.SocialSettingsPage;
import org.keycloak.testsuite.ui.AbstractKeyCloakTest;
import org.keycloak.testsuite.ui.fragment.FlashMessage;
import org.keycloak.testsuite.ui.model.Provider;
import org.keycloak.testsuite.ui.model.SocialProvider;
import org.keycloak.testsuite.ui.util.URL;
import org.keycloak.testsuite.admin.page.settings.SocialSettingsPage;
import org.keycloak.testsuite.admin.AbstractKeycloakTest;
import org.keycloak.testsuite.admin.fragment.FlashMessage;
import org.keycloak.testsuite.admin.model.Provider;
import org.keycloak.testsuite.admin.model.SocialProvider;
import org.keycloak.testsuite.admin.util.URL;
/**
*
* @author Petr Mensik
*/
public class SocialSettingsTest extends AbstractKeyCloakTest<SocialSettingsPage> {
public class SocialSettingsTest extends AbstractKeycloakTest<SocialSettingsPage> {
@FindByJQuery(".alert")
private FlashMessage flashMessage;

View file

@ -16,20 +16,20 @@
* limitations under the License.
*/
package org.keycloak.testsuite.ui.test.settings;
package org.keycloak.testsuite.admin.test.settings;
import org.junit.Before;
import org.junit.Test;
import org.keycloak.testsuite.ui.AbstractKeyCloakTest;
import org.keycloak.testsuite.ui.model.Theme;
import org.keycloak.testsuite.ui.page.settings.ThemesSettingsPage;
import org.keycloak.testsuite.admin.AbstractKeycloakTest;
import org.keycloak.testsuite.admin.model.Theme;
import org.keycloak.testsuite.admin.page.settings.ThemesSettingsPage;
/**
*
* @author Filip Kiss
*/
public class ThemesSettingsTest extends AbstractKeyCloakTest<ThemesSettingsPage> {
public class ThemesSettingsTest extends AbstractKeycloakTest<ThemesSettingsPage> {
@Before
public void beforeThemeTest() {

View file

@ -16,26 +16,26 @@
* limitations under the License.
*/
package org.keycloak.testsuite.ui.test.user;
package org.keycloak.testsuite.admin.test.user;
import org.jboss.arquillian.graphene.findby.FindByJQuery;
import org.junit.Test;
import org.keycloak.testsuite.ui.fragment.FlashMessage;
import org.keycloak.testsuite.ui.model.User;
import org.keycloak.testsuite.ui.page.settings.user.UserPage;
import org.keycloak.testsuite.admin.fragment.FlashMessage;
import org.keycloak.testsuite.admin.model.User;
import org.keycloak.testsuite.admin.page.settings.user.UserPage;
import static org.junit.Assert.*;
import org.junit.Before;
import org.junit.Ignore;
import org.keycloak.testsuite.ui.AbstractKeyCloakTest;
import static org.keycloak.testsuite.ui.util.Users.TEST_USER1;
import org.keycloak.testsuite.admin.AbstractKeycloakTest;
import static org.keycloak.testsuite.admin.util.Users.TEST_USER1;
/**
*
* @author Filip Kiss
*/
public class AddNewUserTest extends AbstractKeyCloakTest<UserPage> {
public class AddNewUserTest extends AbstractKeycloakTest<UserPage> {
@FindByJQuery(".alert")
private FlashMessage flashMessage;

View file

@ -1,15 +1,15 @@
package org.keycloak.testsuite.ui.test.user;
package org.keycloak.testsuite.admin.test.user;
import org.jboss.arquillian.graphene.findby.FindByJQuery;
import org.jboss.arquillian.graphene.page.Page;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.keycloak.testsuite.ui.AbstractKeyCloakTest;
import org.keycloak.testsuite.ui.fragment.FlashMessage;
import org.keycloak.testsuite.ui.model.User;
import org.keycloak.testsuite.ui.page.settings.user.RoleMappingsPage;
import org.keycloak.testsuite.ui.page.settings.user.UserPage;
import org.keycloak.testsuite.admin.AbstractKeycloakTest;
import org.keycloak.testsuite.admin.fragment.FlashMessage;
import org.keycloak.testsuite.admin.model.User;
import org.keycloak.testsuite.admin.page.settings.user.RoleMappingsPage;
import org.keycloak.testsuite.admin.page.settings.user.UserPage;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
@ -18,7 +18,7 @@ import static org.openqa.selenium.By.linkText;
/**
* Created by fkiss.
*/
public class RoleMappingsTest extends AbstractKeyCloakTest<RoleMappingsPage> {
public class RoleMappingsTest extends AbstractKeycloakTest<RoleMappingsPage> {
@Page
private UserPage userPage;

View file

@ -16,7 +16,7 @@
* limitations under the License.
*/
package org.keycloak.testsuite.ui.util;
package org.keycloak.testsuite.admin.util;
/**
*

View file

@ -16,7 +16,7 @@
* limitations under the License.
*/
package org.keycloak.testsuite.ui.util;
package org.keycloak.testsuite.admin.util;
import static org.jboss.arquillian.graphene.Graphene.waitAjax;
import static org.jboss.arquillian.graphene.Graphene.waitGui;

View file

@ -16,7 +16,7 @@
* limitations under the License.
*/
package org.keycloak.testsuite.ui.util;
package org.keycloak.testsuite.admin.util;
/**
*
@ -24,11 +24,10 @@ package org.keycloak.testsuite.ui.util;
*/
public class URL {
public static final String BASE_URL = "http://localhost:8080/auth/admin/master/console/index.html";
public static String SETTINGS_GENERAL_SETTINGS = BASE_URL + "#/realms/%s";
public static String SETTINGS_ROLES = BASE_URL + "#/realms/%s/roles";
public static String SETTINGS_LOGIN = BASE_URL + "#/realms/%s/login-settings";
public static String SETTINGS_SOCIAL = BASE_URL + "#/realms/%s/social-settings";
public static final String BASE_URL = "http://localhost:8080/auth";
public static final String ADMIN_URL = BASE_URL + "/admin";
public static final String ACCOUNT_URL = BASE_URL + "/realms/master/account";
public static final String SETTINGS_SOCIAL = ADMIN_URL + "/#/realms/%s/social-settings";
}

View file

@ -16,9 +16,9 @@
* limitations under the License.
*/
package org.keycloak.testsuite.ui.util;
package org.keycloak.testsuite.admin.util;
import org.keycloak.testsuite.ui.model.User;
import org.keycloak.testsuite.admin.model.User;
/**
*

View file

@ -16,28 +16,31 @@
* limitations under the License.
*/
package org.keycloak.testsuite.ui.test.user;
package org.keycloak.testsuite.login;
import org.jboss.arquillian.graphene.findby.FindByJQuery;
import org.jboss.arquillian.graphene.page.Page;
import org.junit.After;
import org.junit.Ignore;
import org.junit.Test;
import org.keycloak.testsuite.ui.fragment.FlashMessage;
import org.keycloak.testsuite.ui.model.User;
import org.keycloak.testsuite.ui.page.RegisterPage;
import org.keycloak.testsuite.ui.page.settings.user.UserPage;
import org.keycloak.testsuite.admin.fragment.FlashMessage;
import org.keycloak.testsuite.admin.model.User;
import org.keycloak.testsuite.admin.page.RegisterPage;
import org.keycloak.testsuite.admin.page.settings.user.UserPage;
import static org.junit.Assert.*;
import org.junit.Before;
import org.keycloak.testsuite.ui.AbstractKeyCloakTest;
import org.keycloak.testsuite.ui.page.settings.LoginSettingsPage;
import static org.keycloak.testsuite.ui.util.Users.*;
import org.keycloak.testsuite.admin.AbstractKeycloakTest;
import org.keycloak.testsuite.admin.page.settings.LoginSettingsPage;
import static org.keycloak.testsuite.admin.util.Users.*;
/**
*
* @author Petr Mensik
*/
public class RegisterNewUserTest extends AbstractKeyCloakTest<RegisterPage> {
// Ignoring this test as it's not working and it's duplicating existing tests
@Ignore
public class RegisterNewUserTest extends AbstractKeycloakTest<RegisterPage> {
@Page
private UserPage userPage;
@ -54,6 +57,7 @@ public class RegisterNewUserTest extends AbstractKeyCloakTest<RegisterPage> {
navigation.login();
loginSettingsPage.enableUserRegistration();
logOut();
openAccount();
loginPage.goToUserRegistration();
}