Versions Compared

Key

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

Magnolia 5.5 and above

Info
titleCaution


You need the docker-engine installed on your local machine. (For macOS have a look here)

Location

All UI-Tests are located in the bundles under either ce/magnolia-integration-tests/tests or ee/magnolia-ee-integration-tests/tests

Running the tests

Automated run

We use Selenium for testing our ui and HtmlUnit for our integration tests. The UI-Tests will are part of magnolia-integration-test/tests and use its test-webapp & test-public-webapp. UI-Tests are only triggered if you specify the corresponding maven profile ui-tests.

In short, use the following command to automatically run all UI-Tests

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

Run all tests in a single class

Code Block
languagebash
titlelaunch uitests for one class
..../magnolia-integration-tests/tests mvn clean install -P ui-tests -DfailIfNoTests=false -Dit.test=MyTestClass

Run a single test case

Code Block
languagebash
titlelaunch uitests for one class
..../magnolia-integration-tests/tests mvn clean install -P ui-tests -DfailIfNoTests=false -Dit.test=MyTestClass#myTest


Manual run

If you want to run the ui tests manually to debug the ui-test code you could basically just run the test in our IDE. The drawback with this simple approach is that the whole environment with the web & selenium containers including magnolia installation is done with every start.

So to have a smaller footprint we first have to start just the web container with magnolia and the selenium host with the following script

Code Block
languagebash
titlelaunch tomcat and selenium container
$ ./localtest.sh

Then you have to launch the test with -Dsetup.test.env=false so the test environment is not started and stopped with every test launch (thats what you have already done with localtest.sh)

Image Added


To observe the browser with the test execution launch a VNC client and connect to localhost:5901 with password "secret". (Under macOS that easily done with the app Screen Sharing)

Magnolia 5.4

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.

Running the tests

Info
titleCaution

Some of those tests are very sensitive - when running them on your local machine, make sure to not do anything else while they're running. e.g. don't switch to any application or type anything. This can be enough to make some of the UI tests fail.


You need docker installed as well as both the tomcat container as well as the browser for the ui-tests are started as docker containers. (For macOS have a look here)

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 (uitestui-tests).

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

...

Code Block
languagebash
titlelaunch uitests for one test
..../magnolia-integration-tests/tests mvn clean install -P ui-tests -DseleniumBrowser=chrome -DfailIfNoTests=false -Dit.test=MyTestClass#myTest


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

...