sergiykh / karma-openui5-maven-sample

Sample project for integrate a OpenUI5 app to a Maven build

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

karma-openui5-sample

Example for building and automated testing an OpenUI5 project integrated in Maven

This sample is based on the testing tutorial application

The project uses the Frontend Maven Plugin to automatically download and install nodejs and all required dependencies.

Prerequisites

Maven 3.1 or higher should be installed.

Running

You can run the sample by checking out and then execute:

  1. mvn install

This downloads node.js and npm. Then it executes node install bower install grunt build karma start

Finally it packages the application as war file that can be deployed on a Java Webserver. Then open baseurl/test/testService.html to check the app For this it uses the OpenUI5 jar distribution created by Webjars as dependency.

Configuration

The project layout integrates the basic folder structure that OpenUI5 proposes into a Maven project layout Javascript sources are found at src/main/javascript (layout as defined by OpenUI5), test sources are found at src/test/javascript

Project layout is:

 
+ Project basedir
+src/main/javascript
+controller
+i18n
+localService
+model
+view
-Component.js
-mainfest.json
+src/test/javascript
+localService
+test
-.eslintrc
-bower.json
-Gruntfile.js
-karma.ci.conf.js
-karma.conf.js
-package.json

Karma runner is configured in karma.conf.js and karma.ci.conf.js for CI specific overrides. The sample uses a mockserver and runs QUnit and OPA tests automatically in PhantoJS. Test output is recorded as JUnit xml at target/surefire-reports.

Note

  • Npm and bower local package directories are not configurable. They download the dependencies to the project root folder.
  • Clean plugin is configured to clean them as well

About

Sample project for integrate a OpenUI5 app to a Maven build

License:Apache License 2.0


Languages

Language:JavaScript 87.7%Language:HTML 12.1%Language:Java 0.1%