TS 61 JavaScript

JavaScript Editor Test Specification

Author: Martin Schovanek, updates [vriha@netbeans.org Lada Riha]
Version: 1.00
Last update: 04.01.2008
Introduction: This document contains procedures for testing JavaScript editor.

Documentation:

Comments:

ToDo:

Contents


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: appropriate file is created in given location and it 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 the media:Coloring_TS_61_JavaScript.js into the document and check the syntax highlighting.
    • EXPECTED RESULT:
Image:js_coloring_TS_61_JavaScript.png 
  1. Code folding
    1. download and open prototype.js file in the editor
    2. call View|Code Folds|Collapse All
    3. move mouse cursor over folded method and see hidden code
    4. call View|Code Folds|Expand All and check all is expanded
    5. collapse or expand fold in editor clicking plus or minus sign
    • EXPECTED RESULT: all actions are performed correctly
  2. Navigator
    1. prototype.js file is opened in editor
    2. open navigator (ctrl + 7 or Window|Navigating|Navigator)
    3. try to use all filters (show fields, class methods and variables, non public members)
    4. navigate by clicking on elements (classes, methods, variables) in navigator
    5. right click on navigator and call Sort by Name or Sort by Source
    6. check items are sorted accordingly
    • EXPECTED RESULT: all actions were performed correctly
  3. Bracket matching
    1. check that editor automatically highlights matching parentheses, braces, brackets, string delimiters, regular expression delimiters, etc.
    2. type ( , automaticaly () is written, if you type closing ) , it removes the previous )
    3. that works for { too - issue 195515
    • EXPECTED RESULT: worked as discribed
  4. Formatting
    1. open prototype.js or any other .js file
    2. break formatting as you wish (e.g. press CTRL+A and then Shift+Tab several times)
    3. call Format context menu in editor (Alt+Shift+F)
    • EXPECTED RESULT: code is formatted.


Test suite: JSON support

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

  1. New File Wizard
    1. right click *Web Pages* node and choose: New > Other
    2. choose 'Web > JSON file' or 'Other > JSON file'
    3. finish the wizard
    • EXPECTED RESULT: appropriate file is created in given location and it is opened in the editor.
  2. Syntax Highlighting
    1. Copy/Paste the media:Coloring_TS_61_JavaScript.json into the document and check the syntax highlighting.
    • EXPECTED RESULT:
    • Image:json_coloring_TS_61_JavaScript.png


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.
    1. 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
    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.
  1. Code 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. Code 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. Create new variable
    1. Create new variable for example: var myvar=new Date();
    • EXPECTED RESULT: declared variable should be visible in navigator pane
  2. declaring 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.
  3. Create new variable
    1. Create new variable for example: var myvar=new Date();
    • EXPECTED RESULT: declared variable should be visible in navigator pane
  4. navigating 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. Code Folding for functions.
    1. Declare functions.
    • EXPECTED RESULT: Folds should be available and must be collapsed and expanded in adequate way for each action.
  2. Code folding for comments
    1. At the top of the file, declare comments which occupy more than two line.
    2. Not working in 7.1.1 but works in 7.2 trunk
    • EXPECTED RESULT: Folds should be 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
    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 into html editor.
    • EXPECTED RESULT: Javascript inside should be interpreted properly and all js features should work.
  2. Invoking cc from event handler inside html document
    1. 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.
  2. Syntax Checking - invalid numbers.
    1. Type invalid number.
    • EXPECTED RESULT: The invalid number should be underscored.
  3. Marking unresolved variables.
    1. Use some variable which has't been declared.
    • EXPECTED RESULT: Such variable should be underscored.
  4. Syntax Checking- legal number
    1. Type some expression which uses legal number.
    • EXPECTED RESULT: Such expression should't not be underscore.
  5. Syntax Checking- comments
    1. Type some comments using "//" as well as "/* **/" . - issue 195516
    2. Try to invoke cc inside comments area.
    • EXPECTED RESULT: All text inside comments should have different color, and cc shoul give no results.
  6. Syntax Checking- invalid literals
    1. Declare variable and assign invalid javascript literal - issue 195517
    • EXPECTED RESULT: Regural font should be used to drawn such invalid literal
  7. Syntax Checking- valid literal
    1. Type some expresion with uses valid javascript literal - see issue 195519
    • EXPECTED RESULT: Such valid litera should be bolded
  8. 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