mirror of
https://github.com/LukasKanka/api_test.git
synced 2026-11-11 14:34:36 +01:00
feat: add JsonPlaceholder test collection with public API tests
- Add apiTest/JsonPlaceholder/opencollection.yml - Add Users/Get all users.yml (GET /users test) - Add Posts/Get post by ID.yml (GET /posts/1 test) - Add Posts/Create new post.yml (POST /posts test) - Update README.md with JsonPlaceholder reference Tests use public JSONPlaceholder API - no local backend required. Works in CI/CD pipeline automatically. Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
1 parent
7ec092a134
commit
72370c2f2f
7 files changed
+158
-1
No files matched your search
@@ -0,0 +1,43 @@
|
||||
info:
|
||||
name: Get all users
|
||||
type: http
|
||||
seq: 1
|
||||
|
||||
http:
|
||||
method: GET
|
||||
url: https://jsonplaceholder.typicode.com/users
|
||||
auth: inherit
|
||||
|
||||
runtime:
|
||||
scripts:
|
||||
- type: tests
|
||||
code: |-
|
||||
const status = res.getStatus();
|
||||
const body = res.getBody();
|
||||
|
||||
test("Status code is 200", function() {
|
||||
expect(status).to.equal(200);
|
||||
});
|
||||
|
||||
test("Response is an array", function() {
|
||||
expect(body).to.be.an('array');
|
||||
});
|
||||
|
||||
test("Array has 10 users", function() {
|
||||
expect(body).to.have.length(10);
|
||||
});
|
||||
|
||||
test("Each user has id and name", function() {
|
||||
body.forEach(user => {
|
||||
expect(user).to.have.property('id');
|
||||
expect(user).to.have.property('name');
|
||||
expect(user).to.have.property('email');
|
||||
});
|
||||
});
|
||||
|
||||
settings:
|
||||
encodeUrl: true
|
||||
timeout: 10000
|
||||
followRedirects: true
|
||||
maxRedirects: 5
|
||||
forwardAuthorizationHeader: true
|
||||
Reference in new issue
Block a user