test: add e2e app for nested frame scenarios (#6626)

This commit is contained in:
Manol Donev
2018-11-28 16:59:17 +02:00
committed by GitHub
parent c8341819a3
commit f87ec4bc08
113 changed files with 3068 additions and 0 deletions

View File

@@ -0,0 +1,39 @@
import * as application from "tns-core-modules/application";
import { EventData } from "tns-core-modules/ui/core/view";
import { Button } from "tns-core-modules/ui/button";
export function onNavigateToLayoutFrame(args: EventData) {
application._resetRootView({ moduleName: "layout-root/layout-root-frame" });
}
export function onNavigateToLayoutMultiFrame(args: EventData) {
application._resetRootView({ moduleName: "layout-root/layout-root-multi-frame" });
}
export function onNavigateToPageFrame(args: EventData) {
const button = <Button>args.object;
button.page.frame.navigate("frame-root/frame-home-page");
}
export function onNavigateToPageMultiFrame(args: EventData) {
const button = <Button>args.object;
button.page.frame.navigate("frame-root/frame-multi-home-page");
}
export function onNavigateToTabsTopPage(args: EventData) {
const button = <Button>args.object;
button.page.frame.navigate("tab-page/tabs-top-page");
}
export function onNavigateToTabsBottomPage(args: EventData) {
const button = <Button>args.object;
button.page.frame.navigate("tab-page/tabs-bottom-page");
}
export function onNavigateToTabsTopRoot(args: EventData) {
application._resetRootView({ moduleName: "tab-root/tab-root-top" });
}
export function onNavigateToTabsBottomRoot(args: EventData) {
application._resetRootView({ moduleName: "tab-root/tab-root-bottom" });
}

View File

@@ -0,0 +1,19 @@
<Page xmlns="http://schemas.nativescript.org/tns.xsd" class="page">
<ActionBar class="action-bar" height="5%">
<Label class="action-bar-title" text="Home" />
</ActionBar>
<GridLayout rows="auto">
<StackLayout id="home-page" borderColor="yellowgreen" borderWidth="1" borderRadius="5" padding="2">
<Button text="Layout w/ frame" tap="onNavigateToLayoutFrame" />
<Button text="Layout w/ multi frame" tap="onNavigateToLayoutMultiFrame" />
<Button text="Page w/ frame" tap="onNavigateToPageFrame" />
<Button text="Page w/ multi frame" tap="onNavigateToPageMultiFrame" />
<Button ios:visibility="collapsed" text="Page w/ tabs (top)" tap="onNavigateToTabsTopPage" />
<Button text="Page w/ tabs (bottom)" tap="onNavigateToTabsBottomPage" />
<Button ios:visibility="collapsed" text="Root tabs (top)" tap="onNavigateToTabsTopRoot" />
<Button text="Root tabs (bottom)" tap="onNavigateToTabsBottomRoot" />
</StackLayout>
</GridLayout>
</Page>