Author: mposolda(a)redhat.com
Date: 2009-08-05 04:54:14 -0400 (Wed, 05 Aug 2009)
New Revision: 13665
Modified:
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/IdentityAdminTestCase.java
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/LdapIdentityAdminTestCase.java
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/locator.properties
Log:
Refactoring and fix test failures in epp ldap identity selenium test.
Modified:
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/IdentityAdminTestCase.java
===================================================================
---
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/IdentityAdminTestCase.java 2009-08-04
19:30:33 UTC (rev 13664)
+++
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/IdentityAdminTestCase.java 2009-08-05
08:54:14 UTC (rev 13665)
@@ -108,14 +108,20 @@
return MessageFormat.format(LNK_T_USRLIST_ROLES, r - 1);
}
+ /**
+ * This method shouldn't be private because of subclasses of IdentityAdminTestCase
+ */
@BeforeMethod(groups = { "log" })
- private void loginBeforeTest() {
+ protected void loginBeforeTest() {
logoutIfPossible();
login("admin", "admin");
}
+ /**
+ * This method shouldn't be private because of subclasses of IdentityAdminTestCase
+ */
@AfterMethod(groups = { "log" })
- private void logoutAfterTest() {
+ protected void logoutAfterTest() {
}
Modified:
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/LdapIdentityAdminTestCase.java
===================================================================
---
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/LdapIdentityAdminTestCase.java 2009-08-04
19:30:33 UTC (rev 13664)
+++
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/LdapIdentityAdminTestCase.java 2009-08-05
08:54:14 UTC (rev 13665)
@@ -31,6 +31,12 @@
private final String LDAP_ROLE_NAME = "Ldap";
+ private final String INP_PROFILE_GIVENNAME = getLoc(casePfx +
"inp.profile.givenname",
"//input[contains(@id,'profile-form:givenname')]");
+ private final String INP_PROFILE_FAMILYNAME = getLoc(casePfx +
"inp.profile.familyname",
"//input[contains(@id,'profile-form:familyname')]");
+ private final String INP_PROFILE_EXTRA = getLoc(casePfx + "inp.profile.extra",
"//textarea[contains(@id,'profile-form:extra')]");
+ private final String INP_PROFILE_HOMEPAGE = getLoc(casePfx +
"inp.profile.homepage",
"//input[contains(@id,'profile-form:homepage')]");
+ private final String INP_PROFILE_LOCATION = getLoc(casePfx +
"inp.profile.location",
"//input[contains(@id,'profile-form:location')]");
+
/**
* <p>User (tempUser, tempPassword, tempUser(a)redhat.com) and role (tempRole,
* tempRoleDisplay) are created. The role is assigned to the user and it is
@@ -103,20 +109,20 @@
// Go to edit page and check user profile
goToEdit(LDAP1_USER, LDAP1_USER_MAIL);
// TODO: add localizators while they will be added to IdentityAdminTestCase.
- Assert.assertTrue(selenium.getValue("//input[contains(@id,'profile-form:givenname')]").equals(LDAP1_FIRST_NAME),
"First name should be " + LDAP1_FIRST_NAME + " but is " +
selenium.getValue("//input[contains(@id,'profile-form:givenname')]"));
- Assert.assertTrue(selenium.getValue("//input[contains(@id,'profile-form:lastname')]").equals(LDAP1_SURNAME),
"Surname should be " + LDAP1_SURNAME + " but is " +
selenium.getValue("//input[contains(@id,'profile-form:lastname')]"));
- Assert.assertTrue(selenium.getValue("//input[contains(@id,'profile-form:location')]").contains("Brno,
Czechue Republic"), "Location should contains Brno,Czechue Republic but is
" +
selenium.getValue("//input[contains(@id,'profile-form:location')]"));
- Assert.assertTrue(selenium.getValue("//textarea[contains(@id,'profile-form:extra')]").contains("This
is content of ldap attribute \"description\""), "Description has value
" +
selenium.getValue("//textarea[contains(@id,'profile-form:extra')]"));
+ Assert.assertTrue(selenium.getValue(INP_PROFILE_GIVENNAME).equals(LDAP1_FIRST_NAME),
"First name should be " + LDAP1_FIRST_NAME + " but is " +
selenium.getValue(INP_PROFILE_GIVENNAME));
+ Assert.assertTrue(selenium.getValue(INP_PROFILE_FAMILYNAME).equals(LDAP1_SURNAME),
"Surname should be " + LDAP1_SURNAME + " but is " +
selenium.getValue(INP_PROFILE_FAMILYNAME));
+ Assert.assertTrue(selenium.getValue(INP_PROFILE_LOCATION).contains("Brno, Czechue
Republic"), "Location should contains Brno,Czechue Republic but is " +
selenium.getValue(INP_PROFILE_LOCATION));
+ Assert.assertTrue(selenium.getValue(INP_PROFILE_EXTRA).contains("This is content
of ldap attribute \"description\""), "Description has value " +
selenium.getValue(INP_PROFILE_EXTRA));
// fill some attributes (homepage should be DB attribute and givenname should be LDAP
attribute) and check them.
- selenium.type("//input[contains(@id,'profile-form:givenname')]",
"Jack");
- selenium.type("//input[contains(@id,'profile-form:homepage')]",
"http://www.jboss.org/jbossportal");
+ selenium.type(INP_PROFILE_GIVENNAME, "Jack");
+ selenium.type(INP_PROFILE_HOMEPAGE, "http://www.jboss.org/jbossportal");
clickAndWait(SUB_EDIT_PROF);
goToEdit(LDAP1_USER, LDAP1_USER_MAIL);
- Assert.assertTrue(selenium.getValue("//input[contains(@id,'profile-form:givenname')]").equals("Jack"),
"First name should be Jack but is " +
selenium.getValue("//input[contains(@id,'profile-form:givenname')]"));
- Assert.assertTrue(selenium.getValue("//input[contains(@id,'profile-form:homepage')]").equals("http://www.jboss.org/jbossportal"),
"Homepage should be
http://www.jboss.org/jbossportal but is " +
selenium.getValue("//input[contains(@id,'profile-form:homepage')]"));
+ Assert.assertTrue(selenium.getValue(INP_PROFILE_GIVENNAME).equals("Jack"),
"First name should be Jack but is " +
selenium.getValue(INP_PROFILE_GIVENNAME));
+
Assert.assertTrue(selenium.getValue(INP_PROFILE_HOMEPAGE).equals("ht...,
"Homepage should be
http://www.jboss.org/jbossportal but is " +
selenium.getValue(INP_PROFILE_HOMEPAGE));
// Change name to the original value
- selenium.type("//input[contains(@id,'profile-form:givenname')]",
LDAP1_FIRST_NAME);
+ selenium.type(INP_PROFILE_GIVENNAME, LDAP1_FIRST_NAME);
clickAndWait(SUB_EDIT_PROF);
}
Modified:
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/locator.properties
===================================================================
---
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/locator.properties 2009-08-04
19:30:33 UTC (rev 13664)
+++
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/locator.properties 2009-08-05
08:54:14 UTC (rev 13665)
@@ -74,6 +74,11 @@
iden.man.lnk.usermang.main2=//a[contains(@id,'user-temp-form1:user-mgm-link')]
iden.man.lnk.create.user=//a[contains(@id,':user-form:create-user-link')]
iden.man.chk.role=//input[contains(@name,''assign-roles-form:roles'') and
@value=''{0}'']
+iden.man.inp.profile.givenname=//input[contains(@id,'profile-form:givenname')]
+iden.man.inp.profile.familyname=//input[contains(@id,'profile-form:familyname')]
+iden.man.inp.profile.extra=//textarea[contains(@id,'profile-form:extra')]
+iden.man.inp.profile.homepage=//input[contains(@id,'profile-form:homepage')]
+iden.man.inp.profile.location=//input[contains(@id,'profile-form:location')]
# DashboardTestCase