apinf / platform

Apinf - Open source API management platform with multi proxy and protocol support
https://apinf.com/
European Union Public License 1.1
74 stars 35 forks source link

Test plan for Tenant in APInf #3726

Open matleppa opened 5 years ago

matleppa commented 5 years ago

Testing is needed.

matleppa commented 5 years ago

General instructions for Tenant UI functionality

In order to be able to use Tenant Management UI on Apinf Platform, there are some conditions to be met.

Configuring Platform Settings

Configuring Platform login

On Tenant IdM side

Note! in Application there are Client ID and Secret, which are used when signin in to Platform via Fiware login

On Platform side

Note! This can also be done during first sign-in, via form "Configure Fiware"

matleppa commented 5 years ago

Testing of Tenant UI functionality

Prerequisite

  1. Privileges in Tenant manager

    • User needs an account in Tenant IdM, if you do not have it, create one
    • create an Application
    • URL: http://localhost:3000 (if using localhost)
    • Callback URL: http://localhost:3000/_oauth/fiware
    • in successfully created Application you get tokens "Client Id" and "Client Secret", which are used in APInf Keyrock OAuth.
  2. Make sure, that Fiware login is available.

    • APInf > Settings > Disabled login methods
    • if Fiware is ticked, untick it
    • Save
  3. Configure Tenant manager address

  4. Login using Fiware as OAuth service

    • Sign in.
    • If you see button "Configure Fiware", click it and fill in Fiware credentials (gotten from Tenant manager)
    • Root Url: https://accounts.tampere.apinf.cloud
    • Client ID: See step 1 ("Client Id")
    • Secret: See step 1 ("Client Secret")
    • if you see button "Sign in with Fiware", click it
    • Tenant IdM login opens in a new modal
    • sign in, you'll be signed in APInf
matleppa commented 5 years ago

Testing of Tenant UI functionality

1. Login

1.1 Login with username and password

Steps

  1. Click button "Sign in"
  2. Fill in username and password

Expected results

  1. You are logged in. In main menu the selection "Tenant" is not shown.

1.2 Login with Fiware OAuth

Steps

  1. Click button "Sign in with Fiware"
  2. Sign in to Tenant IdM

Expected results

  1. You are logged in. In main menu the selection "Tenant" is shown.
matleppa commented 5 years ago

Testing of Tenant UI functionality

2. Checking Authorization

2.1 Checking Authorization (valid)

Steps

  1. Sign in with Fiware OAuth
  2. Click button "Tenant" on main menu
  3. Click button "Authorization" on Tenant menu

Expected results

  1. Tenant authorization modal opens. Authorization token expiration time is shown. Time is in future, text is black.

2.2 Checking Authorization (not valid)

Steps

  1. Sign in with Fiware OAuth
  2. Click button "Tenant" on main menu
  3. Wait over 1 hour
  4. Click button "Authorization" on Tenant menu

Expected results

  1. Tenant authorization modal opens. Authorization token expiration time is shown. Time is in past, text is red.
matleppa commented 5 years ago

Testing of Tenant UI functionality

3. Listing Tenants

3.1 Fetching Tenant list (menu)

Steps

  1. Sign in with Fiware OAuth
  2. Click button "Tenant" on main menu

Expected results

  1. Tenant page opens. List of tenants is shown (if available, else "No tenants").

3.2 Fetching Tenant list (refresh)

Steps

  1. Sign in with Fiware OAuth
  2. Click button "Tenant" on main menu
  3. Click Refresh button on browser

Expected results

  1. Tenant page is refreshed. List of tenants is shown (if available, else "No tenants").

3.3 Fetching Tenant list containing tenants both owned and membered

Two users (QQQ and WWW) are needed.

Steps

User QQQ
  1. Sign in with Fiware OAuth
  2. Click button "Tenant" on main menu
  3. Add Tenant XX successfully with user WWW as data-consumer (help: 4.1.3)
User WWW
  1. Sign in with Fiware OAuth
  2. Click button "Tenant" on main menu
  3. Add tenant YY successfully.
User QQQ
  1. In tenant XX change user WWW role to data-provider successfully.
User WWW
  1. Refresh Tenant page

Expected results (WWW)

  1. Tenant page is opened. List of tenants is shown containing tenant XX. Buttons "Edit tenant" and "Remove tenant" are not shown in tenant XX.
  2. Tenant list is updated. Tenant list includes tenant XX without buttons "Edit tenant" and "Remove tenant". Tenant YY is included with buttons "Edit tenant" and "Remove tenant" visible.
  3. Tenant list is updated. Tenant list includes tenant XX with buttons "Edit tenant" and "Remove tenant". Tenant YY is included with buttons "Edit tenant" and "Remove tenant" visible.
matleppa commented 5 years ago

Testing of Tenant UI functionality

In case Menu > Settings > Mail is enabled, a notification to user can be sent.

4. Adding Tenants

4.1 Successful cases

4.1.1 Add a new Tenant (no users)

Steps

  1. Sign in with Fiware OAuth
  2. Click button "Tenant" on main menu
  3. Click button "Add Tenant" on Tenant menu
  4. Fill in Tenant name XX
  5. Fill in Tenant Description "Some text"
  6. Click button "Yes, add Tenant"

Expected results

  1. Modal "Add new Tenant" opens.
  2. Modal closes. Alert "Tenant added successfully" appears. Tenant list is fetched. Tenant XX is included in list. Tenant has description "Some text".

4.1.2 Add a new Tenant (user without roles)

Steps

  1. Sign in with Fiware OAuth
  2. Click button "Tenant" on main menu
  3. Click button "Add Tenant" on Tenant menu
  4. Fill in Tenant name XX
  5. Fill in Tenant Description
  6. Select a User ZZ from list
  7. Click button "Add user for Tenant"
  8. Click button "Yes, add Tenant"

Expected results

  1. Modal "Add new Tenant" opens.
  2. User ZZ is added into Tenant user list without roles.
  3. Modal closes. Alert "Tenant added successfully" appears. Tenant list is fetched. Tenant XX is included in list. User ZZ is included in Tenant users. Note! Role data-consumer is provided to user ZZ.

4.1.3 Add a new Tenant (user with role data-consumer)

Steps

  1. Sign in with Fiware OAuth
  2. Click button "Tenant" on main menu
  3. Click button "Add Tenant" on Tenant menu
  4. Fill in Tenant name XX-2
  5. Fill in Tenant Description
  6. Select a User from list (ZZ)
  7. Click button "Add user for Tenant"
  8. Provide role "data-consumer" to user ZZ by ticking the box a) tick box "Notify User" b) untick "Notify user"
  9. Click button "Yes, add Tenant"

Expected results

  1. Modal "Add new Tenant" opens.
  2. User ZZ is added into Tenant user list without roles.
  3. Modal closes. Alert "Tenant added successfully" appears. Tenant list is fetched. Tenant XX-2 is included in list. User ZZ is included in Tenant user list. Role data-consumer is provided to user ZZ. a) a notification email is sent to ZZ. "Tenant added, user ZZ role data-consumer". b) no notification mail

4.1.4 Add a new Tenant (user with role data-provider)

Steps

  1. Sign in with Fiware OAuth
  2. Click button "Tenant" on main menu
  3. Click button "Add Tenant" on Tenant menu
  4. Fill in Tenant name XX-2
  5. Fill in Tenant Description
  6. Select a User from list (ZZ)
  7. Click button "Add user for Tenant"
  8. Provide role "data-provider" to user ZZ by ticking box a) tick box "Notify User" b) untick "Notify user"
  9. Click button "Yes, add Tenant"

Expected results

  1. Modal "Add new Tenant" opens.
  2. User ZZ is added into Tenant user list without roles.
  3. Modal closes. Alert "Tenant added successfully" appears. Tenant list is fetched. Tenant XX-2 is included in list. User ZZ is included in Tenant user list. Note! Roles data-consumer and data-provider are provided to user ZZ. a) a notification email is sent to ZZ. "Tenant added, user ZZ roles data-consumer and data-provider". b) no notification mail

4.1.5 Add a new Tenant (user with roles data-provider and data-consumer)

Steps

  1. Sign in with Fiware OAuth
  2. Click button "Tenant" on main menu
  3. Click button "Add Tenant" on Tenant menu
  4. Fill in Tenant name XX-2
  5. Fill in Tenant Description
  6. Select a User from list (ZZ)
  7. Click button "Add user for Tenant"
  8. Provide role "data-provider" to user ZZ a) tick box "Notify User" b) untick "Notify user"
  9. Click button "Yes, add Tenant"

Expected results

  1. Modal "Add new Tenant" opens.
  2. User ZZ is added into Tenant user list without roles.
  3. Modal closes. Alert "Tenant added successfully" appears. Tenant list is fetched. Tenant XX-2 is included in list. User ZZ is included in Tenant user list. Roles data-consumer and data-provider are provided to user ZZ. a) a notification email is sent to ZZ. "Tenant added, user ZZ roles data-consumer and data-provider". b) no notification mail

4.1.6 Add a new Tenant (2 users with different roles)

Steps

  1. Sign in with Fiware OAuth
  2. Click button "Tenant" on main menu
  3. Click button "Add Tenant" on Tenant menu
  4. Fill in Tenant name XX-2
  5. Fill in Tenant Description
  6. Select a User from list (ZZ)
  7. Click button "Add user for Tenant"
  8. Provide role "data-provider" to user ZZ a) tick box "Notify User" b) untick "Notify user"
  9. Select a User from list (AA)
  10. Click button "Add user for Tenant"
  11. Provide role "data-consumer" to user AA a) tick box "Notify User" b) untick "Notify user"
  12. Click button "Yes, add Tenant"

Expected results

  1. Modal "Add new Tenant" opens.
  2. Modal closes. Alert "Tenant added successfully" appears. Tenant list is fetched. Tenant XX-2 is included in list. User ZZ is included in Tenant with roles data-consumer and data-provider. User AA is included in Tenant with role data-consumer. a) a notification email is sent to ZZ/AA. "Tenant added, user ZZ/AA roles mentioned". b) no notification mail

4.2 Failing cases

4.2.1 Try to add a new Tenant (with name that already exists)

Steps

  1. Sign in with Fiware OAuth
  2. Click button "Tenant" on main menu
  3. Click button "Add Tenant" on Tenant menu
  4. Fill in Tenant name XXX
  5. Fill in Tenant Description "Some text"
  6. Click button "Yes, add Tenant"
  7. Click button "Add Tenant" on Tenant menu
  8. Fill in Tenant name XXX (same name as in step 4)
  9. Fill in Tenant Description "Some text to describe"
  10. Click button "Yes, add Tenant"

Expected results

  1. Modal "Add new Tenant" opens.
  2. Alert "Tenant added successfully" appears. Tenant list is fetched. Tenant XX is included in list. Tenant has description "Some text".
  3. Modal remains open. Alert "Tenant operation failed! (Error: [failed [409] {"error": "The tenant XXX is already registered"}])." appears.

4.2.2 Try to add a new Tenant (without name and description)

Steps

  1. Sign in with Fiware OAuth
  2. Click button "Tenant" on main menu
  3. Click button "Add Tenant" on Tenant menu
  4. Click button "Yes, add Tenant"

Expected results

  1. Modal remains open. Alert "Tenant must have a name!" appears.

4.2.3 Try to add a new Tenant (without description)

Steps

  1. Sign in with Fiware OAuth
  2. Click button "Tenant" on main menu
  3. Click button "Add Tenant" on Tenant menu
  4. Fill in tenant name "QWERTY"
  5. Click button "Yes, add Tenant"

Expected results

  1. Modal remains open. Alert "Tenant must have a description!" appears.

4.2.4 Try to add a new Tenant (with same id as an already existing tenant has)

Note! IdM forms id for Tenant based on Tenant name.

Steps

  1. Sign in with Fiware OAuth
  2. Click button "Tenant" on main menu
  3. Click button "Add Tenant" on Tenant menu
  4. Fill in tenant name "åöä"
  5. Fill in other tenant data correctly
  6. Click button "Yes, add Tenant"
  7. Click button "Add Tenant" on Tenant menu
  8. Fill in tenant name "aoa"
  9. Fill in other tenant data correctly
  10. Click button "Yes, add Tenant"

Expected results

  1. Modal closes. Alert "Tenant added successfully" appears.
  2. Modal remains open. Alert "Tenant operation failed! (Error: [failed [409] {"error": "The tenant aoa is already registered"}])." appears.

4.2.5 Try to add a new Tenant (when token has expired)

Steps

  1. Sign in with Fiware OAuth
  2. Click button "Tenant" on main menu
  3. Wait over an hour.
  4. Click button "Authorization" to find out, that token has expired
  5. Click button "Add Tenant" on Tenant menu
  6. Fill in tenant name and description correctly
  7. Click button "Yes, add Tenant"

Expected results

  1. Modal remains open. Alert "Tenant operation failed! (Error: [failed [403] { "error": { "code": "API_KEY_OR_TOKEN_INVALID", "message": "An invalid api_key or token was supplied. Get one at https://umbrella.tampere.apinf.cloud" } }])." appears.

4.3 Unfinished operations

4.3.1 Begin Add Tenant (but Cancel by button)

Steps

  1. Sign in with Fiware OAuth
  2. Click button "Tenant" on main menu
  3. Click button "Add Tenant" on Tenant menu
  4. Fill info on Tenant
  5. Click button "No, cancel"

Expected results

  1. Modal closes. No changes in Tenant list.

4.3.2 Begin Add Tenant (but Cancel by close)

Steps

  1. Sign in with Fiware OAuth
  2. Click button "Tenant" on main menu
  3. Click button "Add Tenant" on Tenant menu
  4. Fill info on Tenant
  5. Click button "X" in upper right corner of modal

Expected results

  1. Modal closes. No changes in Tenant list.

4.3.3 Begin Add Tenant (but Cancel by click outside modal)

Steps

  1. Sign in with Fiware OAuth
  2. Click button "Tenant" on main menu
  3. Click button "Add Tenant" on Tenant menu
  4. Fill info on Tenant
  5. Click screen outside the modal

Expected results

  1. Modal closes. No changes in Tenant list.
matleppa commented 5 years ago

Testing of Tenant UI functionality

5. Modifying Tenants

Modify Tenant (change Tenant name)

Steps

  1. Sign in with Fiware OAuth
  2. Click button "Tenant" on main menu
  3. Add tenant QWERTY successfully
  4. Select Tenant QWERTY to be modified - click button "Edit Tenant"
  5. Change Tenant name to YTREWQ
  6. Click button "Yes, modify Tenant"

Expected results

  1. Modal closes. Alert "Tenant modified successfully" appears. Tenant list is fetched. Tenant YTREWQ is included in tenant list.

Modify Tenant (change Tenant description)

Steps

  1. Sign in with Fiware OAuth
  2. Click button "Tenant" on main menu
  3. Add tenant QWERTY successfully with correct description
  4. Select Tenant QWERTY to be modified - click button "Edit Tenant"
  5. Change Tenant description
  6. Click button "Yes, modify Tenant"

Expected results

  1. Modal closes. Alert "Tenant modified successfully" appears. Tenant list is fetched. Tenant QWERTY is included in tenant list with changed description.

Modify Tenant (add second user)

Steps

  1. Sign in with Fiware OAuth
  2. Click button "Tenant" on main menu
  3. Add tenant QWERTY successfully with correct description and user XXX
  4. Select Tenant QWERTY to be modified - click button "Edit Tenant"
  5. Select user YYY from user list
  6. Click button "Add user for tenant"
  7. Click button "Yes, modify Tenant"

Expected results

  1. Modal "Modify tenant" opens
  2. Modal closes. Alert "Tenant modified successfully" appears. Tenant list is fetched. Tenant QWERTY is included in tenant list with users XXX and YYY.

Tenant user check failed! Refresh Tenant list and try again! Error: [failed [403] { "error": { "code": "API_KEY_OR_TOKEN_INVALID", "message": "An invalid api_key or token was supplied. Get one at https://umbrella.tampere.apinf.cloud" } }]

matleppa commented 5 years ago

Testing of Tenant UI functionality

6. Removing Tenants

6.1 Successful cases

6.1.1 Remove Tenant

Steps

  1. Sign in with Fiware OAuth
  2. Click button "Tenant" on main menu
  3. Create Tenant QWERTY
  4. Select Tenant QWERTY to be removed - click button "Remove tenant"
  5. Click button "Yes, remove Tenant"

Expected results

  1. Tenant QWERTY is created successfully
  2. Modal "Tenant removal" opens
  3. Modal closes. Alert "Tenant removed successfully" appears. Tenant list is fetched. Tenant QWERTY is NOT included in tenant list.

6.2 Failing cases

6.2.1 Try to remove a new Tenant (when token has expired)

Steps

  1. Sign in with Fiware OAuth
  2. Click button "Tenant" on main menu
  3. Create Tenant QWERTY
  4. Wait over an hour.
  5. Click button "Authorization" to find out, that token has expired
  6. Select Tenant QWERTY to be removed - click button "Remove tenant"
  7. Click button "Yes, remove Tenant"

Expected results

  1. Modal "Tenant removal" opens
  2. Modal remains open. Alert "Tenant removal failed! (Error: [failed [403] { "error": { "code": "API_KEY_OR_TOKEN_INVALID", "message": "An invalid api_key or token was supplied. Get one at https://umbrella.tampere.apinf.cloud" } }])." appears.

6.3 Unfinished operations

6.3.1 Begin Remove Tenant (but Cancel by button)

Steps

  1. Sign in with Fiware OAuth
  2. Click button "Tenant" on main menu
  3. Create Tenant QWERTY
  4. Select Tenant QWERTY to be removed - click button "Remove tenant"
  5. Click button "No, cancel"

Expected results

  1. Tenant QWERTY is created successfully
  2. Modal "Tenant removal" opens
  3. Modal closes. No changes in Tenant list.

6.3.2 Begin Remove Tenant (but Cancel by close)

Steps

  1. Sign in with Fiware OAuth
  2. Click button "Tenant" on main menu
  3. Create Tenant QWERTY
  4. Select Tenant QWERTY to be removed - click button "Remove tenant"
  5. Click button "X" in upper right corner of modal

Expected results

  1. Tenant QWERTY is created successfully
  2. Modal "Tenant removal" opens
  3. Modal closes. No changes in Tenant list.

6.3.3 Begin Remove Tenant (but Cancel by click outside modal)

Steps

  1. Sign in with Fiware OAuth
  2. Click button "Tenant" on main menu
  3. Create Tenant QWERTY
  4. Select Tenant QWERTY to be removed - click button "Remove tenant"
  5. Click screen outside the modal

Expected results

  1. Tenant QWERTY is created successfully
  2. Modal "Tenant removal" opens
  3. Modal closes. No changes in Tenant list.