SCAutolib.cli_commands
Implementation of CLI commands for SCAutolib.
This module defines the command-line interface (CLI) for the scauto
tool, utilizing the click library. It provides a
user-friendly interface for system preparation, CA configuration, user setup
with smart cards, and cleanup operations. Additionally,
it includes a specialized command group for automated GUI testing.
Functions
- check_conf_path(conf)[source]
Validates and resolves the path to the JSON configuration file.
- Parameters:
conf (str) – The path string to the configuration file.
- Returns:
A resolved
Pathobject if the file exists.- Return type:
- Raises:
click.BadParameter – If the path does not exist.
- run_all(ctx, actions, install_missing)[source]
Executes all chained GUI test actions in the order they were provided on the command line. It initializes the graphical environment and performs specified GUI automation steps.
- Parameters:
ctx (click.Context) – The Click context object.
actions (list of str) – A list of strings, where each string is a representation of a GUI test action to be performed (e.g., “init”, “assert_text:ExpectedText”).
install_missing (bool) – A boolean flag indicating whether any missing packages required for the graphical setup should be installed prior to running the GUI actions.
- Returns:
This function does not explicitly return a value. It executes the GUI test workflow.
- Return type:
None
Classes
- class NaturalOrderGroup(name=None, commands=None, **attrs)[source]
A custom
click.Groupsubclass that ensures subcommands are listed in the help output in the order they were defined in the code. This overridesclick’s default alphabetical sorting for subcommands.Initializes the NaturalOrderGroup, ensuring the commands dictionary is an
OrderedDictto maintain insertion order.- Parameters: