Page History
Magnolia 5.5 and above
Info | ||
---|---|---|
| ||
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 | ||||
---|---|---|---|---|
| ||||
..../magnolia-integration-tests/tests mvn clean install -P ui-tests |
Run all tests in a single class
Code Block | ||||
---|---|---|---|---|
| ||||
..../magnolia-integration-tests/tests mvn clean install -P ui-tests -DfailIfNoTests=false -Dit.test=MyTestClass |
Run a single test case
Code Block | ||||
---|---|---|---|---|
| ||||
..../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 | ||||
---|---|---|---|---|
| ||||
$ ./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
)
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 | ||
---|---|---|
| ||
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 | ||||
---|---|---|---|---|
| ||||
..../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
...