Skip to content

Commit

Permalink
[CSR-1863] feat: add convert command
Browse files Browse the repository at this point in the history
  • Loading branch information
ynahmany authored Nov 25, 2024
2 parents 6a877c5 + 234bcd3 commit 91da79a
Show file tree
Hide file tree
Showing 49 changed files with 1,305 additions and 1,611 deletions.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion examples/package.json → examples/jest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"private": true,
"scripts": {
"test": "jest",
"report": "CURRENTS_API_URL=http://localhost:1234 currents --project-id=DgTfZV --key=DsDpjPk0ITxBLTmn",
"report": "CURRENTS_API_URL=http://localhost:1234 currents --project-id=2gT26j --key=nHw5cTjgW7f1rvL5",
"build": "echo \"No build specified\" && exit 0"
},
"devDependencies": {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
144 changes: 144 additions & 0 deletions examples/postman/tests.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
{
"info": {
"_postman_id": "e1e87782-7e0d-48dc-a937-3f6e1b931edc",
"name": "Tests",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
"_exporter_id": "966223"
},
"item": [
{
"name": "Currents API",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test(\"Response status code is 200\", function () {",
" pm.response.to.have.status(200);",
"});",
"",
"",
"pm.test(\"Response time is less than 200ms\", function () {",
" pm.expect(pm.response.responseTime).to.be.below(200);",
"});",
"",
"",
"pm.test(\"Status code is 200\", function () {",
" pm.expect(pm.response.code).to.equal(200);",
"});",
"",
"pm.test(\"Validate the response schema for required fields and data types\", function () {",
" const responseData = pm.response.json();",
"",
" pm.expect(responseData).to.be.an('object');",
" pm.expect(responseData.status).to.be.a('string');",
" pm.expect(responseData.data).to.be.an('object');",
"});"
],
"type": "text/javascript",
"packages": {}
}
}
],
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer your-api-key",
"type": "text"
}
],
"url": {
"raw": "https://api.currents.dev/v1/runs/previous?projectId=your-project-id&ciBuildId=your-ci-build-id&pwLastRun=true",
"protocol": "https",
"host": [
"api",
"currents",
"dev"
],
"path": [
"v1",
"runs",
"previous"
],
"query": [
{
"key": "projectId",
"value": "your-project-id"
},
{
"key": "ciBuildId",
"value": "your-ci-build-id"
},
{
"key": "pwLastRun",
"value": "true"
}
]
}
},
"response": []
},
{
"name": "Get Run",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test(\"Response status code is 200\", function () {",
" pm.response.to.have.status(200);",
"});",
"",
"",
"pm.test(\"Response time is less than 200ms\", function () {",
" pm.expect(pm.response.responseTime).to.be.below(200);",
"});",
"",
"",
"pm.test(\"Status code is 200\", function () {",
" pm.expect(pm.response.code).to.equal(200);",
"});",
"",
"pm.test(\"Validate the response schema for required fields and data types\", function () {",
" const responseData = pm.response.json();",
"",
" pm.expect(responseData).to.be.an('object');",
" pm.expect(responseData.status).to.be.a('string');",
" pm.expect(responseData.data).to.be.an('object');",
"});"
],
"type": "text/javascript",
"packages": {}
}
}
],
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer your-api-key",
"type": "text"
}
],
"url": {
"raw": "https://api.currents.dev/v1/runs/your-run-id",
"protocol": "https",
"host": [
"api",
"currents",
"dev"
],
"path": [
"v1",
"runs",
"your-run-id"
]
}
},
"response": []
}
]
}
92 changes: 92 additions & 0 deletions examples/postman/tests.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
<?xml version="1.0" encoding="UTF-8"?>
<testsuites name="Tests" tests="2" time="0.653">
<testsuite name="Currents API" id="8ff5ccec-3c02-4ebd-973c-ca35270676e5" timestamp="2024-11-20T02:50:24.703Z" tests="4" failures="4" errors="0" time="0.528">
<testcase name="Response status code is 200" time="0.528" classname="CurrentsApi">
<failure type="AssertionFailure" message="expected response to have status code 200 but got 401">
<![CDATA[Failed 1 times.]]>
<![CDATA[Collection JSON ID: e1e87782-7e0d-48dc-a937-3f6e1b931edc.]]>
<![CDATA[Collection name: Tests.]]>
<![CDATA[Request name: Currents API.]]>
<![CDATA[Test description: Response status code is 200.]]>
<![CDATA[Error message: expected response to have status code 200 but got 401.]]>
<![CDATA[Stacktrace: AssertionError: expected response to have status code 200 but got 401
at Object.eval sandbox-script.js:1:1).]]>
</failure>
</testcase>
<testcase name="Response time is less than 200ms" time="0.528" classname="CurrentsApi">
<failure type="AssertionFailure" message="expected 528 to be below 200">
<![CDATA[Failed 1 times.]]>
<![CDATA[Collection JSON ID: e1e87782-7e0d-48dc-a937-3f6e1b931edc.]]>
<![CDATA[Collection name: Tests.]]>
<![CDATA[Request name: Currents API.]]>
<![CDATA[Test description: Response time is less than 200ms.]]>
<![CDATA[Error message: expected 528 to be below 200.]]>
<![CDATA[Stacktrace: AssertionError: expected 528 to be below 200
at Object.eval sandbox-script.js:2:1).]]>
</failure>
</testcase>
<testcase name="Status code is 200" time="0.528" classname="CurrentsApi">
<failure type="AssertionFailure" message="expected 401 to equal 200">
<![CDATA[Failed 1 times.]]>
<![CDATA[Collection JSON ID: e1e87782-7e0d-48dc-a937-3f6e1b931edc.]]>
<![CDATA[Collection name: Tests.]]>
<![CDATA[Request name: Currents API.]]>
<![CDATA[Test description: Status code is 200.]]>
<![CDATA[Error message: expected 401 to equal 200.]]>
<![CDATA[Stacktrace: AssertionError: expected 401 to equal 200
at Object.eval sandbox-script.js:3:1).]]>
</failure>
</testcase>
<testcase name="Validate the response schema for required fields and data types" time="0.528" classname="CurrentsApi">
<failure type="AssertionFailure" message="expected undefined to be an object">
<![CDATA[Failed 1 times.]]>
<![CDATA[Collection JSON ID: e1e87782-7e0d-48dc-a937-3f6e1b931edc.]]>
<![CDATA[Collection name: Tests.]]>
<![CDATA[Request name: Currents API.]]>
<![CDATA[Test description: Validate the response schema for required fields and data types.]]>
<![CDATA[Error message: expected undefined to be an object.]]>
<![CDATA[Stacktrace: AssertionError: expected undefined to be an object
at Object.eval sandbox-script.js:4:1).]]>
</failure>
</testcase>
</testsuite>
<testsuite name="Get Run" id="8710cebd-3ca3-411a-83e4-f44e397dee79" timestamp="2024-11-20T02:50:24.703Z" tests="4" failures="3" errors="0" time="0.125">
<testcase name="Response status code is 200" time="0.125" classname="GetRun">
<failure type="AssertionFailure" message="expected response to have status code 200 but got 401">
<![CDATA[Failed 1 times.]]>
<![CDATA[Collection JSON ID: e1e87782-7e0d-48dc-a937-3f6e1b931edc.]]>
<![CDATA[Collection name: Tests.]]>
<![CDATA[Request name: Get Run.]]>
<![CDATA[Test description: Response status code is 200.]]>
<![CDATA[Error message: expected response to have status code 200 but got 401.]]>
<![CDATA[Stacktrace: AssertionError: expected response to have status code 200 but got 401
at Object.eval sandbox-script.js:1:2).]]>
</failure>
</testcase>
<testcase name="Response time is less than 200ms" time="0.125" classname="GetRun"/>
<testcase name="Status code is 200" time="0.125" classname="GetRun">
<failure type="AssertionFailure" message="expected 401 to equal 200">
<![CDATA[Failed 1 times.]]>
<![CDATA[Collection JSON ID: e1e87782-7e0d-48dc-a937-3f6e1b931edc.]]>
<![CDATA[Collection name: Tests.]]>
<![CDATA[Request name: Get Run.]]>
<![CDATA[Test description: Status code is 200.]]>
<![CDATA[Error message: expected 401 to equal 200.]]>
<![CDATA[Stacktrace: AssertionError: expected 401 to equal 200
at Object.eval sandbox-script.js:3:2).]]>
</failure>
</testcase>
<testcase name="Validate the response schema for required fields and data types" time="0.125" classname="GetRun">
<failure type="AssertionFailure" message="expected undefined to be an object">
<![CDATA[Failed 1 times.]]>
<![CDATA[Collection JSON ID: e1e87782-7e0d-48dc-a937-3f6e1b931edc.]]>
<![CDATA[Collection name: Tests.]]>
<![CDATA[Request name: Get Run.]]>
<![CDATA[Test description: Validate the response schema for required fields and data types.]]>
<![CDATA[Error message: expected undefined to be an object.]]>
<![CDATA[Stacktrace: AssertionError: expected undefined to be an object
at Object.eval sandbox-script.js:4:2).]]>
</failure>
</testcase>
</testsuite>
</testsuites>
Loading

0 comments on commit 91da79a

Please sign in to comment.