HTML Editor Test Specification for Netbeans 6.0
Author: Jindrich Sedek
Version: 1.17.0
Last update: 19.7.2006
Introduction: This document contains procedures for testing HTML editor. HTML module provides this set of features: syntax highlighting, code completion with help window, code folding, bracket matching and reformating.
Comments:
Test suite: Syntax highlighting
Purpose: This test suite checks that syntax highlighting in HTML editor is correct.
Setup: No preparation is necessary for this test suite.
- New HTML document
- Invoke File | New Project... from main menu.
- Select Web Application project from Web category and press Next
- Uncheck Set Source Level to 1.4 and press Finish.
- Use File | New File... to create new HTML document in Web Pages location.
- EXPECTED RESULT: Valid 4.01 HTML document should be created.
- Syntax highlighting
- Copy whole content of this document
into clipboard.
- Press CTRL+A in the editor and then click Edit | Paste from main menu.
- Editor should replace its content with text from clipboard.
- EXPECTED RESULT: Proper colors should be used. See ui colors specification
Test suite: Code completion
Purpose: This test suite checks that code completion in HTML editor is working correctly.
Setup: No preparation is necessary for this test suite except having web project open.
test / testHTMLCompletion.html
- Tags completion
- Use New | File/Folder... action from popup menu of Web Pages node to create new HTML document.
- Press CTRL+A and type <h in the editor and press CTRL+Space.
- All tags starting with h letter should be offered and help window displayed.
- Type t letter which should reduce the list of suggestions to <html> item only. Press Enter.
- EXPECTED RESULT: Context aware code completion and help window for selected item must show up if CTRL+Space shortcut is used. Upon pressing Enter selected tag must be completed.
- Attributes completion
- Press Left arrow and Space which should display all attributes of <html> tag.
- Press Enter key.
- EXPECTED RESULT: Code completion offers attributes based on current tag. Now there must be <html dir=""> in the editor.
- Values completion
- Press CTRL+Space again having cursor between quotation marks.
- Two values ltr and rtl must show up.
- Press Down arrow and Enter.
- EXPECTED RESULT: Suitable values should be offered in code completion where appropriate. Now <html dir="rtl"> tag should be in the editor.
- HTML entities completion
- Type & and wait for code completion.
- A long list of items will be suggested. Type q character.
- This should reduce the list to only 1 suggestion " . Press Enter.
- EXPECTED RESULT: " should be automatically completed so that you have <html dir="rtl"> "
- End tag completion
- Type <a somewhere in the editor and press CTRL+SPACE.
- All tags starting a letter should be offered and help window displayed.
- Press Enter key.
- After pressing Enter start tag <a> should be completed and end tag </a> should be offered in new completion window. Press Enter.
- EXPECTED RESULT: End tag </a> should be appended and the cursor shoud be set between new tags.
- Smart Enter
- Set the cursor between start and end tags of a tag made in last Test case.
- Press Enter .
- EXPECTED RESULT: The end tag should be moved two lines lower and cursor shoud be set on the line between start and end tags. It should be indented like on the picture.
- Help window
- Type <t| somewhere inside body and press CTRL+Space.
- Code completion will show up together with help window. Use arrows to browse through items.
- Verify that help window displays appropriate description for selected tag.
- Press CTRL+Arrow Down which will scroll down the contents of help window.
- Verify that help window is available for both HTML tags and their attributes.
- Try to press Ctrl+Shift+Space. The help window without code completion will be invoked.
- EXPECTED RESULT: Help window is opened on each code completion invocation and its contents must be scrollable.
Test suite: Code folding
Purpose: This test suite checks that code folding in HTML editor is working correctly.
Setup: No preparation is necessary for this test suite except having web project open.
test / HTMLFoldingTest.java
- Folds creation
- Open HTML document
created in the first test suite.
- Set cursor between text and elements words in comment at line 9 and press Enter.
- EXPECTED RESULT: Code folds must be created for all tags occupying more than one line and comments.
- Folds collapsing
- Put cursor somewhere into HTML document and press CTRL+NumPad-.
- Verify that current tag fold was collapsed.
- Right click editor area and select Code Folds | Collapse Fold from popup menu.
- EXPECTED RESULT: Code folds must get collapsed/expanded on appropriate demand via shortcut or menu. Collapsed fold is represented by + icon and expanded by - icon in the stripe next to line numbers. Besides, collapsed tag is replaced by rectangle with appropriate identification e.g. <!--...--> in case of comments. If user moves mouse over the box, window with content of tag fold is displayed.
- Folds actions
- Press CTRL+Shift+NumPad- to collapse all folds in HTML document.
- Invoke View | Code Folds | Expand All from main menu to see whole file again.
- Right click in editor and choose Code Folds | Collapse All from popup menu.
- EXPECTED RESULT: All should be collapsed.
- Folds window
- Set the cursor on the <table> tag
- Press CTRL+NumPad- to collapse <table> fold in HTML document.
- Move the mouse focus over the folded text.
- EXPECTED RESULT: The window showing content of the folded code should be shown.
Purpose: This test suite checks that code formatting and tag matching functions work correctly.
Setup: No preparation is necessary for this test suite except having web project open.
- Reformat code
- Press CTRL+A and then repeat Shift+Tab multiple times until whole text is moved to left.
- Right click editor area and select Reformat Code action from popup menu.
- Select a piece of code and press Shift+Tab few times to break the code formating again.
- Change the selection to another lines and repeat step 2.
- EXPECTED RESULT: HTML document must be reformated correctly i.e. contents of tags must be indented 4 spaces to right. If some part of code is selected just this part should be reformated.
- Code indentation
- Place cursor behind some close tag e.g. </small> and press Enter.
- EXPECTED RESULT: Cursor at new line should inherit indentation used at previous line.
- Tag matching
- Place cursor behind some opening tag e.g. <head> at line 4.
- EXPECTED RESULT: Matching end tag (at line 6 in this case) should be highlighted in purple color. The same happens vice versa if you select some end tag.
Test suite: Embedded CSS style
Purpose: This test suite checks that embedded CSS style can be well edited in HTML.
Setup: No preparation is necessary for this test suite except having web project open.
- Creating embedded CSS style
- Use File | New File... to create new HTML document in Web Pages location.
- Copy whole content of this document
into clipboard.
- Press CTRL+A in the editor and then click Edit | Paste from main menu.
- Editor should replace its content with text from clipboard.
- EXPECTED RESULT: Code coloring, code folding and code completion should work in the same manner as in CSS specification
Test suite: Navigator
Purpose: This test suite checks that navigator follows HTML code editing .
Setup: No preparation is necessary for this test suite except having web project open.
- Creating Navigator node
- Type <table> </table> at the end of your HTML page.
- New node containing table text should be created in Navigator window.
- Insert <tr></tr> inside table tag.
- New node containg tr should appear in Navigator Window and table node should become closeable.
- EXPECTED RESULT: "Navigator should show actual tree of your HTML code."
- "Navigation"
- "Double click some node in navigator."
- EXPECTED RESULT: "Cursor position should be move to selected rule in text editor."
Test suite: Settings
Purpose: This test suite checks that HTML editor specific settings are working correctly and are persistent.
Setup: No preparation is necessary for this test suite except having web project open.
- Folding switch
- Invoke Tools | Options from main menu.
- Press Advanced Options button at the bottom of the dialog.
- Select Editing | Editor Settings | HTML Editor node.
- Uncheck Code Folding Enabled option.
- Push Close button.
- EXPECTED RESULT: An extra stripe for folding widgets gets removed and code can't be folded.
- Persistence
- Invoke Tools | Options from main menu.
- Press Advanced Options button at the bottom of the dialog.
- Select Editing | Editor Settings | HTML Editor node.
- Uncheck Code Folding Enabled option again and press Close button.
- Invoke File | Exit from main menu and restart NetBeans.
- Repeat steps 1 and 2.
- EXPECTED RESULT: Both settings are not set to default values i.e. code folding is turned off and its update interval remains as 10000 ms.
- Coloring customization
- Invoke Tools|Options from main menu.
- Set the Fonts & Colors tab.
- Select HTML language.
- Choose the Character category.
- Set the Foreground color to Cyan. You shoud see the change in preview window.
- Press Close button.
- Type & somewhere in the code editor.
- EXPECTED RESULT: The text coloring should be changed and all HTML entities should be writen by cyan color.