از روش های API زیر برای صادرات یا وارد کردن سناریوهای BDD از تستکیسها استفاده کنید.
get_bdd #
یک سناریوی BDD را از یک تستکیس به عنوان فایل ویژگی . صادر می کند.
GET index.php?/api/v2/get_bdd/{case_id}
پارامترها #
| نام | تایپ کنید | مورد نیاز | توضیحات |
|---|---|---|---|
| case_id | عدد صحیح | درست است | شناسه پرونده |
درخواست نمونه:
# Export the BDD scenario with a case ID of 2133
GET index.php?/api/v2/get_bdd/2133
محتوای پاسخگویی #
@APP-1
Feature: Users cannot login with invalid credentials
The login page should not allow users to login with invalid credentials, and it should not reveal sensitive info relating to the correctness of credentials.Background:Given I am viewing the login page
Scenario Outline: User cannot login with invalid username
Given I have entered into the username field
And I have entered into the password field
When I click the login button
Then I see I am not logged in
Examples:
|username|password|
|invalid1|validP@55w0rd!|
|invalid2@com|validP@55w0rd!|
Scenario: User cannot login with invalid password
Given I have entered "myname@valid.com" into the username field
And I have entered "invalid" into the password field
When I click the login button
Then I see I am not logged in
Rule: Login responses should not reveal sensitive information
Examples: Login response should not flag invalid username
Given I have entered an invalid username into the username field
And I have entered a valid password into the password field
When I click the login button
Then I see an error message
And the error message does not state that the username was incorrect
Examples: Login response should not flag invalid password
Given I have entered an invalid password into the password field
And I have entered a valid username into the username field
When I click the login button
Then I see an error message
And the error message does not state that the password was incorrect
کدهای پاسخگویی #
| کد وضعیت | توضیحات |
|---|---|
| 200 | باشه |
| 400 |
تستکیس نامعتبر یا ناشناخته |
| 500 |
خطایی رخ داد |
add_bdd #
یک سناریوی BDD را از یک تستکیس به عنوان فایل ویژگی . وارد می کند/آپلود می کند.
POST index.php?/api/v2/add_bdd/{section_id}
پارامترها #
| نام | تایپ کنید | مورد نیاز | توضیحات |
|---|---|---|---|
| section_id | عدد صحیح | درست است | شناسه بخش |
درخواست نمونه:
# Import the BDD scenario with a section ID of 188
POST index.php?/api/v2/add_bdd/188
محتوای پاسخگویی #
{
"id": 2136,
"title": "Users cannot login with invalid credentials",
"section_id": 188,
"template_id": 4,
"type_id": 7,
"priority_id": 2,
"milestone_id": null,
"refs": "APP-1",
"created_by": 1,
"created_on": 1653052591,
"updated_by": 1,
"updated_on": 1653052591,
"estimate": null,
"estimate_forecast": null,
"suite_id": 12,
"display_order": 3,
"is_deleted": 0,
"custom_automation_type": 0,
"custom_preconds": "The login page should not allow users to login with invalid credentials, and it should not reveal sensitive info relating to the correctness of credentials.Background:Given I am viewing the login page\n\t",
"custom_steps": null,
"custom_testrail_bdd_scenario": "[{\"content\":\"\\tScenario Outline: User cannot login with invalid username\\n\\tGiven I have entered into the username field\\n\\tAnd I have entered into the password field\\n\\tWhen I click the login button\\n\\tThen I see I am not logged in\\n\\n\\tExamples:\\n\\t| username | password |\\n\\t| invalid1 | validP@55w0rd! |\\n\\t| invalid2@com | validP@55w0rd! |\"},{\"content\":\"\\tScenario: User cannot login with invalid password\\n\\tGiven I have entered \"myname@valid.com\" into the username field\\n\\tAnd I have entered \"invalid\" into the password field\\n\\tWhen I click the login button\\n\\tThen I see I am not logged in\"},{\"content\":\"\\tExample: Login response should not flag invalid username\\n\\tGiven I have entered an invalid username into the username field\\n\\tAnd I have entered a valid password into the password field\\n\\tWhen I click the login button\\n\\tThen I see an error message\\n\\tAnd the error message does not state that the username was incorrect\"},{\"content\":\"\\tExample: Login response should not flag invalid password\\n\\tGiven I have entered an invalid password into the password field\\n\\tAnd I have entered a valid username into the username field\\n\\tWhen I click the login button\\n\\tThen I see an error message\\n\\tAnd the error message does not state that the password was incorrect\"}]",
"custom_expected": null,
"custom_steps_separated": null,
"custom_mission": null,
"custom_goals": null
}
کدهای پاسخگویی #
| کد وضعیت | توضیحات |
|---|---|
| 200 | باشه |
| 400 | بخش نامعتبر یا ناشناخته |
| 403 | مجوزهای ناکافی (دسترسی به پروژه امکان پذیر نیست) |
| 500 | خطایی رخ داد |

