We try to test our portlets for Liferay 6.0.6 via Selenium. We have few liferay mvc portlets and vaadin portlets. In first approach we create test which do steps below:
- Restore database dump with basic structure and portlet placement
- Delete "data" folder and copy initial data to it
- Delete appropriate folders of portlets from "webapps" folder
- Copy our portlets (*.war) to "deploy" folder
- Start liferay
- Wait while portlets will have installed
- Go to Control panel -> Server Administration and click on "Clear content cached by this VM", "Clear the database cache.", "Reindex all search indexes."
After We start selenium tests (test portlets behavior, upload files via vaadin portlets, approving workflow (kaleo) tasks via vaadin portlets etc). And tests failed in different places:
- Some times DuplicateFileException occurs during uploading file via our portlet (but in document manager there are no files)
- Some times Selenium can not find elements on page
- Sometimes kaleo workflow can not approve all files without errors
More unstable behavior we get when start test on Jenkins node on VM.
How do you test your portlets? Is there a way to stable behavior of test? What is a best practice?