Editor

The Editor view is shown in all perspectives.

{}

The Editor view

The Editor view's editors show line numbers and color syntax highlighting appropriate for the scripting language being used. In addition, each editor is language-savvy and provides automatic indentation and other language-specific convenience features.

You can select these features in the Pref­er­ences dialog, where each supported scripting language has its own pane with an Editor entry. In addition, you can set general editing settings that apply to every scripting language, unless overridden, in General > Editors > Text Editors.

Hover the mouse over an Editor view tab to show the full path to the file in the view.

Right-click the line numbers or the editor's text area to open context menus. The options that are available depend on the scripting language being used. Options that are not available in the current context are grayed. Some options that are inherited from the Eclipse IDE are not functional in the Squish IDE.

Making code data driven

Select the Make Code Data Driven option in the text area context menu to insert a loop that accesses every field in a test data file. The option is only available if there is a test data file available to the test script.

Make sure the cursor is on an empty line where you want the code to be inserted. Then choose Make Code Data Driven to open a Refactoring wizard that lists the available test data files. Click the one to use, and then click the Next button.

The wizard shows the test script's current code and the code you'll have:

"Refactoring wizard"

Click the Finish button to insert the code.

You can Undo the changes, if necessary.

Replacing with testData field

Select the Replace With TestData Field option in the text area context menu to insert a call to the String testData.field(record, fieldName) function to access a data item from a record in a test data file. The option is only available if there is a test data file available to the test script.

Make sure the cursor is where you want the code to be inserted. For example, to the right of an assignment such as averagingTime =. Then choose Replace With TestData Field and pick a submenu option. These options correspond to the fields that are available in the current test data.

The Refactoring wizard opens. It shows the test script's current code and the code you'll have if you click the Finish button. You can Undo the changes, if necessary.

So, if the code was averagingTime =, it has now become averagingTime = testData.field(record, "Averaging Time").

However, it may be more convenient to use the Make Code Data Driven menu option and then copy and paste any String testData.field(record, fieldName) function calls that you need.

Line number context menu

Right-click the line numbers in an editor to open a context menu that contains a subset of the following options, depending on the scripting language:

LanguagesContext Menu Option NameKeyboard ShortcutAction
JavaScript, Perl, Ruby, TclToggle BreakpointDouble ClickAdds or removes a breakpoint.
PythonAdd BreakpointDouble ClickAdds a breakpoint.
PythonRemove BreakpointDouble ClickRemoves a breakpoint.
AllDisable BreakpointShift+Double ClickDisables the breakpoint at the current line.
AllEnable BreakpointEnables the breakpoint at the current line.
AllRun related Test CaseCtrl+Alt+ERuns the test case related to the open file.
JavaScript, PythonAdd BookmarkAdds a bookmark.
JavaScript, PythonAdd TaskAdds a comment.
AllShow Quick DiffThis context menu option is currently not functional in the Squish IDE.
AllShow Line NumbersShows line numbers in the editor.
AllFoldingInstead of showing the entire test script, only shows the first line of each function, block, or comment. This makes it easier to see a script's overall structure. To expand or collapse individual function entries, click the or icons, or expand or collapse everything using the menu options.
AllPreferencesOpens the Pref­er­ences dialog Editor tab for the scripting language being used.
AllBreakpoint PropertiesThis item is only enabled if the current line has a breakpoint, in which case it opens a Properties dialog, where you can make the breakpoint more sophisticated rather than always stopping the script unconditionally.

Folding menu

Click Folding in the line number context menu to select the following options:

Submenu Option NameKeyboard ShortcutAction
Enable FoldingCtrl+/ on the numeric keypadEnables or disables folding.
Expand AllCtrl+* on the numeric keypadExpands all folded items.
Collapse AllShift+Ctrl+/ on the numeric keypadCollapses all unfolded foldable items.
Reset StructureShift+Ctrl+* on the numeric keypadExpands all folded items and reevaluates the file's folding structure.
Collapse BlocksFolds all foldable blocks that aren't functions.
Collapse CommentsFolds all foldable comments.

Text area context menu

Right-click the editor text area to open a context menu that contains a subset of the following options, depending on the scripting language:

LanguagesContext Menu Option NameKeyboard ShortcutAction
AllUndoUndoes the last action.
AllRevert FileRestores the editor's contents to last saved. Alternatively, you can repeatedly select Undo.
AllSaveSaves any unsaved changes in the active editor.
AllOpen DeclarationThis menu option is not functional in the Squish IDE.
JavaScript, Python, TclOpen Type HierarchyF4Shows the class hierarchy (super- and sub-classes) of the class of the item under the cursor. This is only functional for scripting languages and classes for which the Squish IDE has the appropriate information.
JavaScript, TclOpen Call HierarchyCtrl+Alt+HOpens the Call Hierarchy view, which shows a tree of the current function and the functions it calls. If invoked in the test script's main function, it shows the entire hierarchy of functions that the test script calls. If you choose a called function anywhere in the hierarchy, the view also shows the line number(s) where the function is called.
JavaScript, Python, TclQuick OutlineCtrl+OOpens a dialog that shows the file's structure. For example, its functions and global variables. If you navigate using the up and down arrow keys and press Enter on an item, the dialog closes and the editor shows the item you chose. Alternatively, press Esc to cancel. This is only functional for those scripting languages for which the Squish IDE has the appropriate information.
JavaScript, Python, TclQuick Type HierarchyCtrl+TShows a tree of the current function and the functions it calls. It is similar to the Open Type Hierarchy option, but uses a dialog rather than a view to present the information.
AllShow InShift+Alt+WThis menu option is not functional in the Squish IDE.
AllCutCopies the selected text to the clipboard and deletes it from the editor.
AllCopyCopies the selected text to the clipboard.
AllPastePastes the selected text from the clipboard to the editor.
PerlShift RightMoves the current line right two spaces.
PerlShift LeftMoves the current line left two spaces (if possible).
AllSourceThis menu option has a submenu with options shown in Source Menu. When an editor view is active, a Source menu appears in the menu bar. It has the same (or in some cases fewer) menu options as the context menu described here.
JavaScript, PerlRefactorAlt+Shift+TThis menu option has a single submenu option Extract Subroutine that functions only if some lines are selected. If you invoke Extract Subroutine, first it prompts you for a subroutine name, then it creates a subroutine with the given name that contains the selected lines, and finally it replaces the original lines with a call to the subroutine.
PerlPerldocIs intended to run perldoc but is not functional in the Squish IDE.
JavaScript, Python, TclSearchThis menu option is not functional in the Squish IDE. However, the menubar Search action provides search facilities.
TclPaste to TclConsoleThis menu option is not functional in the Squish IDE.
AllRun AsThis menu option is not functional in the Squish IDE.
AllDebug AsThis menu option is not functional in the Squish IDE.
AllTeamThis menu option is not functional in the Squish IDE.
AllCompare WithThis menu option is not functional in the Squish IDE.
AllReplace WithThis menu option is not functional in the Squish IDE.
AllRecord SnippetLaunches the AUT and begins recording a snippet into the active test case.
AllMake Code Data DrivenInserts a loop that accesses every field in a test data file.
AllReplace With TestData FieldInserts a call to the String testData.field(record, fieldName) function to access a data item from a record in a test data file.
AllPreferencesPops up the Pref­er­ences dialog showing the preferences for the current editor view's type (e.g., Python editor, Tcl editor, etc.)
AllInput MethodsThis menu option leads to a submenu of input method submenu options. These are useful for test engineers who are using non-Latin languages (e.g., those not using English or West European languages) and who wish to enter text in their own language

Source menu

Click Source in the editor text area context menu to to open a context menu that contains a subset of the following options, depending on the scripting language:

LanguagesSubmenu Option NameKeyboard ShortcutAction
JavaScriptAdd Block CommentShift+Ctrl+/Inserts /* before the selected text and */ after the selected text to comment out all the selected text.
JavaScriptRemove Block CommentShift+Ctrl+\Removes block comments (/* and */).
AllToggle CommentShift+Ctrl+C or Ctrl+/ in a Perl editorComments out the current line if it is not commented out or uncomments the current line if it is commented out.
JavaScript, Python, TclCommentComments out the current line.
JavaScript, Python, TclUncommentUncomments the current line.
JavaScript, PerlFormatShift+Ctrl+FReformats the editor's text—for example, tidying up the indentation.
JavaScriptFormat ElementHas the same effect as the Format submenu option.
JavaScriptCorrect IndentationCtrl+IFixes the indentation for the selected lines.
JavaScript, Python, TclShift LeftShifts the current line (or the selected lines) left by one indent width (often 4 spaces).
JavaScript, Python, TclShift RightShifts the current line (or the selected lines) right by one indent width (often 4 spaces).
PerlValidate SyntaxShift+F5This item is inherited from Eclipse and is redundant since the Squish IDE automatically highlights syntax errors in the left margin.
PerlPod::CheckerShift+Ctrl+DChecks any Perl POD (Plain Old Documentation) that is in the file and marks any problems.
PerlClear Pod::Checker MarkersClears any markers that you set by running the Pod::Checker.
PerlPerl::CriticShift+Ctrl+CRuns perlcritic on the file and marks any problems.
PerlClear Perl::Critic MarkersClears any markers that you set by running Perl::Critic.
PerlClear All EPIC MarkersClears all markers including Pod::Checker markers, Perl::Critic markers, and the Squish IDE's standard syntax error highlighting markers.

© 2024 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners.
The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation.
Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.

Search Results