Skip to content

Commit

Permalink
test: add new test cases for CliKintoneTest-134-144-166 (#626)
Browse files Browse the repository at this point in the history
  • Loading branch information
hung-cybo authored Dec 12, 2023
1 parent ea5b24e commit d866c47
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions features/delete.feature
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,13 @@ Feature: cli-kintone delete command
Then I should get the exit code is non-zero
And The output error message should match with the pattern: "\[520] \[GAIA_IA02] The specified API token does not match the API token generated via an app."

Scenario: CliKintoneTest-134 Should return the error message when authorizing with username/password.
Given Load app ID of the app "app_for_delete" as env var: "APP_ID"
And Load username and password of the app "app_for_delete" with exact permissions "view,delete" as env vars: "USERNAME" and "PASSWORD"
When I run the command with args "record delete --app $APP_ID --base-url $$TEST_KINTONE_BASE_URL --username $USERNAME --password $PASSWORD --yes"
Then I should get the exit code is non-zero
And The output error message should match with the pattern: "ERROR: The delete command only supports API token authentication."

Scenario: CliKintoneTest-135 Should delete the specified records successfully by --file-path option.
Given The app "app_for_delete" has no records
And The app "app_for_delete" has some records as below:
Expand Down Expand Up @@ -224,6 +231,19 @@ Feature: cli-kintone delete command
Then I should get the exit code is non-zero
And The output error message should match with the pattern: "Invalid record number. ID: NonExistentAppCode-1"

Scenario: CliKintoneTest-144 Should delete the records without the delete confirmation message when specifying the -y option.
Given The app "app_for_delete" has no records
And The app "app_for_delete" has some records as below:
| Text | Number |
| Alice | 10 |
| Bob | 20 |
| Jenny | 30 |
And Load app ID of the app "app_for_delete" as env var: "APP_ID"
And Load app token of the app "app_for_delete" with exact permissions "view,delete" as env var: "API_TOKEN"
When I run the command with args "record delete --app $APP_ID --base-url $$TEST_KINTONE_BASE_URL --api-token $API_TOKEN -y"
Then I should get the exit code is zero
And The app "app_for_delete" should have no records

Scenario: CliKintoneTest-149 Should delete the records of the app in a guest space.
Given The app "app_in_guest_space" has no records
And The app "app_in_guest_space" has some records as below:
Expand All @@ -245,6 +265,14 @@ Feature: cli-kintone delete command
Then I should get the exit code is non-zero
And The output error message should match with the pattern: "ERROR: \[403] \[CB_NO02] No privilege to proceed.."

Scenario: CliKintoneTest-166 Should return the warning message when the specified app does not have any records.
Given The app "app_for_delete" has no records
And Load app ID of the app "app_for_delete" as env var: "APP_ID"
And Load app token of the app "app_for_delete" with exact permissions "view,delete" as env var: "API_TOKEN"
When I run the command with args "record delete --app $APP_ID --base-url $$TEST_KINTONE_BASE_URL --api-token $API_TOKEN --yes"
Then I should get the exit code is zero
And The output error message should match with the pattern: "WARN: The specified app does not have any records."

Scenario: CliKintoneTest-171 Should return the error message when the record number field code does not exist in the CSV file.
Given The CSV file "CliKintoneTest-171.csv" with content as below:
| Text | Number |
Expand Down

0 comments on commit d866c47

Please sign in to comment.