|
123 | 123 | "tests[\"JSON return code is 400\"] = response.code == 400", |
124 | 124 | "", |
125 | 125 | "tests[\"success is true\"] = response.success == false", |
126 | | - "tests[\"Message is correct\"] = response.error.message == \"Missing key(s) ['username', 'first_name', 'last_name'] to perform action.\"", |
| 126 | + "tests[\"Message is correct\"] = response.error.message == \"Missing keys ['username', 'first_name', 'last_name'].\"", |
127 | 127 | "tests[\"Error type is Bad Request\"] = response.error.type == \"BadRequestError\"" |
128 | 128 | ], |
129 | 129 | "type": "text/javascript" |
|
804 | 804 | "tests[\"JSON return code is 400\"] = response.code == 400", |
805 | 805 | "", |
806 | 806 | "tests[\"success is true\"] = response.success == false", |
807 | | - "tests[\"Message is correct\"] = response.error.message == \"Missing key(s) ['username'] to perform action.\"", |
| 807 | + "tests[\"Message is correct\"] = response.error.message == \"Missing keys ['username'].\"", |
808 | 808 | "tests[\"Error type is Bad Request\"] = response.error.type == \"BadRequestError\"" |
809 | 809 | ], |
810 | 810 | "type": "text/javascript" |
|
855 | 855 | "", |
856 | 856 | "tests[\"success is true\"] = response.success == true", |
857 | 857 | "", |
858 | | - "pm.collectionVariables.set(\"user_access_token\", response.tokens.access_token);", |
859 | | - "pm.collectionVariables.set(\"user_refresh_token\", response.tokens.refresh_token);" |
| 858 | + "tests[\"Is profile completed is 0\"] = response.return.is_profile_completed == 0", |
| 859 | + "", |
| 860 | + "pm.collectionVariables.set(\"user_access_token\", response.return.access_token);", |
| 861 | + "pm.collectionVariables.set(\"user_refresh_token\", response.return.refresh_token);" |
860 | 862 | ], |
861 | 863 | "type": "text/javascript" |
862 | 864 | } |
|
906 | 908 | "", |
907 | 909 | "tests[\"success is true\"] = response.success == true", |
908 | 910 | "", |
909 | | - "pm.collectionVariables.set(\"user_access_token\", response.tokens.access_token);", |
910 | | - "pm.collectionVariables.set(\"user_refresh_token\", response.tokens.refresh_token);" |
| 911 | + "tests[\"Is profile completed is 0\"] = response.return.is_profile_completed == 0", |
| 912 | + "", |
| 913 | + "pm.collectionVariables.set(\"user_access_token\", response.return.access_token);", |
| 914 | + "pm.collectionVariables.set(\"user_refresh_token\", response.return.refresh_token);" |
911 | 915 | ], |
912 | 916 | "type": "text/javascript" |
913 | 917 | } |
|
1282 | 1286 | ], |
1283 | 1287 | "protocolProfileBehavior": {} |
1284 | 1288 | }, |
| 1289 | + { |
| 1290 | + "name": "Profile", |
| 1291 | + "item": [ |
| 1292 | + { |
| 1293 | + "name": "Complete profile", |
| 1294 | + "event": [ |
| 1295 | + { |
| 1296 | + "listen": "test", |
| 1297 | + "script": { |
| 1298 | + "id": "a0f4bed4-f29c-46ff-a16b-66db85d46a87", |
| 1299 | + "exec": [ |
| 1300 | + "var response = JSON.parse(responseBody);", |
| 1301 | + "", |
| 1302 | + "", |
| 1303 | + "pm.test(\"Status code is 200\", function () {", |
| 1304 | + " pm.response.to.have.status(200);", |
| 1305 | + "});", |
| 1306 | + "", |
| 1307 | + "", |
| 1308 | + "tests[\"success is true\"] = response.success == true", |
| 1309 | + "tests[\"Message is correct\"] = response.message == \"Profile completed !\"", |
| 1310 | + "" |
| 1311 | + ], |
| 1312 | + "type": "text/javascript" |
| 1313 | + } |
| 1314 | + } |
| 1315 | + ], |
| 1316 | + "request": { |
| 1317 | + "method": "POST", |
| 1318 | + "header": [], |
| 1319 | + "body": { |
| 1320 | + "mode": "raw", |
| 1321 | + "raw": "{\n\t\"orientation\": \"heterosexual\",\n\t\"bio\": \"Nunc faucibus velit metus, nec iaculis sem fringilla ut. Nullam vel vulputate diam. Vivamus vehicula, enim at hendrerit tincidunt, leo sapien maximus nisi, nec suscipit arcu nisi a turpis. Suspendisse rutrum quis quam et sollicitudin. Proin commodo justo non dui tempor, at maximus velit vulputate. Integer vitae porta nulla, ut congue est. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin purus ex, venenatis vel aliquet a, interdum sit amet quam. Donec ac volutpat dui. In ornare augue in nisi efficitur varius. Donec hendrerit nunc a pulvinar posuere. Donec malesuada eros quam, eget pharetra nunc elementum in.\"\n}", |
| 1322 | + "options": { |
| 1323 | + "raw": { |
| 1324 | + "language": "json" |
| 1325 | + } |
| 1326 | + } |
| 1327 | + }, |
| 1328 | + "url": { |
| 1329 | + "raw": "{{host}}/profile/complete", |
| 1330 | + "host": [ |
| 1331 | + "{{host}}" |
| 1332 | + ], |
| 1333 | + "path": [ |
| 1334 | + "profile", |
| 1335 | + "complete" |
| 1336 | + ] |
| 1337 | + } |
| 1338 | + }, |
| 1339 | + "response": [] |
| 1340 | + }, |
| 1341 | + { |
| 1342 | + "name": "Login after profile completed", |
| 1343 | + "event": [ |
| 1344 | + { |
| 1345 | + "listen": "test", |
| 1346 | + "script": { |
| 1347 | + "id": "c3bcacc7-f9f6-42ad-8590-2022cfae9c6f", |
| 1348 | + "exec": [ |
| 1349 | + "var response = JSON.parse(responseBody);", |
| 1350 | + "", |
| 1351 | + "", |
| 1352 | + "pm.test(\"Status code is 200\", function () {", |
| 1353 | + " pm.response.to.have.status(200);", |
| 1354 | + "});", |
| 1355 | + "", |
| 1356 | + "tests[\"JSON return code is 200\"] = response.code == 200", |
| 1357 | + "", |
| 1358 | + "tests[\"success is true\"] = response.success == true", |
| 1359 | + "", |
| 1360 | + "tests[\"Is profile completed is 0\"] = response.return.is_profile_completed == 1", |
| 1361 | + "", |
| 1362 | + "pm.collectionVariables.set(\"user_access_token\", response.return.access_token);", |
| 1363 | + "pm.collectionVariables.set(\"user_refresh_token\", response.return.refresh_token);" |
| 1364 | + ], |
| 1365 | + "type": "text/javascript" |
| 1366 | + } |
| 1367 | + } |
| 1368 | + ], |
| 1369 | + "request": { |
| 1370 | + "method": "POST", |
| 1371 | + "header": [], |
| 1372 | + "body": { |
| 1373 | + "mode": "raw", |
| 1374 | + "raw": "{\n\t\"password\": \"{{user_password}}\",\n\t\"username\": \"{{user_email}}\"\n}", |
| 1375 | + "options": { |
| 1376 | + "raw": { |
| 1377 | + "language": "json" |
| 1378 | + } |
| 1379 | + } |
| 1380 | + }, |
| 1381 | + "url": { |
| 1382 | + "raw": "{{host}}/auth/login", |
| 1383 | + "host": [ |
| 1384 | + "{{host}}" |
| 1385 | + ], |
| 1386 | + "path": [ |
| 1387 | + "auth", |
| 1388 | + "login" |
| 1389 | + ] |
| 1390 | + } |
| 1391 | + }, |
| 1392 | + "response": [] |
| 1393 | + } |
| 1394 | + ], |
| 1395 | + "protocolProfileBehavior": {} |
| 1396 | + }, |
1285 | 1397 | { |
1286 | 1398 | "name": "Delete user after tests", |
1287 | 1399 | "event": [ |
|
1382 | 1494 | ], |
1383 | 1495 | "variable": [ |
1384 | 1496 | { |
1385 | | - "id": "6c8b7fc6-9cc7-4d64-a3a8-6906042342b6", |
| 1497 | + "id": "f4dd475b-c423-4497-a1d7-826619651283", |
1386 | 1498 | "key": "host", |
1387 | 1499 | "value": "http://127.0.0.1:5000", |
1388 | 1500 | "type": "string" |
1389 | 1501 | }, |
1390 | 1502 | { |
1391 | | - "id": "ddad86e9-22e5-4a88-b52d-301816ef3a36", |
| 1503 | + "id": "8d82efce-58a4-4ae6-be77-3f9a94c64aa4", |
1392 | 1504 | "key": "user_id", |
1393 | 1505 | "value": "", |
1394 | 1506 | "type": "string" |
1395 | 1507 | }, |
1396 | 1508 | { |
1397 | | - "id": "5d18d3f6-eaeb-40d7-8a7c-c7b0d964553c", |
| 1509 | + "id": "54e97677-add0-44ce-b4de-08e78149669d", |
1398 | 1510 | "key": "user_email", |
1399 | 1511 | "value": "foo@example.org", |
1400 | 1512 | "type": "string" |
1401 | 1513 | }, |
1402 | 1514 | { |
1403 | | - "id": "faf5a9f1-4700-4834-9c27-828bd5a91ce7", |
| 1515 | + "id": "f13b4302-ae17-4f05-bd3d-0092d7d0e988", |
1404 | 1516 | "key": "user_username", |
1405 | 1517 | "value": "bar", |
1406 | 1518 | "type": "string" |
1407 | 1519 | }, |
1408 | 1520 | { |
1409 | | - "id": "ed8d0627-3dca-497c-a0ac-3ea8d91f44ee", |
| 1521 | + "id": "b71e8f9f-9932-4c65-b1b8-88bbe02146c2", |
1410 | 1522 | "key": "user_password", |
1411 | 1523 | "value": "admin", |
1412 | 1524 | "type": "string" |
1413 | 1525 | }, |
1414 | 1526 | { |
1415 | | - "id": "0d707d74-159d-44d8-ba14-d6d481e06f36", |
| 1527 | + "id": "d567e6be-d3ae-418d-bc4a-a2b8ec7971a3", |
1416 | 1528 | "key": "user_firstname", |
1417 | 1529 | "value": "Foo", |
1418 | 1530 | "type": "string" |
1419 | 1531 | }, |
1420 | 1532 | { |
1421 | | - "id": "af2785be-3f97-4b93-8715-6d3fc078f780", |
| 1533 | + "id": "9f99c685-7bf2-4774-b694-c3fcebb92b84", |
1422 | 1534 | "key": "user_lastname", |
1423 | 1535 | "value": "Bar", |
1424 | 1536 | "type": "string" |
1425 | 1537 | }, |
1426 | 1538 | { |
1427 | | - "id": "acc6eed3-ff7a-427e-ad0c-3759ce4d730b", |
| 1539 | + "id": "34adee57-0702-4c96-9efb-58a80542d55d", |
1428 | 1540 | "key": "debug_token", |
1429 | 1541 | "value": "xX69jules69Xx", |
1430 | 1542 | "type": "string" |
1431 | 1543 | }, |
1432 | 1544 | { |
1433 | | - "id": "b0753752-b0e6-4772-aefd-c5fb69ea93ff", |
| 1545 | + "id": "dcd1f01b-44a4-4750-a05c-af21292576b6", |
1434 | 1546 | "key": "user_access_token", |
1435 | 1547 | "value": "", |
1436 | 1548 | "type": "string" |
1437 | 1549 | }, |
1438 | 1550 | { |
1439 | | - "id": "99791095-2cf9-486c-9573-1e21bb25012b", |
| 1551 | + "id": "633549e9-b8aa-42ed-8178-6a91d38961b8", |
1440 | 1552 | "key": "user_refresh_token", |
1441 | 1553 | "value": "", |
1442 | 1554 | "type": "string" |
1443 | 1555 | }, |
1444 | 1556 | { |
1445 | | - "id": "fb718e68-8130-4d40-ab14-4e5816a8f1e7", |
| 1557 | + "id": "b712d83c-9221-4571-9945-6fc52fcd167f", |
1446 | 1558 | "key": "expired_token", |
1447 | 1559 | "value": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE1OTAyNDIyNjQsIm5iZiI6MTU5MDI0MjI2NCwianRpIjoiNTM0ZGI5NzQtOWE4Ni00MGViLWE1NDEtMDg3N2ZmNzQ3NDVhIiwiZXhwIjoxNTkwMjQyMzI0LCJpZGVudGl0eSI6eyJpZCI6NTEyLCJlbWFpbCI6ImZvb0BleGFtcGxlLm9yZyIsInVzZXJuYW1lIjoiYmFyIiwiaXNfb25saW5lIjp0cnVlLCJkYXRlX2xhc3RzZWVuIjoiU2F0LCAyMyBNYXkgMjAyMCAxMzo1Nzo0NCBHTVQifSwiZnJlc2giOnRydWUsInR5cGUiOiJhY2Nlc3MifQ.NTp2P0WNkXDwzuzrcNIQdeAfizQ57HQgkzBLSvY1yHU", |
1448 | 1560 | "type": "string" |
|
0 commit comments