JavaScript Editor Test Specification
Author: Lukasz Grela
Version: 1.18
Last update: 05.01.2006
Introduction:
This document contains procedures for testing JavaScript editor.
Comments:
Test suite: Syntax highlighting
Purpose: This test suite checks that syntax highlighting in JavaScript editor is correct.
Setup: Create Web or JavaApplication project
- Use New File | Scripting | Empty JavaScript File... to create new JavaScript file.
- Paste content of this file into editor, this document contains all JavaScript keywords.
-
Enter String wich is not a JavaScript keywords, such string should not be highlighted.
- EXPECTED RESULT:
New JavScript file is opened in editor,and all entered key words are highlighted.
Test suite: Code completion
Purpose:
This test suite checks code completion work correctly.
Setup:
Create Web or JavaApplication project and JavaScript file from template
- completion for JavaScript Core Objects
- This document contains all JavaScript Core Objects.
- Enter first letter of any Core Object and press CTRL+space to invoke code completion.
- EXPECTED RESULT: The code completion works and offers desired code.
- Completion for local function.
-
Create JavaScript function
-
- EXPECTED RESULT: Press Ctrl+space the function should be offers as one of suggested items.
- completion for local variable
- creat local variable
- Press Ctrl+space to invoke code completion.
- EXPECTED RESULT:
Press Ctrl+space the variable should be offers as one of suggested items.
- completion for predefined functions
-
This document contains all predefined global JavaScript functions.
-
Type first letter of any of predefined functions.
- EXPECTED RESULT:
The functions should be offer as one of offered items.
- completion for keywords
-
This document contains all JavaScript keywords.
-
Type first letter of any of keywords
- EXPECTED RESULT:
The keywords should be offer as one of offered items.
- Completion for methods
-
declare variable for example : var mydate =new Date();
-
type variable follow by dot and press Ctrl+Space: mydate.|
- EXPECTED RESULT:
The code completion shoud offers list wich include all methods of all core object, for example method charAt().
Test suite: Navigator
Purpose:
This test suite checks that JavaScript navigator works correctly.
Setup: No preparation is necessary for this test suite.
- new variable
-
Create new variable for example: var myvar=new Date();
- EXPECTED RESULT: declared variable should be visible in vavigator pane
- function
-
Declare functions with argument and without arguments.
- EXPECTED RESULT:
Declared functions should be visible in navigation pane, if contains arguments, these arguments should be also visible.
- new variable
-
Create new variable for example: var myvar=new Date();
- EXPECTED RESULT: declared variable should be visible in vavigator pane
- to desired function or variable
-
Click right on variable of function in navigation pane.
- EXPECTED RESULT:
YOu should be redirect to desired function or variable.
Test suite: Code Folding
Purpose:
This test suite checks that Code Folding for JavaScript works correctly.
Setup: Create JavaScript file from template.
- Folding for functions.
-
Declare functions.
- EXPECTED RESULT: Folds should me available and must be collapsed and expanded in adequate way for each action.
- folding for comments
-
Declare comments which occupy more than one line.
- EXPECTED RESULT:
Folds should me available and must be collapsed and expanded in adequate way for each action.
Test suite: Embedded javascript in html documents
Purpose:
This test suite checks that editing html document with js works fine.
Setup: Open html document.
- if embedded js is recognize properly and all features works
-
Paste this document into html editor - it contains embedded js between <script> tags.
- EXPECTED RESULT: Javascript should be recognize : cc, coloring, code folding etc. should work properly.
-
Paste this document document into html editor.
- EXPECTED RESULT: Javascript inside <!-- //--> should be interpreted properly and all js features should work.
-
Paste below document into html document, it contains valid embedded js.
- EXPECTED RESULT: Javascript inside <!-- //--> should be interpreted properly and all js features should work.
- cc from event handler inside html document
-
Paste this document and try to invok cc, the pipe represent position of cursor
- EXPECTED RESULT:
CC is invoked properly.
Test suite: Syntax Checking
Purpose:
This test suite checks that Syntax Checking for JavaScript works correctly.
Setup: Create JavaScript file from template.
- Checking - invalid identifiers
- Type some invalid JavaScript identifier.
- EXPECTED RESULT: The expression should be underscored.
- Checking - invalid numbers.
- Type invalid number.
- EXPECTED RESULT: The invalid number should be underscored.
- unresolved variables.
- Use some variable which has't been declared.
- EXPECTED RESULT: Such variable should be underscored.
- Checking- legal number
- Type some expression which uses legal number.
- EXPECTED RESULT: Such expression should't not be underscore.
- Checking- comments
- Type some comments using "//" as well as "/* **/" .
- Try to invoke cc inside comments area.
- EXPECTED RESULT: All text inside comments should have different color, and cc shoul give noe results.
- Checking- invalid literals
- Declare variable and assign invalid javascript literal
- EXPECTED RESULT: Regural font should be used to drawn such invalid literal
- Checking- valid literal
- Type some expresion with uses valid javascript literal
- EXPECTED RESULT: Such valid litera should be bolded
- Checking- Regural Expression
- Type some valid javascript regural expression
- EXPECTED RESULT: such regural expression should have different color
Test suite: Code Refactoring
Purpose:
This test suite checks that Code Refactoring works correctly.
Setup: Create JavaScript file from template.
- functions and variables.
- Click left on variable or functions
- Form context menu choose Refactor | Rename
- Rename function or variable
- EXPECTED RESULT: All ocurances of variable should be renamed.
Generated: Fri Dec 22 13:11:21 CET 2006