WSO2 web testing framework - Part 1
- Darshana Jayasinghe
- - WSO2
Table of Contents
- What is WSO2 Web Testing Framework
- Understanding the WSO2 Web Testing Framework
- Test suites and their functionality with pre post conditions
- WSO2 Data Services Server
- WSO2 Enterprise Service Bus
- WSO2 Gadget Server
- WSO2 Identity Server
- WSO2 Mashup Sever
- WSO2 Governance Registry
- WSO2 Web Services Application Server
- System Requirements
- Setting Up The Environment
- Running Tests From runAll.sh
- Running Tests From runAll.rb
- Running Tests From IDE
- Running Tests From pom.xml
What is WSO2 Web Testing Framework
WSO2 Web Testing Framework is an automated test suite used for test following WSO2 products using Selenium web application testing system and Junit testing framework. Previously all the Quality Assurance was done by manually. But now with this automated test framework, all the products will be tested continuously.
1. WSO2 Data Services Server
2. WSO2 Enterprise Service Bus
3. WSO2 Gadget Server
4. WSO2 Identity Server
5. WSO2 Mashup Sever
6. WSO2 Governance Registry
7. WSO2 Web Services Application Server
Understanding the WSO2 Web Testing Framework
You may already have taken the svn check out from https://wso2.org/repos/wso2/branches/commons/qa/web-test-framework/
if not please take the svn check out. This will take some time and highly depend on the internet connection you have and network traffic. If you know what version you need, you can check out only the particular version and reduce your downloading time.
And you need a WSO2 product stated above to run tests against it. You may download the artifact from WSO2 Oxygen Tank download page, or from the builder machine.
- The top root folders are the WSO2 released versions.(eg. 2.0.2, 2.0.3 release ).
- Inside it has the product folders (eg. registry, wsas, mashup etc..)
- Lib folder is the local folder to store product specific resources.(eg. To store WSDLs which will uploaded from the local file system in WSO2 Governance Registry)
- Commons folder contains all the common resources in testing framework.
How it works?
- From runAll.sh file, runAll.rb file or POM.xml file apache maven will get invoked
- Maven will start Selenium Maven Plugin which plays a main role in WSO2 web testing framework.
- Seleneium Plugin is responsible to Start the Selenium server, Stop the Selenium server
- JUnit sends commands(clicking on links, form fillings) to Selenium Server then gets the results asserts the results
- Maven Surefire Plugin will create a report containing the total number of failures, errors etc..
How the tests are written?
Test suites are recorded from Selenium IDE. Selenium IDE is an integrated development environment for Selenium tests, It has a recorder, one can record the tests, save and rerun the tests again and again. But WSO2 web testing framework does not use raw test suites generated from selenium IDE. Usually common functions are created in test suites, then those functions will be called inside the tests. So high re-usability is achieved. Since common functions are used high maintainability is there, with the new releases there may be architectural changes, user interface changes. But those issues can be handled easily due to the flexible structure of the testing framework as mentioned above.
How the tests are structured ?
'common' folder has all the common functions to perform tasks in whole test framework (creating a new user, log-in to the admin console etc). This folder is a svn external for all the products which means a mirror copy of web-testing-framework/commons/src/test/java/org/wso2/carbon/web/test/common folder.
Test suites and their functionality with pre post conditions
Test Suite |
Precondition
|
Summary
|
---|---|---|
CSVDataService |
creating CSV data service, engaging caching, throttling.. etc And security scenarios | |
CSVDataUploadedService |
test uploading a CSV data service , with cashing and throttling etc.. And security scenarios | |
EXCELDataService | tests EXCEL data service | |
CSVExcelMultiDataService | tests data services with CSV and EXCEL data sources |
|
MySQLDataService | MySQL driver should be copied to carbon_home/repository/components/lib and MySQL server should be started. MySQL properties must be filled in framework.properties file under the MySQL Data source configurations category | tests Mysql data services module in WSO2 Data Services product |
StoredProcedureDataService | MySQL driver should be copied to carbon_home/repository/components/lib and MySQL server should be started. MySQL properties must be filled in framework.properties file under the MySQL Data source configurations category | tests queries with stored procedures such as add,update,delete queries etc.. |
RestfulDataService | MySQL driver should be copied to carbon_home/repository/components/lib and MySQL server should be started. MySQL properties must be filled in framework.properties file under the MySQL Data source configurations category | create a data service with resources and tests RESTful invokation |
NestedQueryDataService | MySQL driver should be copied to carbon_home/repository/components/lib and MySQL server should be started. MySQL properties must be filled in framework.properties file under the MySQL Data source configurations category | test creating and invoking a data service with nested queries |
ESB has nearly 90 test suites, so those are categorized into main categories, you can run all the sub-categorized tests by running the main category.
Main Category | Test Suite | Precondition |
Summary
|
---|---|---|---|
Configure | UserManagementTest | tests User Management module with adding new users with various permissions | |
ESBKeyStoreManagementTest | adds new key stores both valid and invalid then tests | ||
ESBLoggingConfigTest | tests logging module, log4J properties and configure log4J loggers etc.. | ||
ESBEventSourceTest | adding new event source, delete event source, edit new event source etc.. | ||
ESBManageSynapse ConfigurationMainTest |
tests all the synapse configurations Sequences, Endpoints etc.. | ||
ESBScheduleTasksMainTest | adds a schedule task, change configurations, assert results finally delete it | ||
Services | ESBAddInlineWsdlAnon SeqProxyServiceTest |
nio.http.port should be set under ESB Specific configurations In framework.properties file |
tests by importing SimpleStockQuoteProxy.wsdl as a proxy service with anonymous sequence |
ESBAddInlineWsdlProxyService Test |
setup a proxy service with importing SimpleStockQuoteProxy.wsdl , sets in sequence, out sequence etc.. |
||
ESBAddNonWsdlAnon SeqProxyServiceTest |
adds a non WSDL with an anonymous sequence to setup a proxy service | ||
ESBAddNonWsdlProxyServiceTest | adds a non WSDL with a known sequence to setup a proxy service | ||
ESBAddRegistrySourceWsdl ProxyServiceTest |
nio.http.port, carbon.home should be set in framework.properties file | adds sample_proxy_1.wsdl from the registry then create a proxy service with a known sequence | |
ESBAddSourceUrlWsdlAnonSeq ProxyServiceTest |
nio.http.port, carbon.home should be set in framework.properties file | ||
ESBAddSourceUrlWsdl ProxyServiceTest |
|||
LocalEntries | ESBManageLocalEntriesMainTest | tests whole Local Registry Entries module with In-lined Text Entry, In-lined XML Entry, Source URL Entry |
|
Endpoints | ESBAddEndpointMainTest | tests main features in endpoints | |
ESBGeneralAddressEndpoint Test |
tests endpoints with no security | ||
ESBSecuredAddressEndpoint Test |
tests endpoints with security. WS-Addressing, WS-Security |
||
ESBWSDLEndpointTest | tests WSDL Endpoint module | ||
Sequences | ESBGenerarlSequence ScenariosTest |
Mediation Sequences module will be tested, User interface, adding new sequences, both valid and invalid sequences |
|
Monitor | ESBMessageMediation StatisticsMainTest |
tests Mediation Statistics module, Mediation Statistics Help page, Server Statistics, Proxy service Statistics. Endpoint Statistics, Sequence Statistics |
|
Login_Home | ESBLoginPage | tests user interface and links in login page, doc links | |
ESBHomePage | tests WSO2 ESB home page, Management console page and all the links and labels |
||
Mediators | ESBCoreMediatorTest | carbon.home should be set in framework.properties file | tests the whole Mediation module with adding EventSources, adding Sequences etc.. |
ESBTransformMediatorsTest | carbon.home should be set in framework.properties file | tests Transform Mediators in Local Registry Entries | |
ESBExtensionMediatorsTest | carbon.home should be set in framework.properties file | Extension Mediators will be tested, Spring Mediator, Script Mediator(Java script), Class Mediator | |
ESBFilterMediatorsTest | carbon.home should be set in framework.properties file | tests Filter Mediators with Filter In, Filter Out, Filter Validation | |
ESBInMediatorMainTest | carbon.home should be set in framework.properties file | adds an In mediator to the 'Root' level then assert its properties, creates a complete sequence with an In mediator With Child mediators and siblings |
|
ESBFilterMediatorMainTest | tests adding a Filter mediator, specifies the Xpath, gives a proper namespace | ||
ESBOutMediatorMainTest |
tests adding an Out mediator to the 'Root' level, adds a Child mediator to the Out mediator, verifies mediator source etc.. |
||
ESBScriptMediatorMainTest | adds a Script mediator to the root level, selects the Script type as 'Registry Key' etc.. | ||
ESBSpringMediatorMainTest | tests Spring mediator module, with adding an Extension mediator child | ||
ESBClassMediatorMainTest | tests Class mediation module with adding new sequence, adding a sibling | ||
ESBSendMediatorMainTest | tests Send mediator in core module | ||
ESBDropMediatorMainTest | tests adding Drop mediator to the 'Root' level | ||
ESBPropertyMediatorMainTest | adding a Property mediator to the 'Root' level, gets property mediator information and assert | ||
ESBLogMediatorMainTest | tests Core->Log mediation module with selecting the 'Log Level' as 'Full' and update the mediator |
||
ESBSequenceMediator MainTest |
adds a Sequence mediator to the 'Root' level, verifies click on the 'Registry Key' link of the script mediator, Verifies embedded registry items |
||
ESBEventMediatorMainTest | tests Event mediation section | ||
ESBAggregateMediator MainTest |
tests Advanced->Aggregate mediator module | ||
ESBCacheMediatorMainTest | tests Advanced->Cache mediator module, selecting the 'Cache Type' as 'Collector', creates a complete sequence with different Cache Ids for the incoming messages and the outgoing messages and invoke using a client |
||
ESBIterateMediatorMainTest | adds an Iterate mediator to the 'Root' level, creates a sequence with the Target sequence specified As anonymous and invoke using a client |
||
ESBCalloutMediatorMainTest | carbon.home should be set in framework.properties file | tests Advanced->Callout mediator | |
ESBCloneMediatorMainTest | adds a Clone mediator to the 'Root' level, adds a Clone Target etc.. | ||
ESBTransactionMediator MainTest |
host.name, nio.http.port, context.root should be set in framework.properties file | tests transaction mediator | |
ESBRMSequenceMediator MainTest |
adds Advanced->RMSequence mediator to 'Root' level, adds Xpath etc.. | ||
ESBValidateMediatorMainTest | creates a complete sequence with a Validate mediator specifying a valid source and invokes using a client | ||
ESBRouterMediatorMainTest | adds a Router mediator to the 'Root' level, selects the 'Continue after routing' to 'Yes' and views the mediator source, Creates a complete sequence with a Route mediator with 'Continue after routing set to 'Yes' |
||
ESBThrottleMediatorMainTest | tests throttle mediator | ||
ESBSwitchMediatorMainTest | host.name, nio.http.port, context.root should be set in framework.properties file | adds a Switch mediator to the 'Root' level, specifies the source Xpath, adds a namespace and asserts The source view of the mediator and the sequence |
|
ESBFaultMediatorMainTest | creates a complete sequence with a Fault mediator with the 'Version' set to 'SOAP1.1' the 'Fault Code' set to 'Client' the 'Fault String' set to 'Expression' and invoke through a client (specify the Fault Actor and Details too ) |
||
ESBHeaderMediatorMainTest | tests Header mediator module | ||
ESBXSLTMediatorMainTest | host.name, nio.http.port, carbon.home should be set in framework.properties file | adds a XSLT mediator to the 'Root' level, selects a key from the 'Registry Browser', asserts sequence source view |
|
ESBXqueryMediatorMainTest | carbon.home should be set in framework.properties file | tests Transfor->XQuery mediator | |
ESBDBReportMediatorMainTest | adds the first DBreport mediator - pool connection, adds the second DBreport mediator - data source connection | ||
CustomerIssues | ESBEndPointsInRegistryTest | ||
ESBLocalEndpointsTest | |||
ESBProxyServiceIssueTest | |||
Samples | |||
Test Suite
|
Precondition
|
Summary
|
---|---|---|
GSStartUp | tests errors in server console | |
GSUserManagementTest
|
|
tests User Management module in WSO2 Gadget Server with roles and permissions
|
GSKeyStoreTest
|
|
tests Key Stores module with adding, deleting key stores
|
GSLogging
|
host.name and https.port should be set under Global properties In framework.properties file |
logging module will be tested with configuring |
GSGadgetRepoTest
|
|
tests Gadget Repository with add, delete and configure gadgets
|
GSPortalHome | tests Portal Home User Interface with WSO2 SOA Platform Blog, OpenId or Infocard etc.. | |
GSPortalPermissionTest | tests Portal Permissions by enabling and disabling them | |
GSAddGadgetsTest | gadgets will be added, change configurations will be changed and finally deleted | |
GSAddNewTabTest | tests Add New Tab feature in WSO2 Gadget Server | |
GSCloneActiveTabTest | tests Clone Active Tab module | |
GSGadgetSettingsTest |
tests Gadget Settings for both anonymous and registered users | |
GSSignUpTest | tests new user sign up in WSO2 Gadget Server | |
GSCommunityFeaturesTest | tests Community Features such as comments, both valid and invalid |
|
annoUser | anonymous users action will be tested, adding new gadgets and default gadgets modules are covered |
|
LoadTestSetup | userLogins.csv file in /lib folder (with the svn check out this file will be copied) |
new users will be added from userLogins.csv file |
Test Suite
|
Precondition
|
Summary
|
---|---|---|
ISStartUp
|
Property carbon.home should be set in framework.property file
|
a common test suite to check errors in server console
|
Usermanagement
|
|
a common user management test to check users and roles
|
CardIssuer
|
|
checks the card issuer module in Identity Server
|
MultifactorAuthentication
|
host.name, https.port and context.root should be filled in framework.property file
|
tests the Multifactor Authentication
|
InfoCardOpenID
|
host.name,openid.port and context.root must be valid in framework.property file
|
tests open Id module in Identity Server
|
DefaultUI
|
|
tests Main User Interface, Sign In Help, docs etc..
|
OpenIDUrl
|
|
open ID Url module in Identity Server with, signing up new users etc..
|
keystore
|
service.jks, mashup.cert and invalidFile.class in the mashup lib folder(default it's there)
|
tests key store module
|
logging
|
|
a common test suite, system logging module is tested
|
RelyingParty
|
javarp.cer certificate should be there in the /lib folder (by default it's there)
|
test Relying Parties by adding and deleting Relying Parties etc..
|
EntitlementPolicies
|
|
tests Policies module in Identity Server with policy evaluation
|
MyProfile
|
|
tests the profile feature in Identity Server with adding new profiles
|
Signup
|
|
tests Sign up module
|
ExternalUserStore
|
|
checks External User Store by adding new LDAP user store with user permissions
|
FineGrainedAuth
|
|
|
STSScenario
|
|
security Token Service is tested by this test suite
|
ProfileManagement
|
|
tests user profiles by adding, updating and deleting profiles
|
ClaimManagement
|
|
tests Claim Management module in Identity Server
|