You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Address PR #84 review: change .tp delimiter from ### to ---, refactor and add --single-file generate
- Replace ### section markers with --- to avoid collision with HTTP request separator
- Move .tp constants to dedicated TpConstants.cs (following AuthConstants.cs pattern)
- Use Constants.UnixEndOfLine/WindowsEndOfLine in TpFileParser
- Extract duplicate if blocks into SetVirtualScript() in InitializeTestCaseStep
- Add --single-file/-s flag to generate command for .tp scaffolding
- Allow omitting name on single --- TESTCASE marker (fallback to filename)
- Update Path descriptions in Explore/Test commands to mention .tp files
- Fix double whitespace in CompileScriptCommand
- Add descriptive comments to 004-Car-Operations.tp demo file
- Update all documentation and skill references
- Remove unnecessary comments from StructureExplorationIndex
- Add explanatory comments on early-return in ReadHttpFileStep/ReadScriptFileStep
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: .cursor/skills/teapie/SKILL.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ description: Comprehensive TeaPie framework expertise for API integration testin
7
7
8
8
## Overview
9
9
10
-
TeaPie (TEsting API Extension) is a lightweight CLI tool for API testing that combines `.http` or `.tp` files with C# scripts for comprehensive integration testing. This skill provides expert knowledge on all TeaPie capabilities, syntax, and best practices.
10
+
TeaPie (TEsting API Extension) is a lightweight CLI tool for API testing that combines `.http`files with C# scripts or uses `.tp` files that cover both types of files within one for comprehensive integration testing. This skill provides expert knowledge on all TeaPie capabilities, syntax, and best practices.
11
11
12
12
## Quick Reference
13
13
@@ -23,7 +23,7 @@ TeaPie supports two equivalent formats. Choose based on script complexity and st
23
23
24
24
**Single-file format (`.tp`):**
25
25
26
-
-**`<name>.tp`** - All sections in one file using markers: `### TESTCASE`, `### INIT`, `### HTTP`, `### TEST`, `### END`
26
+
-**`<name>.tp`** - All sections in one file using markers: `--- TESTCASE`, `--- INIT`, `--- HTTP`, `--- TEST`, `--- END`
Copy file name to clipboardExpand all lines: docs/docs/test-case/test-case.md
+8-2Lines changed: 8 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,7 +31,7 @@ When running a test case, you can also reference:
31
31
32
32
TeaPie supports two equivalent ways to define test cases. Use whichever fits your project better.
33
33
34
-
The [**Single-File Format (`.tp`)**](tp-file.md) combines HTTP requests and C# scripts in one file using section markers. It is an optional alternative to the multi-file format. Both are fully supported; choose based on script complexity and how you prefer to structure tests.
34
+
The [**Single-File Format (`.tp`)**](tp-file.md) combines HTTP requests and C# scripts in one file using section markers. It is an optional alternative to the multi-file format. Both formats are fully supported and can co-exist in the same project; choose based on test case complexity and how you prefer to structure tests.
35
35
36
36
## Running a Test Case
37
37
@@ -84,7 +84,13 @@ This command generates the multi-file format in the specified path (or the curre
84
84
85
85
To **disable pre-request or post-response script generation**, set the `-i` and `-t` options to `false`.
86
86
87
-
For the single-file format (`.tp`), create the file manually. See [Single-File Format (`.tp`)](tp-file.md) for details.
87
+
To generate a **single-file test case (`.tp`)** instead, use the `--single-file` (or `-s`) flag:
This creates a `<test-case-name>.tp` file with `--- HTTP` section (and `--- INIT`/`--- TEST` if `-i`/`-t` are set). See [Single-File Format (`.tp`)](tp-file.md) for details.
Copy file name to clipboardExpand all lines: docs/docs/test-case/tp-file.md
+27-27Lines changed: 27 additions & 27 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,62 +5,62 @@
5
5
|----------------------|----------------|
6
6
|**Definition**| An optional alternative to the multi-file format. A `.tp` file combines HTTP requests and C# scripts in one file using section markers. |
7
7
|**Naming Convention**|`<test-case-name>.tp`|
8
-
|**Purpose**| Define test cases with all sections in one place. Both `.tp` and multi-file formats are fully supported; choose based on script complexity and how you prefer to structure tests. |
8
+
|**Purpose**| Define test cases with all sections in one place. Both `.tp` and multi-file formats are fully supported and can co-exist in the same project; choose based on test case complexity and how you prefer to structure tests. |
The `.tp` format is an **optional alternative** to the multi-file format. Both are fully supported; choose based on script complexity and how you prefer to structure tests.
12
+
The `.tp` format is an **optional alternative** to the multi-file format. Both are fully supported and can co-exist in the same project; choose based on test case complexity and how you prefer to structure tests.
13
13
14
14
## Section Markers
15
15
16
-
Sections are marked with `###` markers (case-insensitive):
16
+
Sections are marked with `---` markers (case-insensitive):
17
17
18
18
<!-- markdownlint-disable MD060 -->
19
19
| Marker | Purpose |
20
20
|--------|---------|
21
-
|`### TESTCASE <Name>`| Starts a named test case. Required when defining multiple test cases in one file. |
22
-
|`### INIT`| Pre-request C# script (optional). Same role as `-init.csx`. |
23
-
|`### HTTP`| HTTP request(s) (required). Same format as `.http` files. |
24
-
|`### TEST`| Post-response C# script (optional). Same role as `-test.csx`. |
25
-
|`### END`| Ends the current test case block. |
21
+
|`--- TESTCASE <Name>`| Starts a named test case. Required when defining multiple test cases in one file. |
22
+
|`--- INIT`| Pre-request C# script (optional). Same role as `-init.csx`. |
23
+
|`--- HTTP`| HTTP request(s) (required). Same format as `.http` files. |
24
+
|`--- TEST`| Post-response C# script (optional). Same role as `-test.csx`. |
25
+
|`--- END`| Ends the current test case block. |
26
26
<!-- markdownlint-enable MD060 -->
27
27
28
28
## Single Test Case Example
29
29
30
30
Use `## TEST-EXPECT-STATUS` and other directives in the HTTP section for status code validation. In the TEST section, focus on response body and business logic validation:
31
31
32
32
```text
33
-
### TESTCASE Health Check
33
+
--- TESTCASE Health Check
34
34
35
-
### HTTP
35
+
--- HTTP
36
36
## TEST-EXPECT-STATUS: [200]
37
37
## TEST-HAS-BODY
38
38
GET {{ApiBaseUrl}}/health
39
39
40
-
### TEST
40
+
--- TEST
41
41
tp.Test("Health response should contain status field.", async () =>
await tp.Test("Response should contain array of cars.", async () =>
93
93
{
94
94
var body = await tp.Response.Content.ReadAsStringAsync();
95
95
NotNull(body);
96
96
True(body.StartsWith("[") && body.EndsWith("]"));
97
97
});
98
98
99
-
### END
99
+
--- END
100
100
```
101
101
102
102
## Implicit Mode
103
103
104
-
If no `### TESTCASE` marker is present, the file is treated as a single test case. The test case name is derived from the filename (e.g. `001-Health-Check.tp` → `001-Health-Check`).
104
+
If no `--- TESTCASE` marker is present, the file is treated as a single test case. The test case name is derived from the filename (e.g. `001-Health-Check.tp` → `001-Health-Check`).
105
105
106
106
## Rules
107
107
108
-
- The `### HTTP` section is **required** for each test case.
109
-
-`### INIT` and `### TEST` are optional.
110
-
- Markers are **case-insensitive** (`### testcase`, `### http`, etc.).
111
-
- Use `### END` to terminate each test case when defining multiple test cases.
112
-
- HTTP content follows the same conventions as [Request File](request-file.md) (named requests, variables, etc.).
108
+
- The `--- HTTP` section is **required** for each test case.
109
+
-`--- INIT` and `--- TEST` are optional.
110
+
- Markers are **case-insensitive** (`--- testcase`, `--- http`, etc.).
111
+
- Use `--- END` to terminate each test case when defining multiple test cases.
112
+
- HTTP content follows the same conventions as [Request File](request-file.md) (named requests, variables, etc.). The `###` request separator used in `.http` files works normally inside the `--- HTTP` section without any conflict.
113
113
- For status code validation, use directives such as `## TEST-EXPECT-STATUS: [200, 201]` in the HTTP section rather than asserting in the TEST script. See [Directives](directives.md) for details.
0 commit comments