-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DXCDT-409: Users commands integration tests #686
Merged
+97
−74
Merged
Changes from 10 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
8d2fe9f
Separating tests
willvedd 104c645
Fixing inability to update password
willvedd 599b399
Adding another test
willvedd d5e2462
More reliable tests
willvedd ac21297
Merge branch 'main' of https://github.com/auth0/auth0-cli into testin…
willvedd bd67736
Fixing test case
willvedd 1a4702a
Merge branch 'main' of https://github.com/auth0/auth0-cli into DXCDT-…
willvedd d32f6d1
Getting tests to pass in isolation
willvedd 5d4c361
gs
willvedd 729818e
Merge branch 'main' into DXCDT-409-users-integration-tests
willvedd 11e8e27
Merge branch 'main' into DXCDT-409-users-integration-tests
willvedd File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
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 |
---|---|---|
|
@@ -145,61 +145,6 @@ tests: | |
allow_offline_access: "false" | ||
exit-code: 0 | ||
|
||
# Test 'users create' | ||
users create and check data: | ||
command: auth0 users create --name integration-test-user-new --connection Username-Password-Authentication --email [email protected] --password testUser12 --username testuser1 --json --no-input | ||
exit-code: 0 | ||
stdout: | ||
json: | ||
email: "[email protected]" | ||
connection: "Username-Password-Authentication" | ||
|
||
users create and check output: | ||
command: auth0 users create --name integration-test-user-new2 --connection Username-Password-Authentication --email [email protected] --password testUser12 --username testuser2 --no-input | ||
exit-code: 0 | ||
stdout: | ||
contains: | ||
- EMAIL [email protected] | ||
- CONNECTION Username-Password-Authentication | ||
|
||
users show json: | ||
command: auth0 users show $(./test/integration/scripts/get-user-id.sh) --json | ||
stdout: | ||
json: | ||
email: "[email protected]" | ||
connection: "Username-Password-Authentication" | ||
exit-code: 0 | ||
|
||
users show: | ||
command: auth0 users show $(./test/integration/scripts/get-user-id.sh) | ||
stdout: | ||
contains: | ||
- EMAIL [email protected] | ||
- CONNECTION Username-Password-Authentication | ||
exit-code: 0 | ||
|
||
users search: | ||
command: auth0 users search --query user_id:"$(./test/integration/scripts/get-user-id.sh)" --number 1 --sort "name:-1" | ||
exit-code: 0 | ||
stdout: | ||
contains: | ||
- [email protected] | ||
|
||
# Test 'users update' | ||
users update email: | ||
command: auth0 users update $(./test/integration/scripts/get-user-id.sh) --email [email protected] --json --no-input | ||
stdout: | ||
json: | ||
email: [email protected] | ||
exit-code: 0 | ||
|
||
users update name: | ||
command: auth0 users update $(./test/integration/scripts/get-user-id.sh) --name integration-test-user-bettername --json --no-input | ||
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 --json --no-input | ||
|
@@ -387,15 +332,3 @@ tests: | |
update universal login branding prompts (mfa-push): | ||
command: cat ./test/integration/fixtures/update-ul-prompts-mfa-push.json | auth0 ul prompts update mfa-push | ||
exit-code: 0 | ||
|
||
users roles show: | ||
command: auth0 users roles show $(./test/integration/scripts/get-user-id.sh) | ||
exit-code: 0 | ||
|
||
users roles add: | ||
command: auth0 users roles add $(./test/integration/scripts/get-user-id.sh) -r $(./test/integration/scripts/get-role-id.sh) | ||
exit-code: 0 | ||
|
||
users roles remove: | ||
command: auth0 users roles rm $(./test/integration/scripts/get-user-id.sh) -r $(./test/integration/scripts/get-role-id.sh) | ||
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,94 @@ | ||
config: | ||
inherit-env: true | ||
|
||
tests: | ||
001 - users create and check data: | ||
command: auth0 users create --name integration-test-user-new --connection Username-Password-Authentication --email [email protected] --password testUser12 --username testuser1 --json --no-input | ||
exit-code: 0 | ||
stdout: | ||
json: | ||
email: "[email protected]" | ||
connection: "Username-Password-Authentication" | ||
|
||
002 - users create and check output: | ||
command: auth0 users create --name integration-test-user-new2 --connection Username-Password-Authentication --email [email protected] --password testUser12 --username testuser2 --no-input | ||
exit-code: 0 | ||
stdout: | ||
contains: | ||
- EMAIL [email protected] | ||
- CONNECTION Username-Password-Authentication | ||
|
||
003 - users create test user: | ||
command: ./test/integration/scripts/get-user-id.sh | ||
exit-code: 0 | ||
|
||
004 - users show json: | ||
command: auth0 users show $(./test/integration/scripts/get-user-id.sh) --json | ||
stdout: | ||
json: | ||
email: "[email protected]" | ||
connection: "Username-Password-Authentication" | ||
exit-code: 0 | ||
|
||
005 - users show: | ||
command: auth0 users show $(./test/integration/scripts/get-user-id.sh) | ||
stdout: | ||
contains: | ||
- EMAIL [email protected] | ||
- CONNECTION Username-Password-Authentication | ||
exit-code: 0 | ||
|
||
005 - users search: | ||
command: auth0 users search --query user_id:"$(./test/integration/scripts/get-user-id.sh)" --number 1 --sort "name:-1" | ||
exit-code: 0 | ||
stdout: | ||
contains: | ||
- [email protected] | ||
006 - users search with invalid number flag: | ||
command: auth0 users search --query "*" --number 1001 | ||
exit-code: 1 | ||
stderr: | ||
contains: | ||
- number flag invalid, please pass a number between 1 and 1000 | ||
|
||
007 - users update minimal flags: | ||
command: auth0 users update $(./test/integration/scripts/get-user-id.sh) --json --no-input | ||
stdout: | ||
contains: | ||
- "id" | ||
exit-code: 0 | ||
|
||
008 - users update password: #needs to be done in isolation | ||
command: auth0 users update $(./test/integration/scripts/get-user-id.sh) --password 'S0me-new-P@$$Word' --json --no-input | ||
stdout: | ||
json: | ||
password: "S0me-new-P@$$Word" | ||
exit-code: 0 | ||
|
||
009 - users update maximal flags: | ||
command: auth0 users update $(./test/integration/scripts/get-user-id.sh) --email [email protected] --connection Username-Password-Authentication --name integration-test-user-bettername --json --no-input | ||
stdout: | ||
json: | ||
email: [email protected] | ||
name: integration-test-user-bettername | ||
connection: Username-Password-Authentication | ||
exit-code: 0 | ||
|
||
010 - users roles show: | ||
command: auth0 users roles show $(./test/integration/scripts/get-user-id.sh) | ||
exit-code: 0 | ||
|
||
011 - users roles add: | ||
command: auth0 users roles add $(./test/integration/scripts/get-user-id.sh) -r $(./test/integration/scripts/get-role-id.sh) | ||
exit-code: 0 | ||
|
||
012 - users roles remove: | ||
command: auth0 users roles rm $(./test/integration/scripts/get-user-id.sh) -r $(./test/integration/scripts/get-role-id.sh) | ||
exit-code: 0 | ||
|
||
013 - open user dashboard page: | ||
command: auth0 users open $(./test/integration/scripts/get-user-id.sh) --no-input | ||
exit-code: 0 | ||
stderr: | ||
contains: | ||
- "Open the following URL in a browser: https://manage.auth0.com/dashboard/" |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fixes a bug where password would not be able to be update because you cannot update both email and password simultaneously.