HTML Editor Test Specification
Author: Jindrich Sedek
Version: 1.17.0
Last update: 12.6.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.
Comment: This test specification does not verify functionality of Swing HTML browser.
Table of Contents
|
Purpose: This test suite checks that syntax highlighting in HTML editor is correct.
Setup: No preparation is necessary for this test suite.
| # | Test case | Description |
| 1 | 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.
|
|
| RESULT: | Valid 4.01 HTML document should be created. |
|
|
test / NewProjectWizardsTest.java ; testDefaultNewWebModWizard()
|
|
| 2 | 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. Compare the syntax highlighting with this picture.
|
|
| RESULT: |
Proper colors should be used for tags (blue), attributes (green), values (pink), comments (grey), plain text (black) and metadata (ochre).
|
|
|
|
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
| # | Test case | Description |
| 1 | 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.
|
|
| 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.
|
|
| 2 | Attributes completion |
-
Press Left arrow and Space which should display all attributes of <html> tag.
- Press Enter key.
|
|
| RESULT: |
Code completion offers attributes based on current tag. Now there must be <html dir=""> in the editor.
|
|
| 3 | Values completion |
- Press CTRL+Space again having cursor between quotation marks.
-
Two values ltr and rtl must show up.
- Press Down arrow and Enter.
|
|
| RESULT: |
Suitable values should be offered in code completion where appropriate. Now <html dir="rtl"> tag should be in the editor.
|
|
| 4 | 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
|
|
| RESULT: |
" should be automatically completed so that you have <html dir="rtl">"
|
|
| 5 | 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.
|
|
| RESULT: |
After pressing Enter the <a> should be completed, end tag </a> should be appended and the cursor shoud be set between new tags.
|
|
| 6 | Smart Enter |
-
Set the cursor between start and end tags of a tag made in last Test case.
- Press Enter .
|
|
| 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.
|
|
|
|
| 7 | 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 Shift+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.
|
|
| RESULT: |
Help window is opened on each code completion invocation and its contents must be scrollable.
|
|
|
|
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
| # | Test case | Description |
| 1 | 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.
|
|
| RESULT: |
Code folds must be created for all tags occupying more than one line and comments.
|
|
| 2 | 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.
|
|
| 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.
|
|
| 3 | 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 Comments from popup menu.
|
|
| RESULT: |
All multiline comments or tags in HTML document should be collapsed/expanded on appropriate demand.
|
|
| 4 | 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.
|
|
| 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.
| # | Test case | Description |
| 1 | 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.
|
|
| 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.
|
|
|
test / HTMLFormatterTest.java ; testReformatSample()
|
|
| 2 | Code indentation |
-
Place cursor behind some close tag e.g. </small> and press Enter.
|
|
| RESULT: | Cursor at new line should inherit indentation used at previous line. |
|
| 3 | Tag matching |
-
Place cursor behind some opening tag e.g. <head> at line 4.
|
|
| 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.
|
|
|
|
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.
| # | Test case | Description |
| 1 | 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.
|
|
| RESULT: | An extra stripe for folding widgets gets removed and code can't be folded. |
|
| 2 | Folding update |
- Invoke Tools | Options from main menu.
- Press Advanced Options button at the bottom of the dialog.
- Select Editing | Editor Settings | HTML Editor node.
- Set Code Folding Update Interval to 10000 milliseconds.
- Check Code Folding Enabled option and press Close button.
|
|
| RESULT: |
Code folding stripe appears immediatelly but code folds are computed after 10 seconds since code folding was turned on.
|
|
| 3 | 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.
|
|
| RESULT: |
Both settings are not set to default values i.e. code folding is turned off and its update interval remains as 10000 ms.
|
|
| 4 | 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.
|
|
| RESULT: |
|
The text coloring should be changed and all HTML entities should be writen by cyan color.
|
 |
|
|
|
Generated: 2006 07 03 05:26