opwire-testa
Testing toolkit for building opwire-agent modules
Usage
Download opwire-testa
To download the latest opwire-testa on Linux/macOS/BSD systems, run:
curl https://opwire.org/opwire-testa/install.sh | bash
For other systems:
- Download the relevant
opwire-testa release,
- Extract the
opwire-testa or opwire-testa.exe binary from the archive to project home folder (current directory).
Executing tests
Command line syntax
./opwire-testa run \
--test-dirs=... \
--test-dirs=... \
--incl-files=file-name-pattern-or-regexp \
--excl-files=file-name-pattern-or-regexp \
--tags="+label1,+label2,-pending-case1,-pending-case2"
Command line options:
--test-dirs (-d): Directories contain test suite files.
--incl-files (-i): File inclusion patterns.
--excl-files (-e): File exclusion patterns.
--test-name (-n): Test title/name matching pattern.
--tags (-g): Conditional tags for selecting test cases. In above example, label1, label2 are test case inclusion tags, pending-case1, pending-case2 are test case exclusion tags.
Use --help flag to see more details for arguments:
./opwire-testa run --help
Generating a testcase from a curl command
Illustration

Step 1. Make an HTTP request with Insomnia
Step 2. Run curl command with opwire-testa
Step 3. Generate testcase from the request
Step 4. Append the testcase to a testsuite
Step 5. Verify the updated testsuite
Command line syntax
./opwire-testa req curl \
--request POST \
--url "http://localhost:17779/-"
--header "name1: value1" \
--header "name2: value2" \
--data '{
"name": "opwire",
"url": "https://opwire.org"
}'
--export "testcase"
Use --help flag to see more details for arguments:
./opwire-testa req curl --help
Extracting curl command from a testcase
Command line syntax
./opwire-testa gen curl \
--test-dirs=... \
--test-dirs=... \
--test-file=file-name-pattern \
--test-name=test-case-name-pattern
Use --help flag to see more details for arguments:
./opwire-testa gen curl --help
License
MIT
See LICENSE to see the full text.