Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Introduction

Here's the typical testing pyramid - it basically shows that UI tests will not replace any other tests (manual tests or Acceptance/Integration tests) but will complete our test setup.

Image Removed

UI Tests

Location

Our ui tests are placed in the ce-bundle/magnolia-integration-tests/tests because all the required setup (install and start an author and public instance) is already there.

Automated run

We use Selenium for testing our ui. The UITest will be part of magnolia-integration-test/tests and use its test-webapp & test-public-webapp. UITests are only triggered if you specify the corresponding profile (uitest). As specifying a profile no longer invokes the default profile (jetty6-standalone) you have to pass this one as well.

In short, use the following command to automatically run the ui tests

Code Block
languagebash
titlelaunch uitests
..../magnolia-integration-tests/tests mvn clean install -P ui-tests,jetty6-standalone

 

Manual run

If you want to run the ui tests manually from within your IDE you can start the author and public tests instance with

Code Block
languagebash
titlelaunch uitests
..../magnolia-integration-tests/tests mvn clean install -P manual-tests,jetty6-standalone

Outlook

  • Execute tests with with different browsers (Firefox, Chrome, Safari, Ie, ...) an different OS's (OSX, Unix, Windows, iOs, ...) using hudson slaves

Implementation hints

Our UI tests are implemented with selenium. Despite the fact that this tool is really mature, those tests aren't as reproducible as ordinary unit-tests. Here's a list of hints that should help to write stable magnolia ui tests:

IssuePotential fixRemark
Element cannot be found although it's thereadd a delayif the test triggers a long running action (e.g. activation) this can take longer than the current timeout we use for retrieving elements...
   

 

there's different layers of tests and that in lower layers one should have most tests and hence the biggest coverage. On the very top - the manual tests - should be very minimal.

Image Added