|
1180 | 1180 | "", |
1181 | 1181 | "tests[\"Is email correct\"] = response.email == user_email", |
1182 | 1182 | "tests[\"Is username correct\"] = response.username == user_username", |
1183 | | - "tests[\"Are tags present\"] = response.tags.length == 7", |
| 1183 | + "tests[\"Are tags present\"] = response.tags.length == 0", |
1184 | 1184 | "", |
1185 | 1185 | "pm.collectionVariables.set(\"user_id\", response.id)" |
1186 | 1186 | ], |
|
1319 | 1319 | "header": [], |
1320 | 1320 | "body": { |
1321 | 1321 | "mode": "raw", |
1322 | | - "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\t\"tags\": [\n\t\t\"bot\",\n\t\t\"robot\",\n\t\t\"postman\",\n\t\t\"sex\",\n\t\t\"friends\",\n\t\t\"drink\",\n\t\t\"smoke\"\n\t\t],\n\t\"gender\": \"other\",\n\t\"birthdate\": 1590674628\n}", |
| 1322 | + "raw": "{\n\t\"orientation\": \"{{user_orientation}}\",\n\t\"bio\": \"{{user_bio}}\",\n\t\"tags\": [\n\t\t\"bot\",\n\t\t\"robot\",\n\t\t\"postman\",\n\t\t\"sex\",\n\t\t\"friends\",\n\t\t\"drink\",\n\t\t\"smoke\"\n\t\t],\n\t\"gender\": \"{{user_gender}}\",\n\t\"birthdate\": {{user_birthdate}}\n}", |
1323 | 1323 | "options": { |
1324 | 1324 | "raw": { |
1325 | 1325 | "language": "json" |
|
1391 | 1391 | } |
1392 | 1392 | }, |
1393 | 1393 | "response": [] |
| 1394 | + }, |
| 1395 | + { |
| 1396 | + "name": "Get one user after completed profile", |
| 1397 | + "event": [ |
| 1398 | + { |
| 1399 | + "listen": "test", |
| 1400 | + "script": { |
| 1401 | + "id": "2383f4d3-633d-40e9-a730-e39d9d24f1e5", |
| 1402 | + "exec": [ |
| 1403 | + "var response = JSON.parse(responseBody);", |
| 1404 | + "", |
| 1405 | + "", |
| 1406 | + "pm.test(\"Status code is 200\", function () {", |
| 1407 | + " pm.response.to.have.status(200);", |
| 1408 | + "});", |
| 1409 | + "", |
| 1410 | + "user_email = pm.collectionVariables.get(\"user_email\");", |
| 1411 | + "user_username = pm.collectionVariables.get(\"user_username\");", |
| 1412 | + "user_orientation = pm.collectionVariables.get(\"user_orientation\");", |
| 1413 | + "user_gender = pm.collectionVariables.get(\"user_gender\");", |
| 1414 | + "", |
| 1415 | + "tests[\"Is email correct\"] = response.email == user_email", |
| 1416 | + "tests[\"Is username correct\"] = response.username == user_username", |
| 1417 | + "tests[\"Are tags present\"] = response.tags.length == 7", |
| 1418 | + "tests[\"User orientation is correct\"] = response.orientation == user_orientation", |
| 1419 | + "tests[\"User gender is correct\"] = response.gender == user_gender", |
| 1420 | + "pm.collectionVariables.set(\"user_id\", response.id)" |
| 1421 | + ], |
| 1422 | + "type": "text/javascript" |
| 1423 | + } |
| 1424 | + } |
| 1425 | + ], |
| 1426 | + "request": { |
| 1427 | + "method": "GET", |
| 1428 | + "header": [], |
| 1429 | + "url": { |
| 1430 | + "raw": "{{host}}/users/{{user_username}}", |
| 1431 | + "host": [ |
| 1432 | + "{{host}}" |
| 1433 | + ], |
| 1434 | + "path": [ |
| 1435 | + "users", |
| 1436 | + "{{user_username}}" |
| 1437 | + ] |
| 1438 | + } |
| 1439 | + }, |
| 1440 | + "response": [] |
| 1441 | + }, |
| 1442 | + { |
| 1443 | + "name": "Edit profile", |
| 1444 | + "event": [ |
| 1445 | + { |
| 1446 | + "listen": "prerequest", |
| 1447 | + "script": { |
| 1448 | + "id": "8ff8a3b1-9b9c-4cb7-a9dd-c29eee539368", |
| 1449 | + "exec": [ |
| 1450 | + "" |
| 1451 | + ], |
| 1452 | + "type": "text/javascript" |
| 1453 | + } |
| 1454 | + }, |
| 1455 | + { |
| 1456 | + "listen": "test", |
| 1457 | + "script": { |
| 1458 | + "id": "f6ddbcb3-6fd6-4ef6-85a8-d176cd5f75b2", |
| 1459 | + "exec": [ |
| 1460 | + "var response = JSON.parse(responseBody);", |
| 1461 | + "", |
| 1462 | + "", |
| 1463 | + "pm.test(\"Status code is 200\", function () {", |
| 1464 | + " pm.response.to.have.status(200);", |
| 1465 | + "});", |
| 1466 | + "", |
| 1467 | + "", |
| 1468 | + "tests[\"success is true\"] = response.success == true", |
| 1469 | + "tests[\"Message is correct\"] = response.message == \"User successfully modified !\"", |
| 1470 | + "" |
| 1471 | + ], |
| 1472 | + "type": "text/javascript" |
| 1473 | + } |
| 1474 | + } |
| 1475 | + ], |
| 1476 | + "request": { |
| 1477 | + "method": "PUT", |
| 1478 | + "header": [], |
| 1479 | + "body": { |
| 1480 | + "mode": "raw", |
| 1481 | + "raw": "{\n\t\"orientation\": \"heterosexual\",\n\t\"bio\": \"{{user_bio}}\",\n\t\"tags\": [\n\t\t\"bot\",\n\t\t\"robot\",\n\t\t\"postman\",\n\t\t\"sex\",\n\t\t\"friends\",\n\t\t\"drink\",\n\t\t\"smoke\"\n\t\t],\n\t\"gender\": \"male\",\n\t\"birthdate\": {{user_birthdate}},\n\t\"first_name\": \"Foo\",\n\t\"last_name\": \"Bar\",\n\t\"username\": \"FooBar\"\n}", |
| 1482 | + "options": { |
| 1483 | + "raw": { |
| 1484 | + "language": "json" |
| 1485 | + } |
| 1486 | + } |
| 1487 | + }, |
| 1488 | + "url": { |
| 1489 | + "raw": "{{host}}/profile/edit", |
| 1490 | + "host": [ |
| 1491 | + "{{host}}" |
| 1492 | + ], |
| 1493 | + "path": [ |
| 1494 | + "profile", |
| 1495 | + "edit" |
| 1496 | + ] |
| 1497 | + } |
| 1498 | + }, |
| 1499 | + "response": [] |
| 1500 | + }, |
| 1501 | + { |
| 1502 | + "name": "Get one user after edited profile", |
| 1503 | + "event": [ |
| 1504 | + { |
| 1505 | + "listen": "test", |
| 1506 | + "script": { |
| 1507 | + "id": "5f13dea7-7c67-41ec-97ca-14ed10444b09", |
| 1508 | + "exec": [ |
| 1509 | + "var response = JSON.parse(responseBody);", |
| 1510 | + "", |
| 1511 | + "", |
| 1512 | + "pm.test(\"Status code is 200\", function () {", |
| 1513 | + " pm.response.to.have.status(200);", |
| 1514 | + "});", |
| 1515 | + "", |
| 1516 | + "user_email = pm.collectionVariables.get(\"user_email\");", |
| 1517 | + "user_orientation = pm.collectionVariables.get(\"user_orientation\");", |
| 1518 | + "", |
| 1519 | + "tests[\"Is email correct\"] = response.email == user_email", |
| 1520 | + "tests[\"Is username correct\"] = response.username == \"FooBar\"", |
| 1521 | + "tests[\"Are tags present\"] = response.tags.length == 7", |
| 1522 | + "tests[\"User orientation is correct\"] = response.orientation == user_orientation", |
| 1523 | + "tests[\"User gender is correct\"] = response.gender == \"male\"", |
| 1524 | + "pm.collectionVariables.set(\"user_id\", response.id)" |
| 1525 | + ], |
| 1526 | + "type": "text/javascript" |
| 1527 | + } |
| 1528 | + } |
| 1529 | + ], |
| 1530 | + "request": { |
| 1531 | + "method": "GET", |
| 1532 | + "header": [], |
| 1533 | + "url": { |
| 1534 | + "raw": "{{host}}/users/{{user_email}}", |
| 1535 | + "host": [ |
| 1536 | + "{{host}}" |
| 1537 | + ], |
| 1538 | + "path": [ |
| 1539 | + "users", |
| 1540 | + "{{user_email}}" |
| 1541 | + ] |
| 1542 | + } |
| 1543 | + }, |
| 1544 | + "response": [] |
1394 | 1545 | } |
1395 | 1546 | ], |
1396 | 1547 | "protocolProfileBehavior": {} |
|
1495 | 1646 | ], |
1496 | 1647 | "variable": [ |
1497 | 1648 | { |
1498 | | - "id": "c93127c5-53b6-418a-8dde-326f3060929a", |
| 1649 | + "id": "ee3529e9-cdd6-4308-8a1d-0edef6fca8e1", |
1499 | 1650 | "key": "host", |
1500 | 1651 | "value": "http://127.0.0.1:5000", |
1501 | 1652 | "type": "string" |
1502 | 1653 | }, |
1503 | 1654 | { |
1504 | | - "id": "c0f8da9e-693a-49a2-b9b4-547b81a931dd", |
| 1655 | + "id": "a5f28010-fcaa-45b8-854a-818903317da6", |
1505 | 1656 | "key": "user_id", |
1506 | 1657 | "value": "", |
1507 | 1658 | "type": "string" |
1508 | 1659 | }, |
1509 | 1660 | { |
1510 | | - "id": "e812d2b5-9edf-4929-9bca-64385a2f8fee", |
| 1661 | + "id": "e5433b0f-60e3-4167-9312-bf9ec4962983", |
1511 | 1662 | "key": "user_email", |
1512 | 1663 | "value": "foo@example.org", |
1513 | 1664 | "type": "string" |
1514 | 1665 | }, |
1515 | 1666 | { |
1516 | | - "id": "2b497dba-272c-458e-a66b-bc2470f7f0cc", |
| 1667 | + "id": "7a18a68c-3244-4dd6-9a7d-3c309bb176f5", |
1517 | 1668 | "key": "user_username", |
1518 | 1669 | "value": "bar", |
1519 | 1670 | "type": "string" |
1520 | 1671 | }, |
1521 | 1672 | { |
1522 | | - "id": "f0e4819d-a3ee-4f0a-a175-801c3eb06e70", |
| 1673 | + "id": "0cedfada-9756-439c-9c47-5f26be9b4cb3", |
1523 | 1674 | "key": "user_password", |
1524 | 1675 | "value": "admin", |
1525 | 1676 | "type": "string" |
1526 | 1677 | }, |
1527 | 1678 | { |
1528 | | - "id": "1bc72851-3589-4f59-9ca2-cbb22ae044b9", |
| 1679 | + "id": "99d5eccf-e07f-40e5-8d6d-fd43c448eb9f", |
1529 | 1680 | "key": "user_firstname", |
1530 | 1681 | "value": "Foo", |
1531 | 1682 | "type": "string" |
1532 | 1683 | }, |
1533 | 1684 | { |
1534 | | - "id": "56678e7a-8172-4342-b939-076286a713da", |
| 1685 | + "id": "2c8e556b-46ba-4a99-b47e-a8d320a6f682", |
1535 | 1686 | "key": "user_lastname", |
1536 | 1687 | "value": "Bar", |
1537 | 1688 | "type": "string" |
1538 | 1689 | }, |
1539 | 1690 | { |
1540 | | - "id": "3fab058a-563a-4ce8-a967-4c3f54bc8d10", |
| 1691 | + "id": "32314549-41a0-4aa7-ae5b-3568c4aa9cc0", |
1541 | 1692 | "key": "debug_token", |
1542 | 1693 | "value": "xX69jules69Xx", |
1543 | 1694 | "type": "string" |
1544 | 1695 | }, |
1545 | 1696 | { |
1546 | | - "id": "40f0d53a-930b-4b6d-8748-7b05d6154c2c", |
| 1697 | + "id": "44809d49-7682-44e4-90a2-e17de7a8a95e", |
1547 | 1698 | "key": "user_access_token", |
1548 | 1699 | "value": "", |
1549 | 1700 | "type": "string" |
1550 | 1701 | }, |
1551 | 1702 | { |
1552 | | - "id": "c9617f1e-454a-457c-af53-2b37e5d0fdb4", |
| 1703 | + "id": "8b42b046-2f60-4e87-a49d-d79206d3001f", |
1553 | 1704 | "key": "user_refresh_token", |
1554 | 1705 | "value": "", |
1555 | 1706 | "type": "string" |
1556 | 1707 | }, |
1557 | 1708 | { |
1558 | | - "id": "f65ff0a6-1581-408a-af30-5d02554d0af5", |
| 1709 | + "id": "591d0ce5-469b-4b46-9600-ddf097e7fd50", |
1559 | 1710 | "key": "expired_token", |
1560 | 1711 | "value": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE1OTAyNDIyNjQsIm5iZiI6MTU5MDI0MjI2NCwianRpIjoiNTM0ZGI5NzQtOWE4Ni00MGViLWE1NDEtMDg3N2ZmNzQ3NDVhIiwiZXhwIjoxNTkwMjQyMzI0LCJpZGVudGl0eSI6eyJpZCI6NTEyLCJlbWFpbCI6ImZvb0BleGFtcGxlLm9yZyIsInVzZXJuYW1lIjoiYmFyIiwiaXNfb25saW5lIjp0cnVlLCJkYXRlX2xhc3RzZWVuIjoiU2F0LCAyMyBNYXkgMjAyMCAxMzo1Nzo0NCBHTVQifSwiZnJlc2giOnRydWUsInR5cGUiOiJhY2Nlc3MifQ.NTp2P0WNkXDwzuzrcNIQdeAfizQ57HQgkzBLSvY1yHU", |
1561 | 1712 | "type": "string" |
| 1713 | + }, |
| 1714 | + { |
| 1715 | + "id": "b0b34788-e107-4efe-ad31-a873640c2f31", |
| 1716 | + "key": "user_orientation", |
| 1717 | + "value": "heterosexual", |
| 1718 | + "type": "string" |
| 1719 | + }, |
| 1720 | + { |
| 1721 | + "id": "1e8dcc93-4687-4f75-9ebc-7db3bac516b8", |
| 1722 | + "key": "user_bio", |
| 1723 | + "value": "Lorem Ipsum is the single greatest threat. We are not - we are not keeping up with other websites. Lorem Ipsum best not make any more threats to your website. It will be met with fire and fury like the world has never seen. Does everybody know that pig named Lorem Ipsum? An ‘extremely credible source’ has called my office and told me that Barack Obama’s placeholder text is a fraud.", |
| 1724 | + "type": "string" |
| 1725 | + }, |
| 1726 | + { |
| 1727 | + "id": "9465dc19-d5ad-4392-ab87-6ae12e29a907", |
| 1728 | + "key": "user_gender", |
| 1729 | + "value": "other", |
| 1730 | + "type": "string" |
| 1731 | + }, |
| 1732 | + { |
| 1733 | + "id": "e1770e73-72f5-4e3d-92d8-4b2584b68ba3", |
| 1734 | + "key": "user_birthdate", |
| 1735 | + "value": "1590674628", |
| 1736 | + "type": "string" |
1562 | 1737 | } |
1563 | 1738 | ], |
1564 | 1739 | "protocolProfileBehavior": {} |
|
0 commit comments