mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
Update ui-tests-app.
This commit is contained in:
@@ -1,29 +1,32 @@
|
||||
import pages = require("ui/page");
|
||||
import button = require("ui/button");
|
||||
import trace = require("trace");
|
||||
import gridModule = require("ui/layouts/grid-layout");
|
||||
import text = require("ui/text-view");
|
||||
import frame = require("ui/frame");
|
||||
import button = require("ui/button");
|
||||
import text = require("ui/text-view");
|
||||
import dialogs = require("ui/dialogs");
|
||||
import gridModule = require("ui/layouts/grid-layout");
|
||||
import fs = require("file-system");
|
||||
import trace = require("trace");
|
||||
trace.enable();
|
||||
trace.setCategories(trace.categories.Test);
|
||||
|
||||
export function createPage() {
|
||||
var basePath = "pages/";
|
||||
var txtInput = new text.TextView();
|
||||
|
||||
var btn = new button.Button();
|
||||
btn.text = "Run";
|
||||
btn.on(button.Button.tapEvent, function () {
|
||||
var pagePath = basePath + txtInput.text;
|
||||
var fileName = fs.path.join(__dirname, "pages", txtInput.text);
|
||||
|
||||
if ((fs.File.exists(fileName + ".js")) || (fs.File.exists(fileName + ".xml"))) {
|
||||
frame.topmost().navigate(basePath + txtInput.text);
|
||||
var fileName = fs.path.join(__dirname, "pages", txtInput.text);
|
||||
if ((fs.File.exists(fileName + ".xml") || (fs.File.exists(fileName + ".js")))) {
|
||||
frame.topmost().navigate("pages/" + txtInput.text);
|
||||
}
|
||||
else {
|
||||
dialogs.alert("Cannot find page: " + pagePath);
|
||||
var fileName = fs.path.join(__dirname, txtInput.text, txtInput.text);
|
||||
if ((fs.File.exists(fileName + ".xml") || (fs.File.exists(fileName + ".js")))) {
|
||||
frame.topmost().navigate(txtInput.text + "/" + txtInput.text);
|
||||
}
|
||||
else {
|
||||
dialogs.alert("Cannot find page: " + txtInput.text);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user