GUI Testing
For the automation of the MidPoint GUI testing, Selenide library is used (for more information, please, visit http://selenide.org/). It is a wrapper for Selenium WebDriver.
To start automation tests creating, please, follow the following steps:
-
Install Mozilla Firefox.
-
Install FireBug plugin for Firefox (FireBug is used just for specifying of the GUI element identifier, e.g. element path, name…)
-
Java is to be installed as well.
Project structure:
To separate all automation tests to the individual group, selenidetest module was created in the project. It is created as a child module of the testing one. So the full path to it within the project is midpoint/testing/selenidetest.
Change site url:
To change site url, edit midpoint/testing/selenidetest/testng.xml and site.url parameter.
Pom.xml:
To use Selenide library, maven dependency is to be added to pom.xml file.
Running the tests:
To run tests you can use one of the following way:
-
Using cmd
-
Run cmd and change dir to the …/midpoint/testing/selenidetest.
-
Run "mvn test -P guitest" command.
-
-
Using IDEA IDE
-
Select Run → Edit configurations menu item.
-
Add New Configuration by clicking plus sign in the left upper corner.
-
Select TestNG from the appeared list
-
Set the following values:
Select Suite radio button
Suite: select path to the …/midpoint/testing/selenidetest/testng.xml file
Working directory: select path to the …/midpoint/testing/selenidetest
Use classpath of module: set "selenidetest"
If there is no "selenidetest" module in the list of modules for "Use classpath of module" setting, please, follow the next steps: open File → Project Structure window. Select Modules view. Click on "+" sign to add new module, select Import Module. In the opened Select File or Directory to Import window, select midpoint/testing/selenidetest/pom.xml file. In the opened Import Module from Maven window, leave default settings to be applied and just click Next/Apply button. After selenidetest module is added to project structure, please, add it to "_Use classpath of module" _setting for Run Configuration. -
Save configuration
-
Select created TestNG configuration from "Select Run/Debug Configuration" drop down list, click Run button
-
Basic scenarios:
To make sure that the system was installed successfully and it works, the suite of basic scenarios was created. It covers the very basic test cases within login, user’s, account’s, organization’s and role’s functionalities.
Category | Scenario | Status | Implemented in | Test description |
---|---|---|---|---|
Scenario 1 |
🗸 |
Login test with correct credentials |
||
Scenario 2 |
🗸 |
Attempt to log in with incorrect name |
||
Scenario 3 |
🗸 |
Attempt to log in without user name |
||
Scenario 4 |
🗸 |
Attempt to log in with incorrect password |
||
Scenario 5 |
🗸 |
Attempt to log in without password |
||
Simple User Tests |
Scenario 1 |
🗸 |
Create new user with user name value only |
|
Scenario 2 |
🗸 |
Create new user with all user details fields |
||
Scenario 3 |
🗸 |
Update user information test |
||
Scenario 4 |
🗸 |
Cancel user update and check data are not changed. |
||
Scenario 5 |
🗸 |
Attempt to create a new user without user name |
||
Scenario 6 |
🗸 |
Attempt to create a user with already existing user name value |
||
Scenario 7 |
🗸 |
Delete existing user |
||
Scenario 1 |
🗸 |
Create user, assign End user role to this user. |
||
Scenario 2 |
🗸 |
Log in to midPoint as user from the previous test |
||
Scenario 3 |
🗸 |
Log in as user with End user role assigned, reset password and relogin with new password |
||
Scenario 1 |
🗸 |
Create user, assign Superuser role to created user |
||
Scenario 2 |
🗸 |
Log in to the system with user with Superuser role assigned |
||
Scenario 3 |
🗸 |
Disable user with Superuser role assigned, attempt to log in with disabled status |
||
Scenario 4 |
🗸 |
Enable user with Superuser role assigned, log in to the system. |
||
Scenario 1 |
🗸 |
Create new role through Roles → New role page |
||
Scenario 2 |
🗸 |
Update the role fields values |
||
Scenario 3 |
🗸 |
Delete the role |
||
Scenario 1 |
🗸 |
Create new organization through Users → New organization page |
||
Scenario 2 |
🗸 |
Create sub organization for organization created in the Scenario 1 |
||
Scenario 3 |
🗸 |
Update organization created in the Scenario 1 |
||
Scenario 4 |
🗸 |
Delete organization created in the Scenario 1 |
||
Scenario 1 |
🗸 |
Create test user, import CSV resource with synchronization opportunity, create account for test user with CSV resource, check account |
MidPoint GUI tests covering.
Extended test scenarios are described in the following table:
Category | Scenario | Status | Implemented in | Test description |
---|---|---|---|---|
Scenario 1 |
(?) |
Import OpenDJ resource from"opendj-localhost-resource-sync-no-extension-advanced.xml" file |
||
Scenario 2 |
(?) |
ResourceUserAccountTests.test002checkResourceConnectionTest() |
Test imported resource connection |
|
Scenario 3 |
(?) |
Create user, add account with imported resource to this user |
||
Scenario 4 |
(?) |
ResourceUserAccountTests.test004updateAccountAttributesTest() |
Update account attributes (Common Name, Surname), check if user’s attributes are updated as well |
|
Scenario 1 |
(?) |
OrganizationStructureTests.test001importOrganizationStructureFromFileTest() |
Import organization structure from "org-monkey-island-simple.xml" file |
|
Scenario 2 |
(?) |
Assign organization to user. Check if organization was assigned to user on the User’s details page and on the Organizations Tree page |
||
Scenario 3 |
(?) |
Unassign organization from user. Check if ser was unassigned. |
||
Object Template Tests |
Scenario 1 |
(?) |
ObjectTemplateTests.test001supplyUserAttributesByObjectTemplateTest() |
Check if user’s credentials are updated according to User Template settings |
Note: almost all tests use midPoint searches for different objects, e.g. search for user on Users page, search for resource in Select resource(s) window while adding account, etc. So there is no separate test for such functionality as it is tested within another tests.
Legend:
🗸 - fully implemented
(?) - partially implemented, work in progress
- not implemented at all