Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
replace s:decorate with zanata:decorate
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick Huang committed Sep 17, 2015
1 parent bcb2174 commit 9fed6b8
Show file tree
Hide file tree
Showing 50 changed files with 932 additions and 226 deletions.
1 change: 1 addition & 0 deletions functional-test/pom.xml
Expand Up @@ -516,6 +516,7 @@
<classifier>mysql.classifier</classifier>
<port>${mysql.port}</port>
<socket>${mysql.socket}</socket>
<clearexistingdata>false</clearexistingdata>
</configuration>
<executions>
<execution>
Expand Down
Expand Up @@ -43,12 +43,13 @@ public HomePage clickResendActivationEmail() {
}

public InactiveAccountPage enterNewEmail(String email) {
enterText(readyElement(By.id("inactiveAccountForm:emailField:email")), email);
enterText(readyElement(By.id("inactiveAccountForm:email:input:email"))
,email);
return new InactiveAccountPage(getDriver());
}

public HomePage clickUpdateEmail() {
clickElement(By.id("inactiveAccountForm:emailField:updateEmail"));
clickElement(By.id("inactiveAccountForm:email:input:updateEmail"));
return new HomePage(getDriver());
}
}
Expand Up @@ -49,10 +49,10 @@ public class RegisterPage extends CorePage {
public static final String USERNAME_LENGTH_ERROR =
"size must be between 3 and 20";

private By nameField = By.id("loginForm:name");
private By emailField = By.id("loginForm:emailField:email");
public By usernameField = By.id("loginForm:usernameField:username");
private By passwordField = By.id("loginForm:passwordField:password");
private By nameField = By.id("loginForm:nameField:input:name");
private By emailField = By.id("loginForm:email:input:email");
public By usernameField = By.id("loginForm:username:input:username");
private By passwordField = By.id("loginForm:passwordField:input:password");
private By signUpButton = By.xpath("//input[@value='Sign Up']");
private By showHideToggleButton = By.className("js-form-password-toggle");
private By loginLink = By.linkText("Log In");
Expand Down
Expand Up @@ -33,7 +33,7 @@
@Slf4j
public class ResetPasswordPage extends BasePage {

private By usernameEmailField = By.id("passwordResetRequestForm:usernameEmailField:usernameEmail");
private By usernameEmailField = By.id("passwordResetRequestForm:usernameEmail:input:usernameEmail");
private By submitButton = By.id("passwordResetRequestForm:submitRequest");

public ResetPasswordPage(WebDriver driver) {
Expand Down
Expand Up @@ -32,9 +32,9 @@
@Slf4j
public class EditRoleAssignmentPage extends BasePage {

private By policySelect = By.id("role-rule-form:policyNameField:policyName");
private By patternField = By.id("role-rule-form:identityPatternField:identityPattern");
private By roleSelect = By.id("role-rule-form:roleField:roles");
private By policySelect = By.id("role-rule-form:policyName:input:policyName");
private By patternField = By.id("role-rule-form:identityPattern:input:identityPattern");
private By roleSelect = By.id("role-rule-form:role:input:roles");
private By saveButton = By.id("role-rule-form:save");
private By cancelButton = By.id("role-rule-form:cancel");

Expand Down
Expand Up @@ -38,8 +38,8 @@ public class ManageUserAccountPage extends BasePage {

public static String PASSWORD_ERROR = "Passwords do not match";

private By passwordField = By.id("userdetailForm:passwordField:password");
private By passwordConfirmField = By.id("userdetailForm:passwordConfirmField:confirm");
private By passwordField = By.id("userdetailForm:password:input:password");
private By passwordConfirmField = By.id("userdetailForm:passwordConfirm:input:confirm");
private By enabledField = By.id("userdetailForm:enabled");
private By saveButton = By.id("userdetailForm:userdetailSave");
private By cancelButton = By.id("userdetailForm:userdetailCancel");
Expand Down Expand Up @@ -76,7 +76,7 @@ public ManageUserAccountPage clickEnabled() {

public ManageUserAccountPage clickRole(String role) {
log.info("Click role {}", role);
clickElement(readyElement(By.id("userdetailForm:rolesField:roles:"
clickElement(readyElement(By.id("userdetailForm:roles:input:roles:"
.concat(roleMap.get(role)))));
return new ManageUserAccountPage(getDriver());
}
Expand Down
Expand Up @@ -34,20 +34,20 @@
@Slf4j
public class ServerConfigurationPage extends BasePage {

private By urlField = By.id("serverConfigForm:urlField:url");
public static By registerUrlField = By.id("serverConfigForm:registerField:registerUrl");
private By urlField = By.id("serverConfigForm:url:input:url");
public static By registerUrlField = By.id("serverConfigForm:register:input:registerUrl");
private By emailDomainField = By.id("serverConfigForm:emailDomainField:emailDomain");
private By adminEmailField = By.id("serverConfigForm:adminEmailField:adminEml");
public static By fromEmailField = By.id("serverConfigForm:fromEmailField:fromEml");
private By adminEmailField = By.id("serverConfigForm:adminEmail:input:adminEml");
public static By fromEmailField = By.id("serverConfigForm:fromEmail:input:fromEml");
private By enableLogCheck = By.id("serverConfigForm:enableLogCheck");
private By logLevelSelect = By.id("serverConfigForm:logEmailLvl");
private By emailDestinationField = By.id("serverConfigForm:logDestEmailField:logDestEml");
private By helpUrlField = By.id("serverConfigForm:helpUrlField:helpInput");
private By termsUrlField = By.id("serverConfigForm:termsOfUseUrlField:termsOfUseUrlEml");
private By piwikUrl = By.id("serverConfigForm:piwikUrlField:piwikUrlEml");
private By emailDestinationField = By.id("serverConfigForm:logDestEmail:input:logDestEml");
private By helpUrlField = By.id("serverConfigForm:helpUrl:input:helpInput");
private By termsUrlField = By.id("serverConfigForm:termsOfUseUrl:input:termsOfUseUrlEml");
private By piwikUrl = By.id("serverConfigForm:piwikUrl:input:piwikUrlEml");
private By piwikId = By.id("serverConfigForm:piwikIdSiteEml");
private By maxConcurrentField = By.id("serverConfigForm:maxConcurrentPerApiKeyField:maxConcurrentPerApiKeyEml");
private By maxActiveField = By.id("serverConfigForm:maxActiveRequestsPerApiKeyField:maxActiveRequestsPerApiKeyEml");
private By maxConcurrentField = By.id("serverConfigForm:maxConcurrentPerApiKey:input:maxConcurrentPerApiKeyEml");
private By maxActiveField = By.id("serverConfigForm:maxActiveRequestsPerApiKey:input:maxActiveRequestsPerApiKeyEml");
private By saveButton = By.id("serverConfigForm:save");

public ServerConfigurationPage(WebDriver driver) {
Expand Down
Expand Up @@ -32,8 +32,8 @@
@Slf4j
public class TranslationMemoryEditPage extends BasePage {

private By idField = By.id("tmForm:slugField:slug");
private By descriptionField = By.id("tmForm:descriptionField:description");
private By idField = By.id("tmForm:slug:input:slug");
private By descriptionField = By.id("tmForm:description:input:description");
private By saveButton = By.id("tmForm:save");
private By cancelButton = By.id("tmForm:cancel");

Expand Down
Expand Up @@ -42,10 +42,10 @@ public class DashboardAccountTab extends DashboardBasePage {
public static final String EMAIL_TAKEN_ERROR =
"This email address is already taken";

private By emailField = By.id("email-update-form:emailField:email");
private By emailField = By.id("email-update-form:emailField:input:email");
private By updateEmailButton = By.id("email-update-form:updateEmailButton");
private By oldPasswordField = By.id("passwordChangeForm:oldPasswordField:oldPassword");
private By newPasswordField = By.id("passwordChangeForm:newPasswordField:newPassword");
private By oldPasswordField = By.id("passwordChangeForm:oldPasswordField:input:oldPassword");
private By newPasswordField = By.id("passwordChangeForm:newPasswordField:input:newPassword");
private By changePasswordButton = By.id("passwordChangeForm:changePasswordButton");

public DashboardAccountTab(WebDriver driver) {
Expand Down
Expand Up @@ -32,7 +32,7 @@
@Slf4j
public class DashboardProfileTab extends DashboardBasePage {

private By accountNameField = By.id("profileForm:nameField:accountName");
private By accountNameField = By.id("profileForm:nameField:input:accountName");
private By updateProfileButton = By.id("updateProfileButton");

public DashboardProfileTab(WebDriver driver) {
Expand Down
Expand Up @@ -41,9 +41,9 @@ public class CreateVersionGroupPage extends BasePage {
"must start and end with letter or number, and contain only " +
"letters, numbers, periods, underscores and hyphens.";

private By groupIdField = By.id("group-form:slugField:slug");
public By groupNameField = By.id("group-form:nameField:name");
private By groupDescriptionField = By.id("group-form:descriptionField:description");
private By groupIdField = By.id("group-form:slug:input:slug");
public By groupNameField = By.id("group-form:name:input:name");
private By groupDescriptionField = By.id("group-form:description:input:description");
private By saveButton = By.id("group-form:group-create-new");
private By createNewButton = By.id("group-form:group-create-new");

Expand Down
Expand Up @@ -31,7 +31,7 @@
@Slf4j
public class ContactTeamPage extends BasePage {

private By messageField = By.id("contactCoordinatorForm:messageField:contact-coordinator-message");
private By messageField = By.id("contactCoordinatorForm:messageField:input:contact-coordinator-message");
private By sendButton = By.id("contact-coordinator-send-button");

public ContactTeamPage(WebDriver driver) {
Expand Down
Expand Up @@ -31,9 +31,9 @@
@Slf4j
public class CreateProjectPage extends BasePage {

private By idField = By.id("project-form:slugField:slug");
private By nameField = By.id("project-form:nameField:name");
private By descriptionField = By.id("project-form:descriptionField:description");
private By idField = By.id("project-form:slug:input:slug");
private By nameField = By.id("project-form:name:input:name");
private By descriptionField = By.id("project-form:description:input:description");
private By projectTypeList = By.id("project-types");
private By createButton = By.id("project-form:create-new");

Expand Down
Expand Up @@ -41,7 +41,7 @@ public class ProjectsPage extends BasePage {

private By createProjectButton = By.id("createProjectLink");
private By mainContentDiv = By.id("main_body_content");
private By projectTable = By.id("main_content:form:projectList");
private By projectTable = By.id("form:projectList");
private By activeCheckBox = By.xpath("//*[@data-original-title='Filter active projects']");
private By readOnlyCheckBox = By.xpath("//*[@data-original-title='Filter read-only projects']");

Expand Down
Expand Up @@ -38,12 +38,12 @@
@Slf4j
public class ProjectGeneralTab extends ProjectBasePage {

private By projectIdField = By.id("settings-general-form:slugField:slug");
private By projectNameField = By.id("settings-general-form:nameField:name");
private By descriptionField = By.id("settings-general-form:descriptionField:description");
private By projectIdField = By.id("settings-general-form:slug:input:slug");
private By projectNameField = By.id("settings-general-form:name:input:name");
private By descriptionField = By.id("settings-general-form:description:input:description");
private By projectTypeList = By.id("project-types");
private By homepageField = By.id("settings-general-form:homePageField:homePage");
private By repoField = By.id("settings-general-form:repoField:repo");
private By homepageField = By.id("settings-general-form:homePage:input:homePage");
private By repoField = By.id("settings-general-form:repo:input:repo");
private By deleteButton = By.id("button-archive-project");
private By confirmDeleteButton = By.id("deleteButton");
private By confirmDeleteInput = By.id("confirmDeleteInput");
Expand Down
Expand Up @@ -37,7 +37,7 @@ public class CreateVersionPage extends BasePage {
"must start and end with letter or number, and contain only " +
"letters, numbers, periods, underscores and hyphens.";

public By projectVersionID = By.id("create-version-form:slugField:slug");
public By projectVersionID = By.id("create-version-form:slug:input:slug");
private By projectTypeSelection = By.id("create-version-form:project-type");
private By saveButton = By.id("create-version-form:button-create");
private By copyFromPreviousVersionChk = By.id("create-version-form:copy-from-version");
Expand Down
Expand Up @@ -34,7 +34,7 @@
public class ContactAdminFormPage extends BasePage {

private By subjectField = By.id("contactAdminForm:subjectField:subject");
private By messageField = By.id("contactAdminForm:messageField:contact-admin-message");
private By messageField = By.id("contactAdminForm:messageField:input:contact-admin-message");
private By sendButton = By.id("contact-admin-send-button");

public ContactAdminFormPage(WebDriver driver) {
Expand Down
Expand Up @@ -46,9 +46,6 @@
@Category(DetailedTest.class)
public class VersionGroupTest extends ZanataTestCase {

// @ClassRule
// public static AddUsersRule addUsersRule = new AddUsersRule();

@ClassRule
public static SampleProjectRule sampleProjectRule = new SampleProjectRule();

Expand Down
1 change: 0 additions & 1 deletion zanata-war/pom.xml
Expand Up @@ -160,7 +160,6 @@
<usedDependency>com.google.guava:guava-gwt</usedDependency>
<!-- Used for StringUtils lib -->
<!-- Needed by ui rendering at runtime -->
<usedDependency>org.jboss.spec.javax.el:jboss-el-api_2.2_spec</usedDependency>
<usedDependency>javax.servlet.jsp:jsp-api</usedDependency>
<!-- Used for different content analyzers based on langugage for search. -->
<usedDependency>org.apache.solr:solr-core</usedDependency>
Expand Down
4 changes: 2 additions & 2 deletions zanata-war/src/main/java/org/zanata/action/UserAction.java
Expand Up @@ -188,7 +188,7 @@ public String save() {

private String saveNewUser() {
if (password == null || !password.equals(confirm)) {
StatusMessages.instance().addToControl("password", "Passwords do not match");
facesMessages.addToControl("password", "Passwords do not match");
return "failure";
}

Expand All @@ -211,7 +211,7 @@ private String saveExistingUser() {
// Check if a new password has been entered
if (password != null && !"".equals(password)) {
if (!password.equals(confirm)) {
StatusMessages.instance().addToControl("password", "Passwords do not match");
facesMessages.addToControl("password", "Passwords do not match");
return "failure";
} else {
identityManager.changePassword(username, password);
Expand Down

0 comments on commit 9fed6b8

Please sign in to comment.