-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathapiTestsPostman
More file actions
38 lines (35 loc) · 1.71 KB
/
apiTestsPostman
File metadata and controls
38 lines (35 loc) · 1.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
Below are the scripts being used within postman to test our APIs
Testing in Postman: https://www.getpostman.com/docs/v6/postman/scripts/test_examples
GET http://moolah-financial-api.azurewebsites.net/api/users
Tests:
pm.test("Get Correct User Data", function () {
var users = pm.response.json();
pm.expect(users[0]).to.have.property('addresses');
pm.expect(users[0]).to.have.property('transactions');
pm.expect(users[0]).to.have.property('user_tag');
pm.expect(users[0]).to.have.property('user_id');
pm.expect(users[0]).to.have.property('first_name');
pm.expect(users[0]).to.have.property('middle_name');
pm.expect(users[0]).to.have.property('last_name');
pm.expect(users[0]).to.have.property('email');
pm.expect(users[0]).to.have.property('password');
pm.expect(users[0]).to.have.property('date_of_birth');
pm.expect(users[0]).to.have.property('citizenship');
pm.expect(users[0]).to.have.property('ssn');
pm.expect(users[0]).to.have.property('notification_preference');
pm.expect(users[0]).to.have.property('primary_phone');
pm.expect(users[0]).to.have.property('secondary_phone');
pm.expect(users[0]).to.have.property('is_deactivated');
pm.expect(users[0]).to.have.property('risk');
});
pm.test("Response time is less than 10000ms", function () {
pm.expect(pm.response.responseTime).to.be.below(10000);
});
POST http://moolah-financial-api.azurewebsites.net/api/users/register
Tests:
pm.test("Response time is less than 10000ms", function () {
pm.expect(pm.response.responseTime).to.be.below(10000);
});
pm.test("Status code is 405", function () {
pm.response.to.have.status(405);
});