-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CLI-167] integration test for roles (#309)
* [CLI-167] integration test for roles * Update integration/get-role-id.sh Co-authored-by: Rita Zerrizuela <[email protected]>
- Loading branch information
1 parent
22e4114
commit 383439d
Showing
3 changed files
with
80 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,9 @@ tests: | |
auth0 tenants list: | ||
exit-code: 0 | ||
|
||
auth0 roles list: | ||
exit-code: 0 | ||
|
||
auth0 rules list: | ||
exit-code: 0 | ||
|
||
|
@@ -426,4 +429,57 @@ tests: | |
stdout: | ||
json: | ||
Email: [email protected] # Name is not being displayed, hence using email | ||
exit-code: 0 | ||
|
||
# Test 'roles create' | ||
roles create and check data: | ||
command: auth0 roles create --name integration-test-role-new1 --description testRole --format json --no-input | ||
exit-code: 0 | ||
stdout: | ||
json: | ||
Name: integration-test-role-new1 | ||
Description: testRole | ||
|
||
roles create and check output: | ||
command: auth0 roles create --name integration-test-role-new2 --description testRole2 --no-input | ||
stdout: | ||
contains: | ||
- NAME integration-test-role-new2 | ||
- DESCRIPTION testRole2 | ||
exit-code: 0 | ||
|
||
# Test 'roles show' | ||
roles create test role: | ||
command: ./integration/get-role-id.sh | ||
exit-code: 0 | ||
|
||
roles show json: | ||
command: auth0 roles show $(cat ./integration/identifiers/role-id) --format json | ||
stdout: | ||
json: | ||
Name: integration-test-role-newRole | ||
Description: integration-test-role | ||
exit-code: 0 | ||
|
||
roles show: | ||
command: auth0 roles show $(cat ./integration/identifiers/role-id) | ||
stdout: | ||
contains: | ||
- NAME integration-test-role-newRole | ||
- DESCRIPTION integration-test-role | ||
exit-code: 0 | ||
|
||
# Test 'roles update' | ||
roles update name: | ||
command: auth0 roles update $(cat ./integration/identifiers/role-id) --name integration-test-role-betterName --format json | ||
stdout: | ||
json: | ||
Name: integration-test-role-betterName | ||
exit-code: 0 | ||
|
||
roles update description: | ||
command: auth0 roles update $(cat ./integration/identifiers/role-id) --description betterDescription --format json | ||
stdout: | ||
json: | ||
Description: betterDescription | ||
exit-code: 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#! /bin/bash | ||
|
||
role=$( auth0 roles create -n integration-test-role-newRole -d integration-test-role --format json --no-input ) | ||
|
||
mkdir -p ./integration/identifiers | ||
echo "$role" | jq -r '.["ID"]' > ./integration/identifiers/role-id |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters