Files
NativeScript/e2e/modal-navigation/app/modal/modal-page.ts
Vasil Chimev e1a1d643c8 test(e2e): add modal-navigation app tests (#5445)
* test(e2e): modal-navigation app webpack support

* test(e2e): add modal-navigation app smoke test

* chore(e2e): tslint disable next line

* chore(e2e): modal-navigation app compilation

* refactor(e2e): modal-nabivation app pages

* test(e2e): add app root modal frame tests

* test(e2e): add app root modal frame background tests

* refactor(e2e): app root modal frame tests

* test(e2e): add tab root modal frame tests

* refactor(e2e): modal frame tests

* test(e2e): add modal page tests

* docs(e2e): add scenarios

* refactor(e2e): modal-navigation app tests

* test(e2e): turn on/off "Don't keep activities"

* test(e2e): delete no background tests

* test(e2e): add modal tab tests

* refactor(e2e): quit driver after all tests

* refactor(e2e): config files

* fix(e2e): tab root tests

* refactor(e2e): skip tab root tests until fix app

* chore(e2e): config files
2018-03-13 09:06:12 +02:00

67 lines
1.9 KiB
TypeScript

import { StackLayout } from "tns-core-modules/ui/layouts/stack-layout";
import { NavigatedData, Page } from "tns-core-modules/ui/page";
import { View, EventData } from "tns-core-modules/ui/core/view";
import { Frame, ShownModallyData } from "tns-core-modules/ui/frame";
import { fromObject } from "tns-core-modules/data/observable";
export function onShowingModally(args: ShownModallyData) {
console.log("modal-page showingModally");
let navigationVisibility = "visible";
if (args.context.frameless) {
navigationVisibility = "collapse";
}
(<any>args.object).bindingContext = fromObject({ navigationVisibility });
}
export function onLoaded(args) {
console.log("modal-page loaded");
}
export function onNavigatingTo(args: NavigatedData) {
console.log("modal-page onNavigatingTo");
}
export function onNavigatingFrom(args: NavigatedData) {
console.log("modal-page onNavigatingFrom");
}
export function onNavigatedTo(args: NavigatedData) {
console.log("modal-page onNavigatedTo");
}
export function onNavigatedFrom(args: NavigatedData) {
console.log("modal-page onNavigatedFrom");
}
export function closeModal(args: EventData) {
(args.object as View).closeModal();
}
export function showNestedModalFrame(args: EventData) {
const view = args.object as View;
const frame = new Frame();
frame.navigate("modal-nested/modal-nested-page");
view.showModal(frame,
"nested-context",
() => console.log("modal frame nested closed"),
false);
}
export function showNestedModalPage(args: EventData) {
const view = args.object as View;
view.showModal("modal-nested/modal-nested-page",
"nested-context",
() => console.log("modal page nested closed"),
false);
}
export function onNavigate(args: EventData) {
const view = args.object as View;
const page = view.page as Page;
page.frame.navigate("modal-second/modal-second-page");
}