Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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 e2e/ui-tests-app/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ typings/

# Visual Studio Code
.vscode/*
!.vscode/settings.json
.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
Expand Down
37 changes: 34 additions & 3 deletions e2e/ui-tests-app/.vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,51 @@
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Launch on iOS",
"type": "nativescript",
"request": "launch",
"platform": "ios",
"appRoot": "${workspaceRoot}",
"sourceMaps": true,
"watch": true,
"tnsArgs": [
"--debug-brk"
]
},
{
"type": "node",
"request": "launch",
"name": "Mocha Tests",
"name": "debug-tests",
"program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
"args": [
"-u",
"tdd",
"--colors",
"--opts",
"../config/mocha.opts",
"--grep=tab-view",
"--grep=bottom-navigation",
"-a",

],
"internalConsoleOptions": "openOnSessionStart",
// "preLaunchTask": "e2e-tsc"
},
{
"type": "node",
"request": "launch",
"name": "run-tests",
"program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
"args": [
"-u",
"tdd",
"--colors",
"--opts",
"../config/mocha.opts",
"--grep=bottom-navigation",
"android",
"--grep=bottom-navigation",
"--port",
"8889",
],
"internalConsoleOptions": "openOnSessionStart"
}
Expand Down
12 changes: 12 additions & 0 deletions e2e/ui-tests-app/.vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "e2e-tsc",
"command": "npm",
"args": ["run", "e2e-tsc"]
}
]
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M17.5,10c-0.03,0 -0.05,0.01 -0.08,0.01L13.41,6L9,6v2h3.59l2,2h-8.1C4.01,10 2,12.02 2,14.5 2,16.99 4.01,19 6.5,19c2.22,0 4.06,-1.62 4.42,-3.73L13.04,14c-0.02,0.17 -0.04,0.33 -0.04,0.5 0,2.49 2.01,4.5 4.5,4.5s4.5,-2.01 4.5,-4.5 -2.01,-4.5 -4.5,-4.5zM8.84,15.26C8.52,16.27 7.58,17 6.47,17c-1.38,0 -2.5,-1.12 -2.5,-2.5S5.09,12 6.47,12c1.12,0 2.05,0.74 2.37,1.75L6,13.75v1.5l2.84,0.01zM17.47,17c-1.38,0 -2.5,-1.12 -2.5,-2.5s1.12,-2.5 2.5,-2.5 2.5,1.12 2.5,2.5 -1.12,2.5 -2.5,2.5z"/>
</vector>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<ActionBar title="BottomNavigation background-color" icon="" class="action-bar">
</ActionBar>

<BottomNavigation>
<BottomNavigation automationText="tabNavigation" >
<TabStrip>
<TabStripItem title="First" class="special"></TabStripItem>
<TabStripItem title="Second"></TabStripItem>
Expand Down
12 changes: 3 additions & 9 deletions e2e/ui-tests-app/app/bottom-navigation/binding-page.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
import * as vmModule from "./bottom-navigation-view-model";

var viewModel = vmModule.bottomNavigationViewModel;
import { BottomNavigationViewModel } from "./bottom-navigation-view-model";

export function bottomNavigaitonLoaded(args) {
let bottomNav = args.object;
bottomNav.bindingContext = viewModel;
}

export function addTabs(args) {
viewModel.createItems();
const bottomNav = args.object.page;
bottomNav.bindingContext = new BottomNavigationViewModel();
}
12 changes: 8 additions & 4 deletions e2e/ui-tests-app/app/bottom-navigation/binding-page.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
<Page class="page">
<Page class="page" navigatingTo="navigatingTo">

<ActionBar title="BottomNavigation background-color" icon="" class="action-bar">
<ActionBar title="BottomNavigation binding" icon="" class="action-bar">
</ActionBar>

<GridLayout rows="auto,*">
<Button row="0" text="Add Tab" tap="addTabs"/>
<StackLayout row="0" >
<Button automationText="add-tab" text="add-tab" tap="{{ createItems }}"/>
<Button automationText="remove-last-tab" text="remove-last-tab" tap="{{ removeLastItem }}"/>

</StackLayout>
<GridLayout row="1">
<BottomNavigation loaded="bottomNavigaitonLoaded" items="{{ tabContentItems }}">
<BottomNavigation automationText="tabNavigation" loaded="bottomNavigaitonLoaded" items="{{ tabContentItems }}">
<TabStrip items="{{ tabStripItems }}">
</TabStrip>
</BottomNavigation>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { View } from "tns-core-modules/ui/core/view";
import { Page } from "tns-core-modules/ui/page";

export function loaded(args) {
const page = <Page>(<View>args.object).page;
const view = page.getViewById("bottomNavigation");
(<any>view).textTransform = "capitalize";
}

export function applyTap(args) {
const page = <Page>(<View>args.object).page;
const css = "#bottomNavigation { " + args.object.tag + " }";
page.css = css;
}

export function resetTap(args) {
const page = <Page>(<View>args.object).page;
page.css = "";
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<Page xmlns="http://schemas.nativescript.org/tns.xsd" loaded="loaded">
<BottomNavigation automationText="tabNavigation" id="bottomNavigation" >
<TabStrip>
<TabStripItem title="IteM onE"></TabStripItem>
<TabStripItem title="IteM twO"></TabStripItem>
<TabStripItem title="IteM threE"></TabStripItem>
</TabStrip>

<TabContentItem>
<GridLayout>
<ScrollView>
<StackLayout>
<Button text="text-transform: uppercase;" tap="applyTap" tag="text-transform: uppercase;" style.fontSize="8"/>
<Button text="text-transform: lowercase;" tap="applyTap" tag="text-transform: lowercase;" style.fontSize="8"/>
<Button text="text-transform: capitalize;" tap="applyTap" tag="text-transform: capitalize;" style.fontSize="8"/>
<Button text="text-transform: none;" tap="applyTap" tag="text-transform: none;" style.fontSize="8"/>
<Button text="reset" tap="resetTap" style.fontSize="8"/>
</StackLayout>
</ScrollView>
</GridLayout>
</TabContentItem>

<TabContentItem>
<GridLayout>
<Label text="Item 2"/>
</GridLayout>
</TabContentItem>

<TabContentItem>
<GridLayout>
<Label text="Item 3"/>
</GridLayout>
</TabContentItem>
</BottomNavigation>
</Page>
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
</BottomNavigation> -->

<!-- w/ TabStrip -->
<BottomNavigation id="bottomNav">
<BottomNavigation id="bottomNav" automationText="tabNavigation" >
<TabStrip>
<TabStripItem title="First Tab 11" iconSource="res://icon"></TabStripItem>
<TabStripItem>
Expand All @@ -37,37 +37,37 @@
<TabContentItem>
<StackLayout>
<Label text="First View"/>
<Button tap="goToSecond" text="go to second" />
<Button tap="goToSecond" text="go to second" automationText="goToSecond" />
</StackLayout>
</TabContentItem>
<TabContentItem>
<StackLayout>
<Label text="Second View"/>
<Button tap="goToFirst" text="go to first" />
<Button tap="goToFirst" text="go to first" automationText="goToFirst" />
</StackLayout>
</TabContentItem>
<TabContentItem>
<StackLayout>
<Label text="First View"/>
<Button tap="goToSecond" text="go to second" />
<Button tap="goToSecond" text="go to second" automationText="goToSecond" />
</StackLayout>
</TabContentItem>
<TabContentItem>
<StackLayout>
<Label text="Second View"/>
<Button tap="goToFirst" text="go to first" />
<Button tap="goToFirst" text="go to first" automationText="goToFirst" />
</StackLayout>
</TabContentItem>
<TabContentItem>
<StackLayout>
<Label text="First View"/>
<Button tap="goToSecond" text="go to second" />
<Button tap="goToSecond" text="go to second" automationText="goToSecond" />
</StackLayout>
</TabContentItem>
<TabContentItem>
<StackLayout>
<Label text="First View"/>
<Button tap="goToSecond" text="go to second" />
<Button tap="goToSecond" text="go to second" automationText="goToSecond" />
</StackLayout>
</TabContentItem>
</BottomNavigation>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import { GridLayout } from "tns-core-modules/ui/layouts/grid-layout";
import { Label } from "tns-core-modules/ui/label";
import { Observable } from "tns-core-modules/data/observable";
import { ObservableArray } from "tns-core-modules/data/observable-array";
import { TabStripItem } from "tns-core-modules/ui/tab-navigation-base/tab-strip-item";
import { TabContentItem } from "tns-core-modules/ui/tab-navigation-base/tab-content-item";

Expand All @@ -17,7 +16,9 @@ export class BottomNavigationViewModel extends Observable {
this.createItems();
}

createItems() {
public createItems() {
console.log("Create item");

const _tabStripItems = new Array<TabStripItem>();
const _tabContentItems = new Array<TabContentItem>();

Expand All @@ -31,6 +32,12 @@ export class BottomNavigationViewModel extends Observable {
this.itemsCount++;
}

public removeLastItem() {
console.log("Remove item");
this.tabStripItems.pop();
this.tabContentItems.pop();
}

private createTabStripItem(index: number): TabStripItem {
const item = new TabStripItem();
item.title = "Item " + index;
Expand All @@ -50,4 +57,3 @@ export class BottomNavigationViewModel extends Observable {
return contentItem;
}
}
export var bottomNavigationViewModel = new BottomNavigationViewModel();
2 changes: 1 addition & 1 deletion e2e/ui-tests-app/app/bottom-navigation/color-page.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<ActionBar title="BottomNavigation color" icon="" class="action-bar">
</ActionBar>

<BottomNavigation>
<BottomNavigation style="color: green;" automationText="tabNavigation" >
<TabStrip>
<TabStripItem title="First" class="special"></TabStripItem>
<TabStripItem title="Second"></TabStripItem>
Expand Down
44 changes: 44 additions & 0 deletions e2e/ui-tests-app/app/bottom-navigation/fancy-fonts-page.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
.font-awesome {
font-family: "FontAwesome";
}

Page {
background-color: tomato;
}

ActionBar {
background-color: aquamarine;
}

Button {
background-color: lightskyblue;
}

BottomNavigation {
background-color: lightgreen;
}

#lastStripItem {
color: greenyellow;
background-color: black;
}

TabStripItem:active, #lastStripItem:active {
background-color:coral;
}

#second-tab-content-item {
background-color: blueviolet;
}

#third-tab-content-item {
background-color: blue;
}

#fourth-tab-content-item {
background-color: gray;
}

#fifth-tab-content-item {
background-color: brown;
}
10 changes: 10 additions & 0 deletions e2e/ui-tests-app/app/bottom-navigation/fancy-fonts-page.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { EventData, Page } from "tns-core-modules/ui/page/page";
import { BottomNavigation } from "tns-core-modules/ui/bottom-navigation/bottom-navigation";

export const selectTab = (args: EventData) => {
const page = <Page>(<any>args.object).page;
const bottomNav = <BottomNavigation>page.getViewById("bottomNavigation");

const index = (<any>args.object).tag;
bottomNav.selectedIndex = index;
};
Loading