TS 69 WebRefactoring

Contents

Test suite: "CSS Refactoring"

  1. Find CSS Class Usages
    1. Download, unzip and open File:CSSRefactoring.zip project in the IDE.
    2. Open greenspan.css file from green_span directory.
    3. Invoke find usages at '.box' CSS class definition.
    4. Disable 'Find Also Unrelated Occurances' checkbox.
    5. Five usages in the same CSS file should be found and few more usages in near HTML file should be found.
  2. Find CSS ID Usages
    1. Open greenspan.css file from green_span directory.
    2. Invoke find usages at '#middle' CSS ID definition.
    3. Two usages in the same CSS file should be found and one more usage in near HTML file should be found.
  3. Refactor CSS Class name
    1. Open greenspan.css file from green_span directory.
    2. Invoke Refactor|Rename at '.box' CSS class definition.
    3. Change the name to '.small_box' and press 'Preview' button
    4. All occurences should be found and marked for change in CSS Refactoring preview.
    5. Perform refactoring.
    6. Verify that all occurences were correctly renamed.
  4. Refactor CSS ID name
    1. Open greenspan.css file from green_span directory.
    2. Invoke Refactor|Rename at '#permlink' CSS ID definition.
    3. Change the name to '#permanent_link' and press 'Preview' button
    4. All occurences should be found and marked for change in CSS Refactoring preview.
    5. Perform refactoring.
    6. Verify that all occurences were correctly renamed.
  5. HTML Side Refactoring and Find Usages
    1. Open index.html file from free_CSS_lunch directory
    2. Invoke FindUsages or Refactor at 'blog' class of a div tag at line 41.
    3. Few occurences in index.html should be found and Renamed correctly after invoking refactoring.
    4. Try the same Find Usages or Refactor|Rename functionality on an CSS id declared in the HTML file.
  6. Refactoring in JSP files
    1. In previous usecases replace the directory to multi_colors directory and verify that all usages are found in index.jsp file as well in index.html file.
  7. Find Unrelated Occurences
    1. Enable 'Find Also Unrelated Occurences'/'Refactor Also Unrelated Occurences' in FindUsages/Refactoring dialog and verify that Find Usages/Refactoring discovers also occurences of the same CSS ID/Class in non related files.

Test suite: "CSS Hyperlinking"

  1. CSS Style Hyperlinking From HTML
    1. Open index.html file from multi_colors directory
    2. Keep press Control key and left click 'style.css' file name in <link> tag in head of the document.
    3. style.css file that is placed in the same directory should get open.
  2. CSS Style Hyperlinking From JSP
    1. Open index.jsp file from multi_colors directory
    2. Keep press Control key and left click 'style.css' file name in <link> tag in head of the document.
    3. style.css file that is placed in the same directory should get open.
  3. CSS Class Hyperlinking
    1. Open index.html file from multi_colors directory
    2. Keep press Control key and left click 'leftcontent' class of div tag at line 20 of the document.
    3. Go To Declaration popup view should appear containing all CSS selectors containing leftcontent class.
    4. Choose a selector that is not marked as unrelated.
    5. style.css file that is placed in the same directory should get open and the cursor position should be moved to selected CSS selector.
  4. Perform previous testcase with index.jsp file instead of index.html file to verify the functionality on JSP files.
  5. CSS ID Hyperlinking
    1. Open index.html file from multi_colors directory
    2. Keep press Control key and left click 'right' id of div tag at line 45 of the document.
    3. Go To Declaration popup view should appear containing all CSS selectors containing right ID.
    4. Choose a selector that is not marked as unrelated.
    5. style.css file that is placed in the same directory should get open and the cursor position should be moved to selected CSS selector.
  6. Perform previous testcase with index.jsp file instead of index.html file to verify the functionality on JSP files.

Test suite: "CSS File Usages/Refactoring"

  1. Invoke find usages on style.css file in multi_colors directory
    1. Both index.html and index.jsp should be found
  2. Invoke Refactor on style.css file in multi_colors directory
    1. Both link references from index.html and index.jsp should be renamed together with the CSS file name.

Test suite: "CSS hexadecimal color Find Usage and refactoring"=

  1. CSS hash colors refactoring
    1. Open index.html file from green_span directory
    2. Add this code into head section: <style type="text/css" > #sidebar{color: #fffaaa;} </style>
    3. Add this line somewhere in the document: <div style="color: #fffaaa;"></div>
    4. Open greenspan.css and add this code at the end of the document .vzdz{ border-color: #fffaaa;}
    5. Righ click at #fffaaa; and invoke refactor rename action
    6. Change the value of color to '#00ff00' and invoke preview
    • All occurences of the #fffaaa; color should be found - in CSS file, in CSS embedded in HTML and also directly in inline style
    1. Invoke refactor
    • All occurences of the #fffaaa color should be replaced with '#00ff00' color
  2. Find Usages of CSS hashcolor
    1. Right click on '#00ff00' in index.html or greenspan.css in green_span directory
    2. Invoke Find Usages
    • All occurences of the #00f00 color should be found
Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo