Testing and automating CMS backed applications is challenging. It is different from testing web applications. In most of the web applications - pages are well defined. Operations which can be performed on them is well defined and there are few moving parts on the page.
CMS backed applications on the other hand are usually dynamic. Pages in CMS backed applications are mostly container and pages can have different data and modules every time you look at them.
Channel-4, like many media organisations have many websites such as 4Food, 4Beauty, 4Home and so on. These websites are powered by a powerful CMS and test automation in a usual way wouldn't have worked. In this talk, I will share challenges I faced and approach I took for the automation of CMS backed web applications.
4. Let's break the problem
Can editor publish pages with
different module combinations?
CMS ==> DB
Can page render all the
modules properly?
DB ==> Front End
5. Two main challenges
Can editor publish pages with
different module combinations?
CMS ==> DB
Out of Scope for this talk
Can page render all
the modules
properly?
DB ==> Front End
6. When a page is requested
Java applies magic to convert
information in DB to JSON
format.
Frontend understands JSON
and does its magic to render
the web page.
8. Let's consider DB is our oracle.. what
do we need to check?
Java is doing magic properly,
i.e information in DB and
information present in the
JSON is consistent.
Frontend understands Java's
magic properly and rendering
modules properly.
And there are few more challenges..
9. Every site is a separate project
Different Teams &
Release Cycle
Reuses core
functionality
Add New
Functionality
14. Discovery Module - What's on the page?
?debug
?debug&xml
Use any XML Parser to get
information on the modules
present on the page.
Use Data Assertor to check number & type of modules on the
page. Testability for the WIN!!
15. For all the modules on the page..
For (Every_module_identified_on_the_page) {
Call structural_assertions of the module
Call data_assertions of the module
}
16. Structural Assertions..kind of acceptance criteria
for the modules
---> Video list module should have link to three video articles
---> Every item in the list should have an image
---> There should be a little play button on top of image
---> Video links should always be internal
---> Every list item should have an image, title and description
17. Database Assertions.. Actual checks - compare
DB and information on the page
---> Order of the articles is same as DB
---> Right images are present on the module
---> Title text of all the article is proper
---> Right description is appearing for all the items in the list
19. Go to Sitemap on UAT
Get links_of_all_the_pages
For (Every_link_in_the_sitemap) {
Go to that_page
Get list_of_modules
For (Every_module_on_the_page) {
Call structural_assertions of the module
Call data_assertions of the module
}
}
Efficient
&
Effective