Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "1.1.0",
"description": "SAP Community Code Challenge: This repository contains an empty OpenUI5 application and end-to-end test written with wdi5. Take part in the challenge and develop an app that passes the tests.",
"scripts": {
"start": "ui5 serve --port 8080",
"start": "ui5 serve --port 8080 -o index.html",
"test": "wdio run wdio.conf.js",
"ci-test": "run-p -r start wait-then-test",
"wait-then-test": "wait-on tcp:8080 && npm run test -- --headless"
Expand Down
5 changes: 1 addition & 4 deletions wdio.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,7 @@ exports.config = {
browserName: 'chrome',
acceptInsecureCerts: true,
"goog:chromeOptions": {
args:
process.argv.indexOf("--headless") > -1
? ["--headless"]
: []
args: ["--headless"]
}
// If outputDir is provided WebdriverIO can capture driver session logs
// it is possible to configure which logTypes to include/exclude.
Expand Down
5 changes: 3 additions & 2 deletions webapp/controller/BaseController.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
sap.ui.define([
"sap/ui/core/mvc/Controller"
], function (Controller) {
"sap/ui/core/mvc/Controller",
"sap/ui/core/UIComponent"
], function (Controller, UIComponent) {
"use strict";

return Controller.extend("ui5.challenge.controller.BaseController", {
Expand Down
37 changes: 37 additions & 0 deletions webapp/controller/Main.controller.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
sap.ui.define([
"./BaseController",
"sap/ui/model/json/JSONModel"
], function(BaseController, JSONModel) {
"use strict"

return BaseController.extend("ui5.challenge.controller.Main", {

onInit: function() {

var aData = {
persons: [
{
name: "Max Mustermann",
alter: 33
},
{
name: "Maria Musterfrau",
alter: 40
},
{
name: "Mara Mustermensch",
alter: 24
}
]
};

var oModel = new JSONModel(aData);
this.getView().setModel(oModel);
},

navToDetail: function() {
this.navTo("Detail");
}

})
})
4 changes: 4 additions & 0 deletions webapp/i18n/i18n.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
appTitle=ui-challenge
appDescription=Application to test the new testframewok for UI5
mainTitleText=wdi5 rocks
ListHeaderTitle=Person List
2 changes: 1 addition & 1 deletion webapp/index.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<title>title</title>
<title>ui5-challenge</title>

<script
id="sap-ui-bootstrap"
Expand Down
30 changes: 28 additions & 2 deletions webapp/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,34 @@
"controlId": "app",
"clearControlAggregation": false
},
"routes": [],
"targets": {}
"routes": [
{
"name": "default",
"pattern": "",
"target": "MainView"
},
{
"name": "Detail",
"pattern": "RouteDetail",
"target": "DetailView"
}
],
"targets": {
"MainView": {
"viewType": "XML",
"transition": "slide",
"viewLevel": 1,
"viewId": "Main",
"viewName": "Main"
},
"DetailView": {
"viewType": "XML",
"transition": "slide",
"viewLevel": 1,
"viewId": "Detail",
"viewName": "Detail"
}
}
},
"rootView": {
"viewName": "ui5.challenge.view.App",
Expand Down
6 changes: 6 additions & 0 deletions webapp/view/Detail.view.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<mvc:View
controllerName="ui5.challenge.controller.Main"
xmlns:mvc="sap.ui.core.mvc"
xmlns="sap.m">
<Title text="{name}"></Title>
</mvc:View>
21 changes: 21 additions & 0 deletions webapp/view/Main.view.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<mvc:View
controllerName="ui5.challenge.controller.Main"
xmlns:mvc="sap.ui.core.mvc"
xmlns="sap.m">
<VBox class="sapUiSmallMargin">
<Title text="{i18n>mainTitleText}" level="H1" />
<Button id="mainButton" text="Main Button" />
<Button id="myControl" text="Detail" press=".navToDetail"/>
</VBox>
<List
id="PersonList"
headerText="{i18n>ListHeaderTitle}"
items="{/persons}"
includeItemInSelection="true">
<StandardListItem
title="{name}"
description="{age}"
type="Navigation"
press=".navToDetail"/>
</List>
</mvc:View>