Bläddra i källkod

test: records e2e tests for the apis using keploy cli

Signed-off-by: re-Tick <jain.ritik.1001@gmail.com>
re-Tick 1 år sedan
förälder
incheckning
8a937987b1

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 94 - 0
keploy/test-set-0/mocks.yaml


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 26 - 0
keploy/test-set-0/tests/test-1.yaml


+ 43 - 0
keploy/test-set-0/tests/test-2.yaml

@@ -0,0 +1,43 @@
+version: api.keploy.io/v1beta2
+kind: Http
+name: test-2
+spec:
+    metadata: {}
+    req:
+        method: GET
+        proto_major: 1
+        proto_minor: 1
+        url: http://localhost:9000/api/lists?page=1&per_page=100
+        url_params:
+            page: "1"
+            per_page: "100"
+        header:
+            Accept: '*/*'
+            Authorization: Basic bGlzdG1vbms6bGlzdG1vbms=
+            Host: localhost:9000
+            User-Agent: curl/7.81.0
+        body: ""
+        body_type: ""
+    resp:
+        status_code: 200
+        header:
+            Content-Length: "772"
+            Content-Type: application/json; charset=UTF-8
+            Date: Mon, 25 Sep 2023 10:53:45 GMT
+        body: |
+            {"data":{"results":[{"id":2,"created_at":"2023-09-20T10:36:36.370595Z","updated_at":"2023-09-20T10:36:36.370595Z","uuid":"86e36156-ff03-4cc9-8b27-fd391f7e77cc","name":"Opt-in list","type":"public","optin":"double","tags":["test"],"description":"","subscriber_count":1,"subscriber_statuses":{"unconfirmed":1},"subscription_created_at":null,"subscription_updated_at":null},{"id":1,"created_at":"2023-09-20T10:36:36.369954Z","updated_at":"2023-09-20T10:36:36.369954Z","uuid":"35ae6a52-a7df-44b3-a28c-a0bf86245fd9","name":"Default list","type":"private","optin":"single","tags":["test"],"description":"","subscriber_count":5,"subscriber_statuses":{"unconfirmed":5},"subscription_created_at":null,"subscription_updated_at":null}],"query":"","total":2,"per_page":100,"page":1}}
+        body_type: ""
+        status_message: ""
+        proto_major: 0
+        proto_minor: 0
+    objects: []
+    assertions:
+        noise:
+            - body.data.results.created_at
+            - body.data.results.tags
+            - body.data.results.type
+            - body.data.results.updated_at
+            - body.data.results.name
+            - header.Date
+            - body.data.results.optin
+    created: 1695639226

+ 44 - 0
keploy/test-set-0/tests/test-3.yaml

@@ -0,0 +1,44 @@
+version: api.keploy.io/v1beta2
+kind: Http
+name: test-3
+spec:
+    metadata: {}
+    req:
+        method: POST
+        proto_major: 1
+        proto_minor: 1
+        url: http://localhost:9000/api/subscribers
+        header:
+            Accept: '*/*'
+            Authorization: Basic bGlzdG1vbms6bGlzdG1vbms=
+            Content-Length: "170"
+            Content-Type: application/json
+            Host: localhost:9000
+            User-Agent: curl/7.81.0
+        body: '{"email":"subsriber4@domain.com","name":"The Subscriber","status":"enabled","lists":[1],"attribs":{"city":"Bengaluru","projects":3,"stack":{"languages":["go","python"]}}}'
+        body_type: ""
+    resp:
+        status_code: 200
+        header:
+            Content-Length: "739"
+            Content-Type: application/json; charset=UTF-8
+            Date: Mon, 25 Sep 2023 10:54:14 GMT
+        body: |
+            {"data":{"id":18,"created_at":"2023-09-25T10:54:14.039652Z","updated_at":"2023-09-25T10:54:14.039652Z","uuid":"071136da-2de0-4c19-bec3-f4563ca50975","email":"subsriber4@domain.com","name":"The Subscriber","attribs":{"city":"Bengaluru","projects":3,"stack":{"languages":["go","python"]}},"status":"enabled","lists":[{"subscription_status":"unconfirmed","subscription_created_at":"2023-09-25T10:54:14.039652+00:00","subscription_updated_at":"2023-09-25T10:54:14.039652+00:00","subscription_meta":{},"id":1,"uuid":"35ae6a52-a7df-44b3-a28c-a0bf86245fd9","name":"Default list","type":"private","optin":"single","tags":["test"],"description":"","created_at":"2023-09-20T10:36:36.369954+00:00","updated_at":"2023-09-20T10:36:36.369954+00:00"}]}}
+        body_type: ""
+        status_message: ""
+        proto_major: 0
+        proto_minor: 0
+    objects: []
+    assertions:
+        noise:
+            - body.data.updated_at
+            - body.data.lists.subscription_updated_at
+            - body.data.lists.updated_at
+            - body.data.attribs.stack.languages
+            - body.data.lists.subscription_created_at
+            - body.data.lists.created_at
+            - body.data.id
+            - body.data.created_at
+            - header.Date
+    created: 1695639254

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 35 - 0
keploy/test-set-0/tests/test-4.yaml


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 23 - 0
keploy/test-set-0/tests/test-5.yaml


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 94 - 0
keploy/test-set-1/mocks.yaml


+ 34 - 0
keploy/test-set-1/tests/test-1.yaml

@@ -0,0 +1,34 @@
+version: api.keploy.io/v1beta2
+kind: Http
+name: test-1
+spec:
+    metadata: {}
+    req:
+        method: POST
+        proto_major: 1
+        proto_minor: 1
+        url: http://localhost:9000/api/lists
+        header:
+            Accept: '*/*'
+            Authorization: Basic bGlzdG1vbms6bGlzdG1vbms=
+            Host: localhost:9000
+            User-Agent: curl/7.81.0
+        body: ""
+        body_type: ""
+    resp:
+        status_code: 400
+        header:
+            Content-Length: "27"
+            Content-Type: application/json; charset=UTF-8
+            Date: Mon, 25 Sep 2023 10:57:47 GMT
+        body: |
+            {"message":"Invalid name"}
+        body_type: ""
+        status_message: ""
+        proto_major: 0
+        proto_minor: 0
+    objects: []
+    assertions:
+        noise:
+            - header.Date
+    created: 1695639468

+ 40 - 0
keploy/test-set-1/tests/test-2.yaml

@@ -0,0 +1,40 @@
+version: api.keploy.io/v1beta2
+kind: Http
+name: test-2
+spec:
+    metadata: {}
+    req:
+        method: GET
+        proto_major: 1
+        proto_minor: 1
+        url: http://localhost:9000/api/subscribers/1
+        header:
+            Accept: '*/*'
+            Authorization: Basic bGlzdG1vbms6bGlzdG1vbms=
+            Host: localhost:9000
+            User-Agent: curl/7.81.0
+        body: ""
+        body_type: ""
+    resp:
+        status_code: 200
+        header:
+            Content-Length: "699"
+            Content-Type: application/json; charset=UTF-8
+            Date: Mon, 25 Sep 2023 10:59:18 GMT
+        body: |
+            {"data":{"id":1,"created_at":"2023-09-20T10:36:36.37103Z","updated_at":"2023-09-20T10:36:36.37103Z","uuid":"61270bf1-d711-4473-9d74-6f8761f052b9","email":"john@example.com","name":"John Doe","attribs":{"city":"Bengaluru","good":true,"type":"known"},"status":"enabled","lists":[{"subscription_status":"unconfirmed","subscription_created_at":"2023-09-20T10:36:36.37103+00:00","subscription_updated_at":"2023-09-20T10:36:36.37103+00:00","subscription_meta":{},"id":1,"uuid":"35ae6a52-a7df-44b3-a28c-a0bf86245fd9","name":"Default list","type":"private","optin":"single","tags":["test"],"description":"","created_at":"2023-09-20T10:36:36.369954+00:00","updated_at":"2023-09-20T10:36:36.369954+00:00"}]}}
+        body_type: ""
+        status_message: ""
+        proto_major: 0
+        proto_minor: 0
+    objects: []
+    assertions:
+        noise:
+            - body.data.lists.subscription_updated_at
+            - body.data.created_at
+            - body.data.updated_at
+            - body.data.lists.subscription_created_at
+            - header.Date
+            - body.data.lists.created_at
+            - body.data.lists.updated_at
+    created: 1695639558

+ 35 - 0
keploy/test-set-1/tests/test-3.yaml

@@ -0,0 +1,35 @@
+version: api.keploy.io/v1beta2
+kind: Http
+name: test-3
+spec:
+    metadata: {}
+    req:
+        method: POST
+        proto_major: 1
+        proto_minor: 1
+        url: http://localhost:9000/api/public/subscription
+        header:
+            Accept: '*/*'
+            Content-Length: "151"
+            Content-Type: application/json
+            Host: localhost:9000
+            User-Agent: curl/7.81.0
+        body: '{"email":"subsriber@domain.com","name":"The Subscriber","list_uuids": ["eb420c55-4cfb-4972-92ba-c93c34ba475d", "0c554cfb-eb42-4972-92ba-c93c34ba475d"]}'
+        body_type: ""
+    resp:
+        status_code: 200
+        header:
+            Content-Length: "29"
+            Content-Type: application/json; charset=UTF-8
+            Date: Mon, 25 Sep 2023 10:59:55 GMT
+        body: |
+            {"data":{"has_optin":false}}
+        body_type: ""
+        status_message: ""
+        proto_major: 0
+        proto_minor: 0
+    objects: []
+    assertions:
+        noise:
+            - header.Date
+    created: 1695639595

+ 36 - 0
keploy/test-set-1/tests/test-4.yaml

@@ -0,0 +1,36 @@
+version: api.keploy.io/v1beta2
+kind: Http
+name: test-4
+spec:
+    metadata: {}
+    req:
+        method: PUT
+        proto_major: 1
+        proto_minor: 1
+        url: http://localhost:9000/api/subscribers/lists
+        header:
+            Accept: '*/*'
+            Authorization: Basic bGlzdG1vbms6bGlzdG1vbms=
+            Content-Length: "88"
+            Content-Type: application/x-www-form-urlencoded
+            Host: localhost:9000
+            User-Agent: curl/7.81.0
+        body: '{"ids": [1, 2, 3], "action": "add", "target_list_ids": [4, 5, 6], "status": "confirmed"}'
+        body_type: ""
+    resp:
+        status_code: 400
+        header:
+            Content-Length: "28"
+            Content-Type: application/json; charset=UTF-8
+            Date: Mon, 25 Sep 2023 11:00:54 GMT
+        body: |
+            {"message":"No IDs given."}
+        body_type: ""
+        status_message: ""
+        proto_major: 0
+        proto_minor: 0
+    objects: []
+    assertions:
+        noise:
+            - header.Date
+    created: 1695639654

+ 36 - 0
keploy/test-set-1/tests/test-5.yaml

@@ -0,0 +1,36 @@
+version: api.keploy.io/v1beta2
+kind: Http
+name: test-5
+spec:
+    metadata: {}
+    req:
+        method: PUT
+        proto_major: 1
+        proto_minor: 1
+        url: http://localhost:9000/api/subscribers/lists
+        header:
+            Accept: '*/*'
+            Authorization: Basic bGlzdG1vbms6bGlzdG1vbms=
+            Content-Length: "88"
+            Content-Type: application/x-www-form-urlencoded
+            Host: localhost:9000
+            User-Agent: curl/7.81.0
+        body: '{"ids": [1, 2, 3], "action": "add", "target_list_ids": [1, 2, 3], "status": "confirmed"}'
+        body_type: ""
+    resp:
+        status_code: 400
+        header:
+            Content-Length: "28"
+            Content-Type: application/json; charset=UTF-8
+            Date: Mon, 25 Sep 2023 11:01:22 GMT
+        body: |
+            {"message":"No IDs given."}
+        body_type: ""
+        status_message: ""
+        proto_major: 0
+        proto_minor: 0
+    objects: []
+    assertions:
+        noise:
+            - header.Date
+    created: 1695639682

Vissa filer visades inte eftersom för många filer har ändrats