0

I have a variable environment called "new role code" that has the value H7rZEm

As follows

All I have to do is check in all the properties that have code that there is no "new role code" value.

Response is as follows

{
    "status": "ok",
    "statusCode": "0000",
    "message": {
        "text": "",
        "type": ""
    },
    "errors": [],
    "data": {
        "docs": [
            {
                "name": "admin",
                "description": "نقش admin کل سیستم. با دسترسی به همه‌ی بخش ها (System generated)",
                "code": "T11AsR",
                "permissions": [
                    "authenticated",
                    "manage_users",
                    "view_user_logs",
                    "manage_role",
                    "map_role_to_user",
                    "managing_custom_page",
                    "managing_FAQ_page",
                    "managing_jobs_page",
                    "managing_about_us_page",
                    "send_sms",
                    "read_sms",
                    "send_email",
                    "read_email",
                    "manage_system_settings",
                    "manage_profile",
                    "manage_account",
                    "manage_images",
                    "manage_videos",
                    "verify_email",
                    "manage_country_province_city",
                    "manage_resumes",
                    "get_user_report"
                ],
                "protected": true,
                "userType": "admin",
                "_id": "60b2607d6a286901dffe61fa"
            },
            {
                "name": "public",
                "description": "دسترسی های این نقش برای همه کاربران ثبت نام شده و احراز هویت شده مجاز است.",
                "code": "fh1xqE",
                "permissions": [
                    "authenticated",
                    "manage_profile",
                    "manage_account",
                    "verify_email"
                ],
                "protected": true,
                "userType": "client",
                "_id": "60b2607f6a286901dffe61fb"
            }
        ],
        "totalDocs": 2,
        "limit": 100,
        "totalPages": 1,
        "page": 1,
        "pagingCounter": 1,
        "hasPrevPage": false,
        "hasNextPage": false,
        "prevPage": null,
        "nextPage": null
    }
}

The test should be such that the value of "new role code" is not in the response and the test is passed and if there is, the test fails

response code property should not contain environment variables

  • What did you already try? Please share your code. What concrete issues are you facing? Thanks for considering [How do I ask a good question](https://stackoverflow.com/help/how-to-ask\)? and [How to create a Minimal, Reproducible Example](https://stackoverflow.com/help/minimal-reproducible-example\). – Christian Baumann Sep 14 '21 at 09:13
  • Does this answer your question? [test the id shouldnt be in response body](https://stackoverflow.com/questions/68942267/test-the-id-shouldnt-be-in-response-body) – Christian Baumann Sep 14 '21 at 09:17

0 Answers0