TS 65 JavaScript

JavaScript Editor Test Specification

Author: Martin Schovanek
Version: 1.00
Last update: 04.01.2008
Introduction: This document contains procedures for testing JavaScript editor.

Documentation:

Comments:

Contents


Author: Martin Schovanek
Version: 1.00
Last update: 04.01.2008
Introduction: This document contains procedures for testing JavaScript editor.

Documentation:


Comments:


Test suite: New File Templates

Purpose: new .js files creation test
Setup: Create a new Web project

  1. New File Wizard
    1. right click *Web Pages* node and choose: New > Other
    2. choose 'Web > JavaScript file' or 'Other > JavaScript file'
    3. finish the wizard
    • EXPECTED RESULT: a new almost ampty .js file is created under *Web Pages* node and is opened in the editor.


Test suite: Basic Editor Features

Purpose: Basic Editor Features test
Setup: Create a new .js document

  1. Syntax highlighting
    1. copy / paste Sample JavaScript into the new .js
    • EXPECTED RESULT: The Code Coloring corresponds to the Sample and UI Specification.
  2. Code Folding
    1. open an existing .js docment
    • EXPECTED RESULT: Code Foldes should be created for all methods and comments. The folds shoud loook like and behave as is described at Code Folding Specification.
  3. Navigator
    1. ToDo ...
  4. Background parser
    1. ToDo ...
  5. Bracket matching
    1. ToDo ...
  6. Formatting
    1. ToDo ...


Test suite: JSON support

Purpose: JSON support test
Setup: Create a new Web project

  1. New File Wizard
    1. ToDo ...
  2. Syntax Highlighting
    1. ToDo ...
  3. Code completion
    1. ToDo ...



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 Code 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.
  1. }}Code Completion for local function.}}
                Create JavaScript function
               


    • EXPECTED RESULT: Press Ctrl+space the function should be offers as one of suggested items.
  1. }}Code 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.   
 
  1. Code 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.
  1. Code 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.
                


  1. }}Code 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.

  1. }}Create new variable}}
                   Create new variable for example: var myvar=new Date();
               
    • EXPECTED RESULT: declared variable should be visible in navigator pane
  1. }}declaring 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.
  1. Create new variable}}
                   Create new variable for example: var myvar=new Date();
               
    • EXPECTED RESULT: declared variable should be visible in navigator pane
  1. }}navigating 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.

  1. }}Code Folding for functions.}}
                   Declare functions.
               
    • EXPECTED RESULT: Folds should me available and must be collapsed and expanded in adequate way for each action.
  1. }}Code 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.

  1. }}Checking 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.


  1. }}Invoking cc from event handler inside html document}}
                   Paste this  document  and try to invoke 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. }}Syntax Checking - invalid identifiers}}
    1. Type some invalid JavaScript identifier.
    • EXPECTED RESULT: The expression should be underscored.
  1. }}Syntax Checking - invalid numbers.}}
    1. Type invalid number.
    • EXPECTED RESULT: The invalid number should be underscored.
  1. }}Marking unresolved variables.}}
    1. Use some variable which has't been declared.
    • EXPECTED RESULT: Such variable should be underscored.
  1. }}Syntax Checking- legal number}}
    1. Type some expression which uses legal number.
    • EXPECTED RESULT: Such expression should't not be underscore.
  1. }}Syntax 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.
  1. }}Syntax Checking- invalid literals}}
    1. Declare variable and assign invalid javascript literal
    • EXPECTED RESULT: Regural font should be used to drawn such invalid literal
  1. }}Syntax Checking- valid literal}}
    1. Type some expresion with uses valid javascript literal
    • EXPECTED RESULT: Such valid litera should be bolded
  1. }}Syntax 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. }}Renaming 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

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