TS 60 JavaScript editor

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:

Contents


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