Skip to content

Commit

Permalink
test: add CliKintoneTest-30, CliKintoneTest-31, CliKintoneTest-32 (#572)
Browse files Browse the repository at this point in the history
  • Loading branch information
tuanphamcybozu authored Nov 17, 2023
1 parent 527e130 commit cee702c
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/test-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,6 @@ jobs:
TEST_KINTONE_CREDENTIAL_MANAGEMENT_API_TOKEN: ${{ secrets.TEST_KINTONE_CREDENTIAL_MANAGEMENT_API_TOKEN }}
TEST_KINTONE_USERNAME_UNPRIVILEGED: ${{ secrets.TEST_KINTONE_USERNAME_UNPRIVILEGED }}
TEST_KINTONE_PASSWORD_UNPRIVILEGED: ${{ secrets.TEST_KINTONE_PASSWORD_UNPRIVILEGED }}
TEST_KINTONE_USERNAME_ADD_PERMISSION: ${{ secrets.TEST_KINTONE_USERNAME_ADD_PERMISSION }}
TEST_KINTONE_PASSWORD_ADD_PERMISSION: ${{ secrets.TEST_KINTONE_PASSWORD_ADD_PERMISSION }}
run: pnpm test:e2e
48 changes: 48 additions & 0 deletions features/import.feature
Original file line number Diff line number Diff line change
Expand Up @@ -131,3 +131,51 @@ Feature: cli-kintone import command
When I run the command with args "record import --base-url $$TEST_KINTONE_BASE_URL --app $APP_ID --api-token $API_TOKEN_IMPORT --file-path CliKintoneTest-29.csv --update-key Record_number"
Then I should get the exit code is non-zero
And The output error message should match with the pattern: "\[403\] \[GAIA_NO01\] Using this API token, you cannot run the specified API."

Scenario: CliKintoneTest-30 Should import the records successfully with username and password
Given The app "app_for_import" has no records
And The csv file "CliKintoneTest-30.csv" with content as below:
| Text | Number |
| Alice | 10 |
| Bob | 20 |
| Jenny | 30 |
And Load app ID of app "app_for_import" as env var: "APP_ID"
When I run the command with args "record import --base-url $$TEST_KINTONE_BASE_URL --app $APP_ID --username $$TEST_KINTONE_USERNAME_ADD_PERMISSION --password $$TEST_KINTONE_PASSWORD_ADD_PERMISSION --file-path CliKintoneTest-30.csv"
Then I should get the exit code is zero
And The app "app_for_import" should has records as below:
| Text | Number |
| Alice | 10 |
| Bob | 20 |
| Jenny | 30 |

Scenario: CliKintoneTest-31 Should import the records successfully with username (-u option) and password
Given The app "app_for_import" has no records
And The csv file "CliKintoneTest-31.csv" with content as below:
| Text | Number |
| Alice | 10 |
| Bob | 20 |
| Jenny | 30 |
And Load app ID of app "app_for_import" as env var: "APP_ID"
When I run the command with args "record import --base-url $$TEST_KINTONE_BASE_URL --app $APP_ID -u $$TEST_KINTONE_USERNAME_ADD_PERMISSION --password $$TEST_KINTONE_PASSWORD_ADD_PERMISSION --file-path CliKintoneTest-31.csv"
Then I should get the exit code is zero
And The app "app_for_import" should has records as below:
| Text | Number |
| Alice | 10 |
| Bob | 20 |
| Jenny | 30 |

Scenario: CliKintoneTest-32 Should import the records successfully with username and password (-p option)
Given The app "app_for_import" has no records
And The csv file "CliKintoneTest-32.csv" with content as below:
| Text | Number |
| Alice | 10 |
| Bob | 20 |
| Jenny | 30 |
And Load app ID of app "app_for_import" as env var: "APP_ID"
When I run the command with args "record import --base-url $$TEST_KINTONE_BASE_URL --app $APP_ID --username $$TEST_KINTONE_USERNAME_ADD_PERMISSION -p $$TEST_KINTONE_PASSWORD_ADD_PERMISSION --file-path CliKintoneTest-32.csv"
Then I should get the exit code is zero
And The app "app_for_import" should has records as below:
| Text | Number |
| Alice | 10 |
| Bob | 20 |
| Jenny | 30 |

0 comments on commit cee702c

Please sign in to comment.