This utility is under construction as of Oct 2024 and this line will be deleted when it's ready for prime time.
ftoc
(Feature-File Table of Contents) is a utility that tells you things about your Cucumber feature files.
It should work with all Cucumber text files (Java, Javascript, Karate framework).
It tries to produce:
- A Table of Contents (TOC) of all scenarios and scenario outlines you point it to
- A concordance (count of groups) of all tags used across feature files
- Warnings for missing tags or use of generic "dumb" tags like [debug, test, sanity, stage] or other overloaded words
... in order to show you useful information about existing tests. I've scripted variants of this utility across several consulting engagements and figured I'd produce a formal open source version.
To build the ftoc
utility:
-
Clone the repository:
git clone https://github.com/heymumford/ftoc.git cd ftoc
-
Build the project using Maven:
mvn clean package
This will create a JAR file in the target
directory named ftoc-<version>-jar-with-dependencies.jar
.
After building the project, you can run ftoc
as follows:
java -jar target/ftoc-<version>-jar-with-dependencies.jar [OPTIONS]
Replace <version>
with the current version number of the utility.
-d <directory>
: Specify the directory to analyze (default: current directory)--version
or-v
: Display version information--help
: Display help message
-
Display version information:
java -jar target/ftoc-<version>-jar-with-dependencies.jar --version
-
Analyze feature files in a specific directory:
java -jar target/ftoc-<version>-jar-with-dependencies.jar -d /path/to/feature/files
-
Display help information:
java -jar target/ftoc-<version>-jar-with-dependencies.jar --help
To use ftoc
in your Java project:
-
Build the
ftoc
project as described above. -
Add the generated JAR file to your project's classpath.
-
You can then use the
FtocUtility
class in your code:import com.heymumford.ftoc.FtocUtility; public class YourClass { public void runFtoc() { FtocUtility ftoc = new FtocUtility(); ftoc.initialize(); ftoc.processDirectory("/path/to/feature/files"); } }
If you'd like to contribute to ftoc
or need support, please open an issue or submit a pull request on GitHub.
ftoc
is open-source and available under the MIT license. See the LICENSE file for more details.