mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
Rename the files
This commit is contained in:
36
tests/app/app/mainPage.ts
Normal file
36
tests/app/app/mainPage.ts
Normal file
@@ -0,0 +1,36 @@
|
||||
import {Page} from "ui/page";
|
||||
import * as trace from "trace";
|
||||
import tests = require("../testRunner");
|
||||
import {Label} from "ui/label";
|
||||
|
||||
trace.enable();
|
||||
trace.addCategories(trace.categories.Test + "," + trace.categories.Error);
|
||||
|
||||
// When debugging
|
||||
//trace.setCategories(trace.categories.concat(
|
||||
// trace.categories.Test,
|
||||
// trace.categories.Navigation,
|
||||
// trace.categories.Transition,
|
||||
// trace.categories.NativeLifecycle,
|
||||
// trace.categories.ViewHierarchy,
|
||||
// trace.categories.VisualTreeEvents
|
||||
//));
|
||||
|
||||
let page = new Page();
|
||||
page.id = "mainPage";
|
||||
|
||||
page.on(Page.navigatedToEvent, onNavigatedTo);
|
||||
|
||||
function onNavigatedTo(args) {
|
||||
let label = new Label();
|
||||
label.text = "Running non-UI tests...";
|
||||
page.content = label
|
||||
args.object.off(Page.navigatedToEvent, onNavigatedTo);
|
||||
setTimeout(function () {
|
||||
tests.runAll();
|
||||
}, 10);
|
||||
|
||||
}
|
||||
export function createPage() {
|
||||
return page;
|
||||
}
|
||||
Reference in New Issue
Block a user