Page History
...
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 (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 | ||||
---|---|---|---|---|
| ||||
..../magnolia-integration-tests/tests mvn clean install -P ui-tests,jetty6-standalone -DseleniumBrowser=chrome |
Run only the tests in one class
Code Block | ||||
---|---|---|---|---|
| ||||
..../magnolia-integration-tests/tests mvn clean install -P ui-tests,jetty6-standalone -DseleniumBrowser=chrome -DfailIfNoTests=false -DtestDit.test=MyTestClass |
(Note that this will also trigger the crawling after the test, it would be nice to figure out a command that runs one class, but does not trigger the crawling.)
...
Code Block | ||||
---|---|---|---|---|
| ||||
..../magnolia-integration-tests/tests mvn clean install -P ui-tests,jetty6-standalone -DseleniumBrowser=chrome -DfailIfNoTests=false -DtestDit.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
Code Block | ||||
---|---|---|---|---|
| ||||
..../magnolia-integration-tests/tests mvn clean install -P manual-tests,jetty6-standalone |
Once this is running, then you can simply run or debug with JUnit in your IDE as you would a normal unit test.
...