
Selenium Conventions
Table of Contents [-]
Introduction #
Over time, since the implementation or our Selenium framework, we’ve received several requests for more information on how to write test scripts and ways others can contribute to the growing body of test suites that currently exist. First of all, we’re extremely grateful for everyone who has expressed interest – it’s really shown just how serious the community is about improving the quality of Liferay. Secondly – we’re not Selenium testing gods by any means – we’re just as concerned for the quality of Liferay and we want to step up and provide the best possible QA, using whatever tools are available to us – So please give us feedback, submit tickets, script tests, test branch and trunk builds of Liferay, and post on the message boards.
How to Write Basic Test Scripts #
First get a basic primer by reading Selenium Testing. If you’re just starting to use Selenium we’d highly recommend using the IDE and writing tests that test basic functionality. When writing tests follow some basic rules:
1. Follow the naming and formatting conventions of existing tests.
2. Follow the naming and formatting conventions of existing tests.
3. Follow the naming and formatting conventions of existing tests.
If you’re writing a test that adds a page – do not name it ‘addsapagetest.html’. Here are some of the basic naming patterns that help direct what kinds of tests need to be scripted and how they ought to be named:
Selenium Testing Patterns #
AddPageTest
AddPortletTest
AddFolderTest
AddSubfolderTest
AddObjectTest
AddObjectCommentTest
EditObjectCommentTest
EditObjectTest
AddNullObjectTest
DeleteObjectTest
AddSecondObjectTest
AddSecondObjectCommentTest
MoveObjectTest
SearchObjectTest
ViewObjectTest
ViewObjectWithoutPermissionsTest
EditObjectWithoutPermissionsTest
EditObjectWithPermissionsTest
DeleteAllObjectTest
ImportLARTest
VerifyLARImportTest
DeletePageTest
While many of these theoretical tests may not be possible in the context of every portlet, it is best to consider the above structure as a guide to writing relevant and properly named tests. When writing a test suite – at the very least a test for a given portlet should have AddPageTest, AddPortletTest, and DeletePageTest.