Skip to main content

Command Line Interface (CLI)

The SuuprTests workflow relies on a standalone companion package: the SuuprTests CLI (suupr_tests_cli). This command line interface allows you to execute your exported test cases directly from your terminal, making it perfect for CI/CD pipelines and rapid local verification.

Installation​

Because the CLI is distributed as a separate toolkit from the core suupr_tests library, you need to install it globally using the Dart package manager. Ensure your Dart/Flutter environment is properly set up in your terminal.

dart pub global activate suupr_tests_cli

Path Configuration​

After activation, you must ensure that the Dart global binaries directory is in your system's PATH. If you encounter a command not found: suupr_tests_cli error, add the following to your shell configuration file (e.g., ~/.zshrc or ~/.bash_profile):

export PATH="$PATH":"$HOME/.pub-cache/bin"

Once configured and activated, you will have access to the suupr_tests_cli command across your machine.

Running Tests​

To run your automated tests using the CLI, you must have the JSON file containing your exported test case. This JSON file holds all the serialized orchestration steps.

The run Command​

Use the run command to execute a test suite. You must provide the path to your Flutter application and the path to the JSON test file.

suupr_tests_cli run --app-path . --device-id macos path/to/your/login_test_case.json

Available Options:​

OptionAliasDescription
--app-path-aRequired. The root directory of the Flutter app under test.
--device-id-dThe target device ID (e.g., macos, chrome, ios, or an emulator ID).
--recursive-rFind test files recursively if a directory is provided (defaults to true).
--help-hShow usage information.

Sample Output​

When executed, the CLI launches the target application, connects to the VM Service, and performs the steps sequentially:

$ suupr_tests_cli run --app-path . --device-id macos login_test_case.json

🚀 Ready to run: 1 suites detected.

✅ App Connected and Ready!

📦 Suite: User Login Flow (3 steps)
STEP 1: Enter text "user@suuprtests.dev" into textField [key: email_field] ✅ PASSED
STEP 2: Enter text "**********" into textField [key: password_field] ....... ✅ PASSED
STEP 3: Tap button [key: login_button] .................................... ✅ PASSED

----------------------------------------------------------------------
🏁 FINAL EXECUTION SUMMARY:
📂 Suites: 1 Passed, 0 Failed
📝 Steps: 3 Passed, 0 Failed, 0 Skipped
----------------------------------------------------------------------
🏁 Result: 🎉 ALL PASSED

Continuous Integration (CI/CD)​

The CLI consumes standard JSON artifacts and outputs standard exit codes (0 for success, 1 for failures). This makes it extremely simple to drop suupr_tests_cli into environments like GitHub Actions, GitLab CI, or Bitrise.