platform
platform copied to clipboard
Test plan for Tenant in APInf
Testing is needed.
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.
- an Admin User on Platform is needed to do basic configuration
- a User with Tenant IdM account is needed to perform the Tenant management operations.
Configuring Platform Settings
- sign in as an Admin User in Apinf Platform
- open Menu > Settings
- ensure, that Mail settings are filled in properly ("Mail" is enabled and fields aare filled correctly). When "Mail" is enabled, it is possible to inform Tenant users about changes concerning them.
- ensure, that Fiware login is NOT disabled
- tick "Tenant" to enabled
- fill Tenant IdM host URL and basepath in field "Basepath", e.g. "https://umbrella.tampere.apinf.cloud/tenant-manager/"
- save Settings
Configuring Platform login
On Tenant IdM side
- sign in to corresponding Tenant IdM
- create or ensure, that a suitable Application exists
- ensure, that URLs in Application are configured correctly, e.g.
Note! in Application there are Client ID and Secret, which are used when signin in to Platform via Fiware login
On Platform side
- sign in as an Admin User in Apinf Platform
- open Menu > Login platforms
- fill in "Client id" and "Secret" (from Application on Tenant IdM side) and "Root URL", e.g.
- Save Login platforms
Note! This can also be done during first sign-in, via form "Configure Fiware"
Testing of Tenant UI functionality
Prerequisite
- 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.
- Make sure, that Fiware login is available.
- APInf > Settings > Disabled login methods
- if Fiware is ticked, untick it
- Save
- Configure Tenant manager address
- APInf > Settings > Tenant
- tick Enabled
- fill in address, e.g. https://umbrella.tampere.apinf.cloud/tenant-manager/
- Save
- 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
- If you see button "Configure Fiware", click it and fill in Fiware credentials (gotten from Tenant manager)
Testing of Tenant UI functionality
1. Login
1.1 Login with username and password
Steps
- Click button "Sign in"
- Fill in username and password
Expected results
- You are logged in. In main menu the selection "Tenant" is not shown.
1.2 Login with Fiware OAuth
Steps
- Click button "Sign in with Fiware"
- Sign in to Tenant IdM
Expected results
- You are logged in. In main menu the selection "Tenant" is shown.
Testing of Tenant UI functionality
2. Checking Authorization
2.1 Checking Authorization (valid)
Steps
- Sign in with Fiware OAuth
- Click button "Tenant" on main menu
- Click button "Authorization" on Tenant menu
Expected results
- Tenant authorization modal opens. Authorization token expiration time is shown. Time is in future, text is black.
2.2 Checking Authorization (not valid)
Steps
- Sign in with Fiware OAuth
- Click button "Tenant" on main menu
- Wait over 1 hour
- Click button "Authorization" on Tenant menu
Expected results
- Tenant authorization modal opens. Authorization token expiration time is shown. Time is in past, text is red.
Testing of Tenant UI functionality
3. Listing Tenants
3.1 Fetching Tenant list (menu)
Steps
- Sign in with Fiware OAuth
- Click button "Tenant" on main menu
Expected results
- Tenant page opens. List of tenants is shown (if available, else "No tenants").
3.2 Fetching Tenant list (refresh)
Steps
- Sign in with Fiware OAuth
- Click button "Tenant" on main menu
- Click Refresh button on browser
Expected results
- 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
- Sign in with Fiware OAuth
- Click button "Tenant" on main menu
- Add Tenant XX successfully with user WWW as data-consumer (help: 4.1.3)
User WWW
- Sign in with Fiware OAuth
- Click button "Tenant" on main menu
- Add tenant YY successfully.
User QQQ
- In tenant XX change user WWW role to data-provider successfully.
User WWW
- Refresh Tenant page
Expected results (WWW)
- Tenant page is opened. List of tenants is shown containing tenant XX. Buttons "Edit tenant" and "Remove tenant" are not shown in tenant XX.
- 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.
- 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.
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
- Sign in with Fiware OAuth
- Click button "Tenant" on main menu
- Click button "Add Tenant" on Tenant menu
- Fill in Tenant name XX
- Fill in Tenant Description "Some text"
- Click button "Yes, add Tenant"
Expected results
- Modal "Add new Tenant" opens.
- 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
- Sign in with Fiware OAuth
- Click button "Tenant" on main menu
- Click button "Add Tenant" on Tenant menu
- Fill in Tenant name XX
- Fill in Tenant Description
- Select a User ZZ from list
- Click button "Add user for Tenant"
- Click button "Yes, add Tenant"
Expected results
- Modal "Add new Tenant" opens.
- User ZZ is added into Tenant user list without roles.
- 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
- Sign in with Fiware OAuth
- Click button "Tenant" on main menu
- Click button "Add Tenant" on Tenant menu
- Fill in Tenant name XX-2
- Fill in Tenant Description
- Select a User from list (ZZ)
- Click button "Add user for Tenant"
- Provide role "data-consumer" to user ZZ by ticking the box a) tick box "Notify User" b) untick "Notify user"
- Click button "Yes, add Tenant"
Expected results
- Modal "Add new Tenant" opens.
- User ZZ is added into Tenant user list without roles.
- 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
- Sign in with Fiware OAuth
- Click button "Tenant" on main menu
- Click button "Add Tenant" on Tenant menu
- Fill in Tenant name XX-2
- Fill in Tenant Description
- Select a User from list (ZZ)
- Click button "Add user for Tenant"
- Provide role "data-provider" to user ZZ by ticking box a) tick box "Notify User" b) untick "Notify user"
- Click button "Yes, add Tenant"
Expected results
- Modal "Add new Tenant" opens.
- User ZZ is added into Tenant user list without roles.
- 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
- Sign in with Fiware OAuth
- Click button "Tenant" on main menu
- Click button "Add Tenant" on Tenant menu
- Fill in Tenant name XX-2
- Fill in Tenant Description
- Select a User from list (ZZ)
- Click button "Add user for Tenant"
- Provide role "data-provider" to user ZZ a) tick box "Notify User" b) untick "Notify user"
- Click button "Yes, add Tenant"
Expected results
- Modal "Add new Tenant" opens.
- User ZZ is added into Tenant user list without roles.
- 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
- Sign in with Fiware OAuth
- Click button "Tenant" on main menu
- Click button "Add Tenant" on Tenant menu
- Fill in Tenant name XX-2
- Fill in Tenant Description
- Select a User from list (ZZ)
- Click button "Add user for Tenant"
- Provide role "data-provider" to user ZZ a) tick box "Notify User" b) untick "Notify user"
- Select a User from list (AA)
- Click button "Add user for Tenant"
- Provide role "data-consumer" to user AA a) tick box "Notify User" b) untick "Notify user"
- Click button "Yes, add Tenant"
Expected results
- Modal "Add new Tenant" opens.
- 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
- Sign in with Fiware OAuth
- Click button "Tenant" on main menu
- Click button "Add Tenant" on Tenant menu
- Fill in Tenant name XXX
- Fill in Tenant Description "Some text"
- Click button "Yes, add Tenant"
- Click button "Add Tenant" on Tenant menu
- Fill in Tenant name XXX (same name as in step 4)
- Fill in Tenant Description "Some text to describe"
- Click button "Yes, add Tenant"
Expected results
- Modal "Add new Tenant" opens.
- Alert "Tenant added successfully" appears. Tenant list is fetched. Tenant XX is included in list. Tenant has description "Some text".
- 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
- Sign in with Fiware OAuth
- Click button "Tenant" on main menu
- Click button "Add Tenant" on Tenant menu
- Click button "Yes, add Tenant"
Expected results
- Modal remains open. Alert "Tenant must have a name!" appears.
4.2.3 Try to add a new Tenant (without description)
Steps
- Sign in with Fiware OAuth
- Click button "Tenant" on main menu
- Click button "Add Tenant" on Tenant menu
- Fill in tenant name "QWERTY"
- Click button "Yes, add Tenant"
Expected results
- 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
- Sign in with Fiware OAuth
- Click button "Tenant" on main menu
- Click button "Add Tenant" on Tenant menu
- Fill in tenant name "åöä"
- Fill in other tenant data correctly
- Click button "Yes, add Tenant"
- Click button "Add Tenant" on Tenant menu
- Fill in tenant name "aoa"
- Fill in other tenant data correctly
- Click button "Yes, add Tenant"
Expected results
- Modal closes. Alert "Tenant added successfully" appears.
- 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
- Sign in with Fiware OAuth
- Click button "Tenant" on main menu
- Wait over an hour.
- Click button "Authorization" to find out, that token has expired
- Click button "Add Tenant" on Tenant menu
- Fill in tenant name and description correctly
- Click button "Yes, add Tenant"
Expected results
- 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
- Sign in with Fiware OAuth
- Click button "Tenant" on main menu
- Click button "Add Tenant" on Tenant menu
- Fill info on Tenant
- Click button "No, cancel"
Expected results
- Modal closes. No changes in Tenant list.
4.3.2 Begin Add Tenant (but Cancel by close)
Steps
- Sign in with Fiware OAuth
- Click button "Tenant" on main menu
- Click button "Add Tenant" on Tenant menu
- Fill info on Tenant
- Click button "X" in upper right corner of modal
Expected results
- Modal closes. No changes in Tenant list.
4.3.3 Begin Add Tenant (but Cancel by click outside modal)
Steps
- Sign in with Fiware OAuth
- Click button "Tenant" on main menu
- Click button "Add Tenant" on Tenant menu
- Fill info on Tenant
- Click screen outside the modal
Expected results
- Modal closes. No changes in Tenant list.
Testing of Tenant UI functionality
5. Modifying Tenants
Modify Tenant (change Tenant name)
Steps
- Sign in with Fiware OAuth
- Click button "Tenant" on main menu
- Add tenant QWERTY successfully
- Select Tenant QWERTY to be modified - click button "Edit Tenant"
- Change Tenant name to YTREWQ
- Click button "Yes, modify Tenant"
Expected results
- Modal closes. Alert "Tenant modified successfully" appears. Tenant list is fetched. Tenant YTREWQ is included in tenant list.
Modify Tenant (change Tenant description)
Steps
- Sign in with Fiware OAuth
- Click button "Tenant" on main menu
- Add tenant QWERTY successfully with correct description
- Select Tenant QWERTY to be modified - click button "Edit Tenant"
- Change Tenant description
- Click button "Yes, modify Tenant"
Expected results
- 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
- Sign in with Fiware OAuth
- Click button "Tenant" on main menu
- Add tenant QWERTY successfully with correct description and user XXX
- Select Tenant QWERTY to be modified - click button "Edit Tenant"
- Select user YYY from user list
- Click button "Add user for tenant"
- Click button "Yes, modify Tenant"
Expected results
- Modal "Modify tenant" opens
- Modal closes. Alert "Tenant modified successfully" appears. Tenant list is fetched. Tenant QWERTY is included in tenant list with users XXX and YYY.
-
add several users
-
remove user
-
remove last user
-
add a role to user
-
change user roles
-
remove a role from user
-
change name and description
-
change name and description and user role
-
change name and add user
-
change description and add user
-
change name and remove user
-
change description and remove user
-
try to modify, name missing
-
try to modify, description missing
-
try to modify, name and description missing
-
try to modify, authorization expired
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" } }]
- begin modify but click Cancel
- begin modify but click Close
- begin modify but click outside modal
Testing of Tenant UI functionality
6. Removing Tenants
6.1 Successful cases
6.1.1 Remove Tenant
Steps
- Sign in with Fiware OAuth
- Click button "Tenant" on main menu
- Create Tenant QWERTY
- Select Tenant QWERTY to be removed - click button "Remove tenant"
- Click button "Yes, remove Tenant"
Expected results
- Tenant QWERTY is created successfully
- Modal "Tenant removal" opens
- 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
- Sign in with Fiware OAuth
- Click button "Tenant" on main menu
- Create Tenant QWERTY
- Wait over an hour.
- Click button "Authorization" to find out, that token has expired
- Select Tenant QWERTY to be removed - click button "Remove tenant"
- Click button "Yes, remove Tenant"
Expected results
- Modal "Tenant removal" opens
- 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
- Sign in with Fiware OAuth
- Click button "Tenant" on main menu
- Create Tenant QWERTY
- Select Tenant QWERTY to be removed - click button "Remove tenant"
- Click button "No, cancel"
Expected results
- Tenant QWERTY is created successfully
- Modal "Tenant removal" opens
- Modal closes. No changes in Tenant list.
6.3.2 Begin Remove Tenant (but Cancel by close)
Steps
- Sign in with Fiware OAuth
- Click button "Tenant" on main menu
- Create Tenant QWERTY
- Select Tenant QWERTY to be removed - click button "Remove tenant"
- Click button "X" in upper right corner of modal
Expected results
- Tenant QWERTY is created successfully
- Modal "Tenant removal" opens
- Modal closes. No changes in Tenant list.
6.3.3 Begin Remove Tenant (but Cancel by click outside modal)
Steps
- Sign in with Fiware OAuth
- Click button "Tenant" on main menu
- Create Tenant QWERTY
- Select Tenant QWERTY to be removed - click button "Remove tenant"
- Click screen outside the modal
Expected results
- Tenant QWERTY is created successfully
- Modal "Tenant removal" opens
- Modal closes. No changes in Tenant list.