tests in root
This commit is contained in:
33
Create Release.yml
Normal file
33
Create Release.yml
Normal file
@@ -0,0 +1,33 @@
|
||||
info:
|
||||
name: Create Release
|
||||
type: http
|
||||
seq: 8
|
||||
|
||||
http:
|
||||
method: POST
|
||||
url: "{{baseUrl}}/api/v1/releases"
|
||||
headers:
|
||||
- name: Content-Type
|
||||
value: application/json
|
||||
body:
|
||||
type: json
|
||||
data: |-
|
||||
{
|
||||
"service": "e58ac01a-606b-4cf7-9dee-cb4484672fa1",
|
||||
"version": "1.0.0",
|
||||
"changelog": "Initial release"
|
||||
}
|
||||
auth: inherit
|
||||
|
||||
runtime:
|
||||
scripts:
|
||||
- type: after-response
|
||||
code: "let json = res.getBody();\r
|
||||
|
||||
bru.setEnvVar('releaseId', json.data.id);"
|
||||
|
||||
settings:
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
followRedirects: true
|
||||
maxRedirects: 5
|
||||
48
Create Service Without Body.yml
Normal file
48
Create Service Without Body.yml
Normal file
@@ -0,0 +1,48 @@
|
||||
info:
|
||||
name: Create Service Without Body
|
||||
type: http
|
||||
seq: 3
|
||||
|
||||
http:
|
||||
method: POST
|
||||
url: "{{baseUrl}}/api/v1/services"
|
||||
headers:
|
||||
- name: Content-Type
|
||||
value: application/json
|
||||
- name: requestID
|
||||
value: test-req-1
|
||||
body:
|
||||
type: json
|
||||
data: ""
|
||||
auth: inherit
|
||||
|
||||
runtime:
|
||||
scripts:
|
||||
- type: after-response
|
||||
code: "test('Status code is 200', function () {\r
|
||||
|
||||
\ expect(res.getStatus()).to.equal(200);\r
|
||||
|
||||
});\r
|
||||
|
||||
\r
|
||||
|
||||
let json = res.getBody();\r
|
||||
|
||||
\r
|
||||
|
||||
test('Status is SUCCESS', function () {\r
|
||||
|
||||
\ expect(json.status).to.eql('SUCCESS');\r
|
||||
|
||||
});\r
|
||||
|
||||
\r
|
||||
|
||||
bru.setEnvVar('serviceId', json.data.id);"
|
||||
|
||||
settings:
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
followRedirects: true
|
||||
maxRedirects: 5
|
||||
52
Create Service Without Code.yml
Normal file
52
Create Service Without Code.yml
Normal file
@@ -0,0 +1,52 @@
|
||||
info:
|
||||
name: Create Service Without Code
|
||||
type: http
|
||||
seq: 2
|
||||
|
||||
http:
|
||||
method: POST
|
||||
url: "{{baseUrl}}/api/v1/services"
|
||||
headers:
|
||||
- name: Content-Type
|
||||
value: application/json
|
||||
- name: requestID
|
||||
value: test-req-1
|
||||
body:
|
||||
type: json
|
||||
data: |-
|
||||
{
|
||||
"type": "SYSTEM",
|
||||
"name": "Сервис управления версиями модулей"
|
||||
}
|
||||
auth: inherit
|
||||
|
||||
runtime:
|
||||
scripts:
|
||||
- type: after-response
|
||||
code: "test('Status code is 200', function () {\r
|
||||
|
||||
\ expect(res.getStatus()).to.equal(200);\r
|
||||
|
||||
});\r
|
||||
|
||||
\r
|
||||
|
||||
let json = res.getBody();\r
|
||||
|
||||
\r
|
||||
|
||||
test('Status is SUCCESS', function () {\r
|
||||
|
||||
\ expect(json.status).to.eql('SUCCESS');\r
|
||||
|
||||
});\r
|
||||
|
||||
\r
|
||||
|
||||
bru.setEnvVar('serviceId', json.data.id);"
|
||||
|
||||
settings:
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
followRedirects: true
|
||||
maxRedirects: 5
|
||||
53
Create Service.yml
Normal file
53
Create Service.yml
Normal file
@@ -0,0 +1,53 @@
|
||||
info:
|
||||
name: Create Service
|
||||
type: http
|
||||
seq: 1
|
||||
|
||||
http:
|
||||
method: POST
|
||||
url: "{{baseUrl}}/api/v1/services"
|
||||
headers:
|
||||
- name: Content-Type
|
||||
value: application/json
|
||||
- name: requestID
|
||||
value: test-req-1
|
||||
body:
|
||||
type: json
|
||||
data: |-
|
||||
{
|
||||
"type": "SYSTEM",
|
||||
"code": "SERVICE_1",
|
||||
"name": "Test Service"
|
||||
}
|
||||
auth: inherit
|
||||
|
||||
runtime:
|
||||
scripts:
|
||||
- type: after-response
|
||||
code: "test('Status code is 200', function () {\r
|
||||
|
||||
\ expect(res.getStatus()).to.equal(200);\r
|
||||
|
||||
});\r
|
||||
|
||||
\r
|
||||
|
||||
let json = res.getBody();\r
|
||||
|
||||
\r
|
||||
|
||||
test('Status is SUCCESS', function () {\r
|
||||
|
||||
\ expect(json.status).to.eql('SUCCESS');\r
|
||||
|
||||
});\r
|
||||
|
||||
\r
|
||||
|
||||
bru.setEnvVar('serviceId', json.data.id);"
|
||||
|
||||
settings:
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
followRedirects: true
|
||||
maxRedirects: 5
|
||||
15
Get All Services.yml
Normal file
15
Get All Services.yml
Normal file
@@ -0,0 +1,15 @@
|
||||
info:
|
||||
name: Get All Services
|
||||
type: http
|
||||
seq: 4
|
||||
|
||||
http:
|
||||
method: GET
|
||||
url: "{{baseUrl}}/api/v1/services"
|
||||
auth: inherit
|
||||
|
||||
settings:
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
followRedirects: true
|
||||
maxRedirects: 5
|
||||
15
Get Service by Code.yml
Normal file
15
Get Service by Code.yml
Normal file
@@ -0,0 +1,15 @@
|
||||
info:
|
||||
name: Get Service by Code
|
||||
type: http
|
||||
seq: 7
|
||||
|
||||
http:
|
||||
method: GET
|
||||
url: "{{baseUrl}}/api/v1/services/code/modules-version2.2"
|
||||
auth: inherit
|
||||
|
||||
settings:
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
followRedirects: true
|
||||
maxRedirects: 5
|
||||
15
Get Service by ID.yml
Normal file
15
Get Service by ID.yml
Normal file
@@ -0,0 +1,15 @@
|
||||
info:
|
||||
name: Get Service by ID
|
||||
type: http
|
||||
seq: 5
|
||||
|
||||
http:
|
||||
method: GET
|
||||
url: "{{baseUrl}}/api/v1/services/{{serviceId}}"
|
||||
auth: inherit
|
||||
|
||||
settings:
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
followRedirects: true
|
||||
maxRedirects: 5
|
||||
15
Negative - Invalid UUID.yml
Normal file
15
Negative - Invalid UUID.yml
Normal file
@@ -0,0 +1,15 @@
|
||||
info:
|
||||
name: Negative - Invalid UUID
|
||||
type: http
|
||||
seq: 10
|
||||
|
||||
http:
|
||||
method: GET
|
||||
url: "{{baseUrl}}/api/v1/services/123"
|
||||
auth: inherit
|
||||
|
||||
settings:
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
followRedirects: true
|
||||
maxRedirects: 5
|
||||
21
Negative - Missing Body.yml
Normal file
21
Negative - Missing Body.yml
Normal file
@@ -0,0 +1,21 @@
|
||||
info:
|
||||
name: Negative - Missing Body
|
||||
type: http
|
||||
seq: 11
|
||||
|
||||
http:
|
||||
method: POST
|
||||
url: "{{baseUrl}}/api/v1/services"
|
||||
headers:
|
||||
- name: Content-Type
|
||||
value: application/json
|
||||
body:
|
||||
type: json
|
||||
data: ""
|
||||
auth: inherit
|
||||
|
||||
settings:
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
followRedirects: true
|
||||
maxRedirects: 5
|
||||
26
Update Release.yml
Normal file
26
Update Release.yml
Normal file
@@ -0,0 +1,26 @@
|
||||
info:
|
||||
name: Update Release
|
||||
type: http
|
||||
seq: 9
|
||||
|
||||
http:
|
||||
method: PUT
|
||||
url: "{{baseUrl}}/api/v1/releases/{{releaseId}}"
|
||||
headers:
|
||||
- name: Content-Type
|
||||
value: application/json
|
||||
body:
|
||||
type: json
|
||||
data: |-
|
||||
{
|
||||
"service": "{{serviceId}}",
|
||||
"version": "1.0.1",
|
||||
"changelog": "Bug fixes"
|
||||
}
|
||||
auth: inherit
|
||||
|
||||
settings:
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
followRedirects: true
|
||||
maxRedirects: 5
|
||||
26
Update Service.yml
Normal file
26
Update Service.yml
Normal file
@@ -0,0 +1,26 @@
|
||||
info:
|
||||
name: Update Service
|
||||
type: http
|
||||
seq: 6
|
||||
|
||||
http:
|
||||
method: PUT
|
||||
url: "{{baseUrl}}/api/v1/services/{{serviceId}}"
|
||||
headers:
|
||||
- name: Content-Type
|
||||
value: application/json
|
||||
body:
|
||||
type: json
|
||||
data: |-
|
||||
{
|
||||
"code": "modules-version2.2",
|
||||
"name": "Сервис управления версиями модулей",
|
||||
"type": "SYSTEM"
|
||||
}
|
||||
auth: inherit
|
||||
|
||||
settings:
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
followRedirects: true
|
||||
maxRedirects: 5
|
||||
23
opencollection.yml
Normal file
23
opencollection.yml
Normal file
@@ -0,0 +1,23 @@
|
||||
opencollection: 1.0.0
|
||||
|
||||
info:
|
||||
name: Services API
|
||||
|
||||
request:
|
||||
variables:
|
||||
- name: baseUrl
|
||||
value: http://modules.dev.practic.ordocrm.online
|
||||
- name: serviceId
|
||||
value: ""
|
||||
- name: releaseId
|
||||
value: ""
|
||||
|
||||
docs:
|
||||
content: Collection for Services & Releases API testing
|
||||
type: text/markdown
|
||||
bundled: false
|
||||
extensions:
|
||||
bruno:
|
||||
ignore:
|
||||
- node_modules
|
||||
- .git
|
||||
Reference in New Issue
Block a user