JavaScript Editor Basic Acceptance Tests

From Aptana Development

Contents

General

Remember to do the basic general tests for every editor in addition to doing the following editor-specific tests

Content Assist

  1. While testing, select different browser/user agents. This should reflect in the list of items presented in the popup dialogs

Static content assist

Content assist should be available for all predefined browser objects and JSCore "classes"

  1. JSCore library objects and functions
    1. Math, Boolean, Date, Error, Function, Number, RegExp, String (Array and Object do not currently appear due to a filed Trac item)
  2. Browser objects
    1. document object
      1. Verify getElementById is in the list and that you get documentation and argument insight when pressing '('
    2. window object

Global Content Assist

Ctrl+Space in an empty location inside a code block should trigger insight on globals

  1. String objects should not display
  2. a[Ctrl+Space] should trigger a list of all globals that start with 'a'
  3. aler[Ctrl+Space] should show alert() selected in content assist
  4. global methods should not appear in content assist list for:
    1. Quoted string objects: "foo"[.]
    2. window object: window[.]

Ctrl + Shift + Space should trigger argument insight inside the () of a function call.

Documentation/Comment Editing

Comment Completion

  1. Use /*[Enter] to trigger a comment auto-completion at the beginning of a file
  2. Use /*[Enter] to trigger a comment auto-completion in the middle of a file
  3. Use /*[Enter] to trigger a comment auto-completion at the end of a file

Documentation Completion

  1. Use /**[Enter] to trigger a JSDoc auto-completion at the beginning of an empty file
  2. Use /**[Enter] to trigger a JSDoc auto-completion at the end of a file
  3. Use /**[Enter] to trigger a JSDoc auto-completion before a function with no args
  4. Use /**[Enter] to trigger a JSDoc auto-completion before a function with 1 arg
  5. Use /**[Enter] to trigger a JSDoc auto-completion before a function with 4 args
  6. Use /**[Enter] to trigger a JSDoc auto-completion inside of a function [error condition]
  7. Use /**[Enter] to trigger a JSDoc auto-completion before any code block other than a function[error condition]

General

  1. Verify that static functions are not available on objects
    1. String objects should not display the fromCharCode() method
  2. Verify that the content assist window is triggered when
    1. using the . operator on an identifier
    2. using the . operator on a function return value
    3. using the [Ctrl+Space] key combo
  3. Verify the content assist "information window" is populated with docs about the function selected in the content assist window.

Bracket Insertion/Auto-typing

  1. Verify typing a '(', '{', '[', ', or " auto-inserts a matching character. It will only do so in "logical" places.
  2. Verify typing the "Enter" key in between {} will move the cursor down one line, auto indent it, and move the trailing brace to the beginning of the next line.
  3. Type "function foo(name, value)". When typing ')', it should de-select content assist.

Formatting

  1. To ship in M10. In m9, the key combination Ctrl + Shift + F should not do anything.

Colorization

  1. Type in the document and cut/paste content. Verify that no strange colorization appears

Folding

  1. Verify that you can fold ScriptDoc comment blocks
  2. Verify that you can fold a function
  3. Right-click in the gutter and choose Folding > Collapse All. Verify all functions are folded
  4. Right-click in the gutter and choose Folding > Expand All. Verify all functions are expanded

Validation

  1. Verify that typing errors in the main editor window results in validation errors appearing and disappearing in the validation view

Outline

  1. Create new Javascript file in the workspace.
  2. Type function declaration.
  3. Ensure that it is shown in outline view.
  4. Create new HTML file in the workspace.
  5. Type script tag with src attribute targeted to created javascript file using relative path.
  6. Expand script tag in outline, it should contain function declared in javascript file
  7. Modify src attribute to value pointing to unexisting file, outline should contain warning now
  8. Modify src attribute to value pointing to first js file,but use project relative path now. Outline should contain function declared in javascript file
  9. Modify src attribute to value pointing to first js file,but use project relative path now. Outline should contain function declared in javascript file
  10. Rename function declared in javasript file and switch back to html editor, outline should be updated also
  11. Select function declared in javascript file in outline of HTML editor.
  12. Press open declaration button on outline toolbar, js editor should be activated and function declaration should be revealed.

Links

  1. IDE Core Basic Acceptance Tests
  2. Main Testing Section