[RSS]

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
  1. Use New File | Scripting | Empty JavaScript File... to create new JavaScript file.
  2. Paste content of this file into editor, this document contains all JavaScript keywords.
  3. 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
  1. completion for JavaScript Core Objects
    1. This document contains all JavaScript Core Objects.
    2. 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.
  2. Completion for local function.
    1. Create JavaScript function
    • EXPECTED RESULT: Press Ctrl+space the function should be offers as one of suggested items.
  3. completion for local variable
    1. creat local variable
    2. Press Ctrl+space to invoke code completion.
    • EXPECTED RESULT: Press Ctrl+space the variable should be offers as one of suggested items.
  4. completion for predefined functions
    1. This document contains all predefined global JavaScript functions.
    2. Type first letter of any of predefined functions.
    • EXPECTED RESULT: The functions should be offer as one of offered items.
  5. completion for keywords
    1. This document contains all JavaScript keywords.
    2. Type first letter of any of keywords
    • EXPECTED RESULT: The keywords should be offer as one of offered items.

  1. Completion for methods
    1. declare variable for example : var mydate =new Date();
    2. 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.
  1. new variable
    1. Create new variable for example: var myvar=new Date();
    • EXPECTED RESULT: declared variable should be visible in vavigator pane
  2. function
    1. 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.
  1. new variable
    1. Create new variable for example: var myvar=new Date();
    • EXPECTED RESULT: declared variable should be visible in vavigator pane
  2. to desired function or variable
    1. 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.
  1. Folding for functions.
    1. Declare functions.
    • EXPECTED RESULT: Folds should me available and must be collapsed and expanded in adequate way for each action.
  2. folding for comments
    1. 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.
  1. if embedded js is recognize properly and all features works
    1. 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.
    1. Paste this document document into html editor.
    • EXPECTED RESULT: Javascript inside <!-- //--> should be interpreted properly and all js features should work.
    1. 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.

  1. cc from event handler inside html document
    1. 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.
  1. Checking - invalid identifiers
    1. Type some invalid JavaScript identifier.
    • EXPECTED RESULT: The expression should be underscored.
  1. Checking - invalid numbers.
    1. Type invalid number.
    • EXPECTED RESULT: The invalid number should be underscored.
  1. unresolved variables.
    1. Use some variable which has't been declared.
    • EXPECTED RESULT: Such variable should be underscored.
  2. Checking- legal number
    1. Type some expression which uses legal number.
    • EXPECTED RESULT: Such expression should't not be underscore.
  3. Checking- comments
    1. Type some comments using "//" as well as "/* **/" .
    2. Try to invoke cc inside comments area.
    • EXPECTED RESULT: All text inside comments should have different color, and cc shoul give noe results.
  4. Checking- invalid literals
    1. Declare variable and assign invalid javascript literal
    • EXPECTED RESULT: Regural font should be used to drawn such invalid literal
  1. Checking- valid literal
    1. Type some expresion with uses valid javascript literal
    • EXPECTED RESULT: Such valid litera should be bolded
  2. Checking- Regural Expression
    1. 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.
  1. functions and variables.
    1. Click left on variable or functions
    2. Form context menu choose Refactor | Rename
    3. Rename function or variable
    • EXPECTED RESULT: All ocurances of variable should be renamed.

Generated: Fri Dec 22 13:11:21 CET 2006