This Visual Studio Code extension provides comprehensive support for the Tally Robot Script scripting language, specifically designed for automated testing of Tally software. The extension includes features such as autocomplete, hover information, error diagnostics, and custom commands to streamline script creation, formatting and ensure efficiency and accuracy.
Features
- Context aware autocomplete
- Code Snippets and hover information
- Template scripts
- Search in map files
- Open map file
- Syntax highlighting for Tally Robot scripts
- Formatting for Tally Robot scripts
- Syntax highlighting for map files
- Error detection
- Run scripts directly via Visual Studio Code (powered by Tally Robo 2.0)
Context Aware Autocomplete
Receive smart autocomplete recommendations while you type, tailored to the context of various parameters such as the active map file library, the map file in use, and the current map name.
Template Scripts
If your team often utilizes a specific script pattern or style, you can now designate that script as a template by commiting it in the code.robotscript/templates/ directory. After this is completed, team members will be able to use the "Insert Template Script" autocomplete feature in the editor, allowing for quick insertion of the template script and enhancing efficiency.
Search In Map Files
You can conveniently search for key sequences, report names, or keywords within the map files of the active maps library by selecting the "Search In Map Files" option from the context menu (right-click in the editor). Additionally, the "Search In Map Files" command is accessible through the command palette (Ctrl+Shift+P).
Tips:
To search for a keyword within the editor, highlight it with the cursor, right-click to access the context menu, and choose the "Search In Map Files" option to locate that keyword in the map files.
You can press Enter to choose any result from the search results list and insert it into your script in the appropriate format.
Open Map File
Access any map file from the current maps library swiftly by selecting the "Open Map File" option in the context menu (right-click within the editor). You can also utilize the "Open Map File" command from the command palette (Ctrl+Shift+P).
Tips:
- To open a map file name that is currently displayed in the editor, you can easily highlight it with your cursor, right-click to access the context menu, and choose the "Open Map File" option for a quick access to that map file.
This extension includes a custom formatter specifically designed for Tally Robot Scripts, allowing you to enhance and beautify your scripts with a single click. To format your script, right-click within the script area to access the context menu and choose the format document option. Upon your initial formatting attempt, you may encounter a popup indicating that no default formatter has been established for Tally Robot Scripts. If this occurs, just click on the "Configure" or "Select Formatter" option in the popup and choose the tallyrobotscript formatter from the dropdown menu.
Compilation and Error Detection
Compile your scripts to detect all errors at once, thus avoiding the tedious process of running the script, facing errors, correcting them, and re-executing it to pinpoint individual issues. Furthermore, obtain valuable suggestions for possible solutions to tackle each identified problem. To compile your script, right-click within the script and choose the "Compile Robot Script" option from the context menu. You can also utilize the "Compile Robot Script" button located on the top bar or editor title bar.
Script Execution
Run your scripts effortlessly with a single click in one of the two available modes, powered by Tally Robo 2.0. The base generation mode allows for the rapid creation of a local base complete with test case screenshots, while the custom config mode launches the Tally Robo 2.0 GUI, enabling you to tailor all execution parameters to meet your specific needs prior to script execution.
You can initiate your script using either the buttons on the top bar/editor title bar or by selecting the execute commands from the context menu (right-click) within the active editor.
FAQ (Frequently Asked Questions)
1. How to know/check which maps library is currently in use for providing the autocomplete suggestions?
The most straightforward method to identify the active map file library is to check the maps library indicator located on the right side of the status bar (the bottom bar in Visual Studio Code). For instance, if the indicator displays Release_6.0, it indicates that the map files from code.robotscript/Release_6.0/lib.maps (on your local machine) are currently utilized for autocomplete functionality.
When dealing with a script file from the code.robotscript repository, the extension automatically adjusts the maps library based on the context. For instance, if you access the script located at code.robotscript/Release_6.0/User_Sagar/testscript.txt, the extension recognizes it as a script within Release_6.0 and subsequently changes the maps library to code.robotscript/Release_6.0/lib.maps.
If a script is located outside the code.robotscript repository, the extension will continue to utilize the currently employed maps library unless the user explicitly modifies this setting.
In cases where the automatic switching of maps libraries does not function correctly, defaults to an incorrect library, or if the user prefers to manually select a maps library, the user has the option to utilize the "Change Maps Library Directory Path" feature found in the context menu (right-click) of the editor. Additionally, the user can simply click on the maps library status bar indicator and choose the preferred maps library from the dropdown menu.
2. Automatic maps library switching is not working properly for me. What to do?
This issue may arise from the local code.robotscript repository path not being configured correctly in the extension settings. Initially, when you run the extension for the first time, you will receive a prompt to specify the code.robotscript path on your system. However, if you inadvertently closed that prompt or if the path has changed since then, you can manually update it by selecting the "Change code.robotscript Path" option in the editor's context menu (right-click). Alternatively, you can also access this option through the Visual Studio Code command palette (Ctrl+Shift+P).
3. I have opened a Tally Robot Script(.txt) file but I am not at all getting any syntax highlighting or autocomplete features. What could be the issue?
Visual Studio Code may be identifying the file with a .txt extension as a standard text file rather than a Tally Robot Script file. To resolve this issue, you can manually adjust the file's language setting from the status bar at the bottom of Visual Studio Code to Tally Robot Script. Another option is to utilize the "Change Language Mode" command available in the command palette (Ctrl+Shift+P) to modify the file's language.
4. I get errors when trying to execute my script via Visual Studio Code. What should I do?
Ensure that the Tally Robo 2.0 path is correctly configured in the extension settings. Initially, when you attempt to run a script for the first time, a prompt will appear asking you to specify the Tally Robo 2.0 executable path on your system. If you inadvertently closed that prompt or if the executable path has changed, you can manually update the path by selecting the "Change Tally Robo 2.0 Executable Path" option from the editor's context menu (right-click). Alternatively, this can also be accomplished through the Visual Studio Code command palette (Ctrl+Shift+P).
5. I find myself using certain commands often and want to add keyboard shortcuts for them. Is it possible?
Visual Studio Code provides users with the ability to create custom keybindings for nearly any command or action within the editor. To access the keyboard shortcuts interface, you can open the command palette by pressing Ctrl+Shift+P and selecting "Preferences: Open Keyboard Shortcuts." In this section, you can search for the desired command and customize its shortcut according to your preferences.