mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
test: add e2e app for nested frame scenarios (#6626)
This commit is contained in:
39
e2e/nested-frame-navigation/app/home/home-page.ts
Normal file
39
e2e/nested-frame-navigation/app/home/home-page.ts
Normal 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" });
|
||||
}
|
||||
19
e2e/nested-frame-navigation/app/home/home-page.xml
Normal file
19
e2e/nested-frame-navigation/app/home/home-page.xml
Normal 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>
|
||||
Reference in New Issue
Block a user