diff --git a/e2e/appTestTs/app/app-root.xml b/e2e/appTestTs/app/app-root.xml index 54e70d976..f2885f81b 100644 --- a/e2e/appTestTs/app/app-root.xml +++ b/e2e/appTestTs/app/app-root.xml @@ -1,2 +1 @@ - - + diff --git a/e2e/appTestTs/app/app.css b/e2e/appTestTs/app/app.css index 662830b1a..7bc4257d9 100644 --- a/e2e/appTestTs/app/app.css +++ b/e2e/appTestTs/app/app.css @@ -1,25 +1,16 @@ -/* -In NativeScript, the app.css file is where you place CSS rules that -you would like to apply to your entire application. Check out -http://docs.nativescript.org/ui/styling for a full list of the CSS -selectors and properties you can use to style UI components. +@import '~@nativescript/theme/css/core.css'; +@import '~@nativescript/theme/css/default.css'; -/* -In many cases you may want to use the NativeScript core theme instead -of writing your own CSS rules. You can learn more about the -NativeScript core theme at https://github.com/nativescript/theme -The imported CSS rules must precede all other types of rules. -*/ -@import "~@nativescript/theme/css/core.css"; -@import "~@nativescript/theme/css/default.css"; - -/* Place any CSS rules you want to apply on both iOS and Android here. -This is where the vast majority of your CSS code goes. */ - -/* -The following CSS rule changes the font size of all Buttons that have the -"-primary" class modifier. -*/ -Button.-primary { +.btn { font-size: 18; } + +.home-panel{ + vertical-align: center; + font-size: 20; + margin: 15; +} + +.description-label{ + margin-bottom: 15; +} diff --git a/e2e/appTestTs/app/home/data.ts b/e2e/appTestTs/app/home/data.ts new file mode 100755 index 000000000..ae49f0936 --- /dev/null +++ b/e2e/appTestTs/app/home/data.ts @@ -0,0 +1,63 @@ +export function getData() { + return new Promise((resolve, reject) => { + const dataCopy = JSON.parse(JSON.stringify(data)); + + for (let i = 0; i < data.length; i++) { + const featured: boolean = i % 5 === 0; + (dataCopy[i]).featured = featured; + + const randomImageId = Math.floor(Math.random() * 5); + (dataCopy[i]).image = "~/images/news" + randomImageId + ".jpg"; + } + + setTimeout(() => { + resolve(dataCopy); + }, 1000); + }); +} + +const data = [ + { "id": 1, "title": "Aliquam erat volutpat.", "date": "12/26/2018" }, + { "id": 2, "title": "Aenean fermentum.", "date": "5/8/2018" }, + { "id": 3, "title": "Vestibulum rutrum rutrum neque.", "date": "6/19/2018" }, + + { "id": 1, "title": "Aliquam erat volutpat.", "date": "12/26/2018" }, + { "id": 2, "title": "Aenean fermentum.", "date": "5/8/2018" }, + { "id": 3, "title": "Vestibulum rutrum rutrum neque.", "date": "6/19/2018" }, + { "id": 1, "title": "Aliquam erat volutpat.", "date": "12/26/2018" }, + { "id": 2, "title": "Aenean fermentum.", "date": "5/8/2018" }, + { "id": 3, "title": "Vestibulum rutrum rutrum neque.", "date": "6/19/2018" }, + { "id": 1, "title": "Aliquam erat volutpat.", "date": "12/26/2018" }, + { "id": 2, "title": "Aenean fermentum.", "date": "5/8/2018" }, + { "id": 3, "title": "Vestibulum rutrum rutrum neque.", "date": "6/19/2018" }, + { "id": 1, "title": "Aliquam erat volutpat.", "date": "12/26/2018" }, + { "id": 2, "title": "Aenean fermentum.", "date": "5/8/2018" }, + { "id": 3, "title": "Vestibulum rutrum rutrum neque.", "date": "6/19/2018" }, + { "id": 1, "title": "Aliquam erat volutpat.", "date": "12/26/2018" }, + { "id": 2, "title": "Aenean fermentum.", "date": "5/8/2018" }, + { "id": 3, "title": "Vestibulum rutrum rutrum neque.", "date": "6/19/2018" }, + { "id": 1, "title": "Aliquam erat volutpat.", "date": "12/26/2018" }, + { "id": 2, "title": "Aenean fermentum.", "date": "5/8/2018" }, + { "id": 3, "title": "Vestibulum rutrum rutrum neque.", "date": "6/19/2018" }, + { "id": 1, "title": "Aliquam erat volutpat.", "date": "12/26/2018" }, + { "id": 2, "title": "Aenean fermentum.", "date": "5/8/2018" }, + { "id": 3, "title": "Vestibulum rutrum rutrum neque.", "date": "6/19/2018" }, + { "id": 1, "title": "Aliquam erat volutpat.", "date": "12/26/2018" }, + { "id": 2, "title": "Aenean fermentum.", "date": "5/8/2018" }, + { "id": 3, "title": "Vestibulum rutrum rutrum neque.", "date": "6/19/2018" }, + { "id": 1, "title": "Aliquam erat volutpat.", "date": "12/26/2018" }, + { "id": 2, "title": "Aenean fermentum.", "date": "5/8/2018" }, + { "id": 3, "title": "Vestibulum rutrum rutrum neque.", "date": "6/19/2018" }, + { "id": 1, "title": "Aliquam erat volutpat.", "date": "12/26/2018" }, + { "id": 2, "title": "Aenean fermentum.", "date": "5/8/2018" }, + { "id": 3, "title": "Vestibulum rutrum rutrum neque.", "date": "6/19/2018" }, + { "id": 1, "title": "Aliquam erat volutpat.", "date": "12/26/2018" }, + { "id": 2, "title": "Aenean fermentum.", "date": "5/8/2018" }, + { "id": 3, "title": "Vestibulum rutrum rutrum neque.", "date": "6/19/2018" }, + { "id": 1, "title": "Aliquam erat volutpat.", "date": "12/26/2018" }, + { "id": 2, "title": "Aenean fermentum.", "date": "5/8/2018" }, + { "id": 3, "title": "Vestibulum rutrum rutrum neque.", "date": "6/19/2018" }, + { "id": 1, "title": "Aliquam erat volutpat.", "date": "12/26/2018" }, + { "id": 2, "title": "Aenean fermentum.", "date": "5/8/2018" }, + { "id": 3, "title": "Vestibulum rutrum rutrum neque.", "date": "6/19/2018" } +]; diff --git a/e2e/appTestTs/app/home/home-page.css b/e2e/appTestTs/app/home/home-page.css new file mode 100755 index 000000000..b2690294a --- /dev/null +++ b/e2e/appTestTs/app/home/home-page.css @@ -0,0 +1,43 @@ +.action-bar { + background-color: #12127D; + color: #BACECA; +} + +.list-group { + background-color: #7A7878; +} + +.list-item-featured { + background-color: #BACECA; + margin: 15 5 15 5; +} + +.list-item-regular { + margin: 0 5 0 5; + padding: 5; + background-color: #BACECA; +} + +.title-regular { + color: #142D63; + padding: 0 0 0 10; +} + +.date-regular { + color: #4F77A5; + padding: 0 0 0 10; +} + +.image-featured { + margin: 20 0 0 0; +} + +.title-featured { + color: #142D63; + padding: 5 10 5 10; +} + +.date-featured { + color: #4F77A5; + padding: 5 10 5 10; +} \ No newline at end of file diff --git a/e2e/appTestTs/app/home/home-page.ts b/e2e/appTestTs/app/home/home-page.ts new file mode 100755 index 000000000..2992ca813 --- /dev/null +++ b/e2e/appTestTs/app/home/home-page.ts @@ -0,0 +1,87 @@ +import { EventData } from "tns-core-modules/data/observable"; +import { Page, View } from "tns-core-modules/ui/page"; + +import { HomeViewModel } from "./home-view-model"; +import { ListView, ItemEventData } from "tns-core-modules/ui/list-view/list-view"; + +import * as TKUnit from "./tk-unit"; +import { Frame } from "@nativescript/core/ui/frame/frame"; + +export function onPageLoaded(args: EventData) { + console.log("---> Page Loaded!"); + // let page = args.object; + // let listView = page.getViewById("list-view"); + // let indexes = {}; + // let completed = false; + + // listView.on(ListView.itemLoadingEvent, function (args: ItemEventData) { + // if (!args.view) { + // // args.view = new Label(); + // console.log("---> Fail!!!"); + // } + // // (