Text Mode
CukeTest provides two methods for editing Feature files: Text Mode and Visual Mode. This section focuses on Text Mode.
What is Text Mode?
Text Mode provides a plain-text-based code editing interface. When switching from Visual Mode back to Text Mode, the content is restored to the raw Gherkin syntax.
Use Cases for Text Mode
Text Mode is ideal for the following scenarios:
- When you need to copy, paste, or modify large sections of scripts.
- When you need to use
Ctrl + Hfor batch find and replace operations. - When you are accustomed to using keyboard shortcuts for efficient editing.
Features of Text Mode
CukeTest provides several intelligent auxiliary tools for Text Mode to enhance editing efficiency and accuracy.
1. IntelliSense
During the editing process, CukeTest automatically pops up Cucumber keyword suggestions based on your input.
- For example, when you type the letter
F, the system suggestsFeature, which you can auto-complete by pressing Enter.
2. Real-time Syntax Diagnostics
Text Mode checks Gherkin syntax in real-time as you edit, displaying error icons or red squiggly lines to the left of line numbers to precisely locate syntax issues.
Common syntax errors include:
- Punctuation Errors: For example, missing mandatory spaces after keywords. The correct format is: the keyword followed by a colon (
:) and at least one space. - Hierarchical Structure Errors: For example, writing steps directly without declaring a
Scenario.
Tip
Syntax Note: In Gherkin syntax, a space must follow keywords (e.g., Given, When, Then).
Warning
Attention: Syntax Lock
If the current text contains syntax errors (indicated by red highlights), the system will restrict switching to Visual Mode.
Before switching, CukeTest performs syntax validation. Users must fix all syntax issues that cause parsing failures. Once the error indicators disappear, you can switch back to Visual Mode.