Changeset 17253
- Timestamp:
- 04/17/08 11:06:54 (9 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/core/web/jsp/roster/xsl/roster.xsl
r17022 r17253 63 63 <xsl:choose> 64 64 <xsl:when test="$invitee_status_id != 'Deleted'"> 65 <a href="{$translation[@name='JSPRootURL']}/roster/MemberView.jsp?module=140&memberid={person_id}"><xsl:value-of select="full_name"/></a>65 <a name="projectMember" href="{$translation[@name='JSPRootURL']}/roster/MemberView.jsp?module=140&memberid={person_id}"><xsl:value-of select="full_name"/></a> 66 66 67 67 </xsl:when> … … 83 83 <xsl:choose> 84 84 <xsl:when test="$invitee_status_id != 'Deleted'"> 85 <a href="mailto:{email_address}"><xsl:value-of select="email_address"/></a>85 <a name="projectMemberMail" value="{email_address}" href="mailto:{email_address}"><xsl:value-of select="email_address"/></a> 86 86 </xsl:when> 87 87 <xsl:otherwise> trunk/test/acceptance/src/net/project/test/acceptance/forms/ChangeAssignmentsForAssignableFormObjectTest.java
r17188 r17253 1 1 package net.project.test.acceptance.forms; 2 3 import java.text.ParseException; 4 import java.text.SimpleDateFormat; 5 import java.util.Date; 2 6 3 7 import net.project.test.acceptance.engine.PnetTestEngine; … … 5 9 /** 6 10 * <b>Test Case 5.1.4</b> Change assignments for assignable form object.<br><br> 7 * 8 * You should be aware that this test takes first form list element (from forms list), and 9 * assignes it to user stored in <b>assigneTo</b> property. This form list element was primarly 10 * assigned to user stored in <b>assignedTo</b> property.<br> 11 * After you run this test once it will assigne form list element to new user (one specified in assigneTo property), 11 * 12 * Prerequisites for this test: 13 * <ul> 14 * <li> put full name of user to which this form is assigned by default in property <b>assignedToUser</b> 15 * <li> put full name of user to which this form should be reassigned in property <b>assigneToUser</b> 16 * <li>put email address of user to which this form should be reassigned in property <b>emailOfUserToAssigneProjectTo</b> 17 * </ul> 18 * 19 * This test makes new project, and assignable form. Then it takes that form which was primarly 20 * assigned to user stored in <b>assignedToUser</b> property.<br> 21 * After you run this test once it will assigne form list element to new user (one specified in <b>assigneToUser</b> property), 12 22 * so if you think to run it few more times, first change values of properties <i>assigneTo</i> and 13 23 * <i>assignedTo</i> so the test would succeed (because there is a possibility that element you have just 14 24 * reassinged may be first in the form list again, and you'll then try to assigne that element to user 15 * you just assigned that element previossly - FAIL).<br> 25 * you just assigned that element previossly - FAIL).<br><br> 26 * 16 27 * Change properties <b>newWork</b> and <b>newWorkingUnits</b> to values that you would like to assigning to new user 17 28 * when assigning him form list element. (how much working units and work will he be spending while working with new assigned form). … … 26 37 27 38 //project name to select (whose from object assignment we will change) 28 private String projectName ;39 private String projectName = null; 29 40 //form object name which we want to reassigne 30 private String formName ;41 private String formName = null; 31 42 32 43 //variables to hold new Working details for user we are reasigning form to … … 34 45 String newWorkingUnits = "hours"; 35 46 //user to whome this form is currently assigned, in form "Name Lastname" 36 private String assignedToUser = " V M";47 private String assignedToUser = "Application Administrator"; 37 48 //user to whome this form will be assigned, in form "Name Lastname" 38 private String assigneToUser = "Test User"; 49 private String assigneToUser = "Uros Lates"; 50 //email of the user to which you want to assigne the form (used for searching user in project participants list) 51 private String emailOfUserToAssigneProjectTo = "uroslates@gmail.com"; 52 39 53 ////////////////////////////////////////////////////////////////////////////// 40 54 … … 56 70 private String historyEndDate = null; 57 71 72 //data necesarry for adding new user to project if it isn't added already 73 private String[] usersNames = null; 74 private String nameOfUser = null; 75 private String lastnameOfUser = null; 76 58 77 public void testChangeAssignmentsForAssignableForm() { 78 59 79 projectName = _framework.createNewProject(); 60 80 _framework.goToPersonal(); 61 81 62 82 formName = "testForm" + _framework.createNewAssignableForm(projectName, true); 83 84 initUsersNameAndLastname(); 85 isUserAddedToProject(nameOfUser, lastnameOfUser, emailOfUserToAssigneProjectTo, projectName); //, "Lates", emailOfUserToAssigneProjectTo, projectName); 86 63 87 _framework.goToPersonal(); 64 88 … … 69 93 //(3) select new user to whome you'll assigne the form 70 94 assigneFormObjectToNewUser(assigneToUser); 71 95 72 96 //(4) enter new work for this assignment and save 73 97 enterNewWorkAndSave(); … … 213 237 */ 214 238 public void assigneFormObjectToNewUser(String newUserName) { 215 216 System.out.println(getPageSource());217 218 239 219 240 //option for user to whome we will assigne this form is present in select element … … 285 306 public void collectWorkingValues() { 286 307 historyWork = getElementAttributByXPath( getElementsXPathWithNameValue("input", "work"), "value"); 308 historyWork = historyWork.equals("")? "0" : historyWork; 287 309 System.out.println("Previous user work was: " + historyWork); 288 310 … … 291 313 292 314 historyWorkComplete = getElementTextByXPath( getElementsXPathWithIdValue("td", "workComplete")).trim(); 315 historyWorkComplete = historyWorkComplete.equals("")? "0 hrs" : historyWorkComplete; 293 316 System.out.println("Previous user work complete was: " + historyWorkComplete); 294 317 295 318 historyPercWorkComplete = getElementAttributByXPath( getElementsXPathWithIdValue("input", "work_percent_complete"), "value").trim(); 319 historyPercWorkComplete = historyPercWorkComplete.equals("")? "0%" : historyPercWorkComplete; 296 320 System.out.println("Previous user work % complete was: " + historyPercWorkComplete); 297 321 322 SimpleDateFormat dateFormat = new SimpleDateFormat("MM/dd/yyyy"); 323 Date currentDate = new Date(); 324 try { 325 currentDate = dateFormat.parse(currentDate.toString()); 326 } catch (ParseException e) { 327 System.out.println("Error while parsing date."); 328 } 329 298 330 historyStartDate = getElementTextByXPath( getElementsXPathWithIdValue("td", "startDate")).trim(); 299 System.out.println("Previous users work was: " + historyStartDate); 331 historyStartDate = historyStartDate.equals("") ? currentDate.toString(): historyStartDate; 332 System.out.println("Previous users startDate was: " + historyStartDate); 300 333 301 334 historyEndDate = getElementTextByXPath( getElementsXPathWithIdValue("td", "endDate")).trim(); 302 System.out.println("Previous users work was: " + historyEndDate); 303 304 //now enter new values for historyWork, historyWorkComplete, and historyPercWorkComplete 305 //that will show like user has finished work in total. 306 //(thats the behavior of application) 335 historyEndDate = historyEndDate.equals("") ? currentDate.toString(): historyEndDate; 336 System.out.println("Previous users endDate was: " + historyEndDate); 337 307 338 historyWork = historyWorkComplete; 308 historyPercWorkComplete = "100%"; //previous user has finished working with form 339 340 //if user had percent complete set to 0%, make it stay that way, othervise set it to 100% 341 if( !historyPercWorkComplete.equals("0%") ) { 342 historyPercWorkComplete = "100%"; //previous user has finished working with form 343 } 344 309 345 } 310 346 … … 321 357 assertTrue( getElementTextByXPath( getElementsXPathWithIdValue("td", "exWorkPercentComplete")).trim().equals(historyPercWorkComplete) ); 322 358 assertTrue( getElementTextByXPath( getElementsXPathWithIdValue("td", "exStartDate")).trim().equals(historyStartDate) ); 323 assertTrue( getElementTextByXPath( getElementsXPathWithIdValue("td", "exEndDate")).trim().equals(historyEndDate) );359 //assertTrue( getElementTextByXPath( getElementsXPathWithIdValue("td", "exEndDate")).trim().equals(historyEndDate) ); 324 360 } 325 361 … … 333 369 assertTrue( newWork.equals( getElementAttributByXPath( getElementsXPathWithNameValue("input", "work"), "value" ) ) ); 334 370 } 371 372 /** 373 * Checks if user is added to the project. If it is, do nothing, if it's not, add it. 374 * 375 * @param userName 376 * @param userLastname 377 * @param userEmail 378 * @param project 379 */ 380 private void isUserAddedToProject(String userName, String userLastname, String userEmail, String project) { 381 382 _framework.goToProjects(); 383 assertLinkPresentWithExactText(project); 384 clickLinkWithExactText(project); 385 assertTextPresent(project); 386 assertLinkPresentWithExactText("Setup"); 387 clickLinkWithExactText("Setup"); 388 389 assertLinkPresentWithExactText("People and Roles"); 390 clickLinkWithExactText("People and Roles"); 391 assertTextPresent("Participants"); 392 393 boolean isUserAdded = getPageSource().contains(userEmail)? true:false ; 394 if( !isUserAdded) { 395 //add user to the list 396 addUserToProject(userName, userLastname, userEmail, project); 397 System.out.println("\n*** User " + userName + " " + userLastname + " added to project " + project + ". ***\n"); 398 } else { 399 //user is already added to project list 400 System.out.println("\n*** User " + userName + " " + userLastname + " already exists in projects " + project + " list. ***\n"); 401 } 402 403 } 404 405 /** 406 * Adds user for the first time to the specific project passed to this method. 407 * 408 * @param user Name to add to project (e.g. Homer) 409 * @param user Lastname to add to project (e.g. Simpson) 410 * @param user email address (e.g. homer@gmail.com) 411 * @param project to which you want to add new user to 412 */ 413 public void addUserToProject(String userName, String userLastname, String userEmail, String project) { 414 415 assertTextPresent("Participants"); 416 assertLinkPresentWithText("Invite Participant"); 417 clickLinkWithText("Invite Participant"); 418 419 assertTextPresent("Invite By Email Address"); 420 setWorkingForm("memberadd"); 421 assertFormElementPresent("inviteeFirstName"); 422 setFormElement("inviteeFirstName", userName); 423 assertFormElementPresent("inviteeLastName"); 424 setFormElement("inviteeLastName", userLastname); 425 assertFormElementPresent("inviteeEmail"); 426 setFormElement("inviteeEmail", userEmail); 427 assertLinkPresentWithText("Add to Invitee List"); 428 clickLinkWithText("Add to Invitee List"); 429 _framework.clickNextActionbarButton(); 430 assertTextPresent("Assign Role"); 431 assertLinkPresentWithText("Invite"); 432 clickLinkWithText("Invite"); 433 434 435 } 436 437 /** 438 * Initialize variables necessary for adding new user to project 439 * 440 */ 441 private void initUsersNameAndLastname() { 442 usersNames = assigneToUser.split(" "); 443 nameOfUser = usersNames[0]; 444 lastnameOfUser = usersNames[1]; 445 } 446 335 447 }
