Skip to content

Commit 989f2dc

Browse files
authored
docs: ai updates (#377)
1. Add additional languages 2. Add test templates killercoda tutorial PACT-4122
1 parent 00238f5 commit 989f2dc

File tree

3 files changed

+34
-11
lines changed

3 files changed

+34
-11
lines changed

website/docs/docs/ai/index.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,10 @@ PactFlow AI includes a suite of features to improve the efficiency and quality o
1616

1717
PactFlow AI is available as a CLI and supports the following programming languages:
1818

19-
* Java
20-
* JavaScript / TypeScript
21-
* Golang (coming soon)
22-
* .NET (coming soon)
19+
* Java and Kotlin
20+
* TypeScript / JavaScript
21+
* .NET
22+
* Golang
23+
* PHP
24+
* Swift
2325
* Python (coming soon)

website/docs/docs/ai/using.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -335,21 +335,22 @@ To provide specific updates or constraints for the test generation, use a concis
335335

336336
`--instructions "Include the 'X-HMAC-SIGNATURE' header in all GET requests (format: 'SHA256-HMAC-SIGNATURE: {sig}')"`
337337

338-
Alternatively, you can load instructions from a file `--instructions /path/to/instructions.txt`
338+
Alternatively, you can load instructions from a file `--instructions @/path/to/instructions.txt`
339339

340340
This would instruct the test generation process to read the file content and use it as the instruction.
341341

342342
**Example:**
343343

344344
`prompts.txt`:
345345
```
346+
* Make sure to cover happy and non-happy paths
347+
* Specifically, ensure to include test cases for the positive (HTTP 200) scenario and negative scenarios, specifically the case of 400, 401 and 404
348+
* Only include endpoints/properties used by the API client - do not include additional fields in the OAS that are not in the client code
349+
* You can check the properties used in the Product class to help make this determination
346350
* Use the Jest testing framework
347351
* Use the native Jest expect (https://jestjs.io/docs/expect) matchers such as `toEqual` and `toBeTruthy`
348352
* Prefer the use of the async/await pattern when using Promises
349-
* Use a 3 level hierarchy for tests
350-
1. Level 1 should be the API under test as a `describe` block e.g. "Product API"
351-
2. Level 2 should be the endpoint as a `describe` block e.g. "GET /products/:id", "POST /products"
352-
3. Level 3 should be the scenario as a `test` block e.g. "Given a valid user, returns a 200", "Given an invalid user, returns a 400"
353+
* Use the PactV4 interface
353354
```
354355

355356
## Best Practices

website/docs/docs/tutorials.md

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,15 @@ You will:
4444
| Node JS | <https://killercoda.com/pactflow/scenario/pactflow-getting-started-js> |
4545
| Java | <https://killercoda.com/pactflow/scenario/pactflow-getting-started-java> |
4646

47-
## Generating Tests with PactFlow's AI-Augmented Contract Testing Capabilities
47+
## Generate Tests with AI-Augmented Contract Testing in PactFlow
4848

4949
_Level: Beginner_
5050

5151
In this tutorial, we guide you through creating a consumer Pact test with the help of PactFlow's Test Generation capability, featuring HaloAI.
5252

5353
You will download and setup the CLI tool, and generate consumer Pact tests for a JavaScript codebase.
5454

55-
Read more about our [test generation feature](https://pactflow.io/ai/), or check out our documentation [here](https://docs.pactflow.io/docs/ai).
55+
[Learn more about Test Generation](https://docs.pactflow.io/docs/ai).
5656

5757
### Goals
5858

@@ -74,6 +74,26 @@ You will:
7474
| -------- | ---------------------------------------------------------------------- |
7575
| Node JS | <https://killercoda.com/pactflow/scenario/pactflow-ai> |
7676

77+
## Use Test Templates with AI-Augmented Contract Testing in PactFlow
78+
79+
_Level: Beginner_
80+
81+
This tutorial introduces the **Test Templates** feature and shows you how to use it with PactFlow’s AI-powered **Test Generation** capability, powered by **HaloAI**.
82+
83+
[Learn more about Test Templates](https://docs.pactflow.io/docs/ai).
84+
85+
### What You'll Learn
86+
87+
1. How to create and apply a template file to generate Pact tests
88+
2. How templates help align generated tests with your existing test suite
89+
3. How to improve test output—such as adding edge case coverage—by refining your prompts
90+
91+
### Tutorial
92+
93+
| Language | Link |
94+
| -------- | ---------------------------------------------------------------------- |
95+
| Node JS | <https://killercoda.com/pactflow/scenario/pactflow-ai-test-templates> |
96+
7797
## Gating deployments with PactFlow
7898

7999
_Level: Intermediate_

0 commit comments

Comments
 (0)