@skyramp/testbot-core 0.13.0-v3.99 → 0.13.1-v3.442

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,71 +0,0 @@
1
- // Generated by Skyramp v1.2.0+2a92d199 on 2026-06-22 23:35:13.098753 -0700 PDT m=+0.340207543
2
- // Command: skyramp generate integration rest \
3
- // --framework playwright \
4
- // --language typescript \
5
- // --output /Users/kisuhlee/git/skyramp/examples/v2/gen_reference/traces/integration/demoshop1/integration_test.spec.ts \
6
- // --overwrite \
7
- // --trace /Users/kisuhlee/git/skyramp/examples/v2/gen_reference/traces/datasets/demoshop1/skyramp-traces.json
8
-
9
- // Import of required libraries
10
- import { test, expect, SkyrampClient, getBaseUrl, getValue, getResponseValue } from '@skyramp/skyramp';
11
-
12
- // URL for test requests
13
- const URL_api = getBaseUrl("SKYRAMP_TEST_BASE_URL", "https://api.example.com");
14
-
15
- test('testIntegration', async () => {
16
- test.setTimeout(64000);
17
-
18
- // Invocation of Skyramp Client
19
- const client = new SkyrampClient();
20
- // Definition of authentication header
21
- const headers: Record<string, string> = {};
22
- if (process.env.SKYRAMP_TEST_TOKEN && process.env.SKYRAMP_TEST_TOKEN != "") {
23
- headers["Authorization"] = "Bearer " + process.env.SKYRAMP_TEST_TOKEN;
24
- }
25
-
26
- // Request Body
27
- const productsPostRequestBody: string = `{
28
- "category": "Software Tools",
29
- "description": "Professional API testing tool for developers and QA teams",
30
- "image_url": "https://www.skyramp.dev/images/skyramp-tester.png",
31
- "in_stock": true,
32
- "name": "Skyramp Tester",
33
- "price": 999
34
- }`;
35
-
36
- // Execute Request
37
- const productsPostResponse = await client.sendRequest({
38
- url: URL_api,
39
- path: "/api/v1/products",
40
- method: "POST",
41
- body: productsPostRequestBody,
42
- headers: headers
43
- });
44
-
45
- // Generated Assertions
46
- expect(productsPostResponse.statusCode, 'status code').toBe(201);
47
-
48
- // Request Body
49
- const ordersPostRequestBody: string = `{
50
- "customer_email": "test@skyramp.dev",
51
- "items": [
52
- {
53
- "product_id": 1,
54
- "quantity": 1
55
- }
56
- ]
57
- }`;
58
-
59
- // Execute Request
60
- const ordersPostResponse = await client.sendRequest({
61
- url: URL_api,
62
- path: "/api/v1/orders",
63
- method: "POST",
64
- body: ordersPostRequestBody,
65
- headers: headers,
66
- dataOverride: {"items.0.product_id": getResponseValue(productsPostResponse, "product_id")}
67
- });
68
-
69
- // Generated Assertions
70
- expect(ordersPostResponse.statusCode, 'status code').toBe(201);
71
- });