mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-16 11:42:04 +08:00
Fixed tests to run on iOS.
This commit is contained in:
@ -35,7 +35,7 @@ function onNavigatedTo(args) {
|
||||
page.content = label;
|
||||
args.object.off(Page.navigatedToEvent, onNavigatedTo);
|
||||
|
||||
if (parseInt(platform.device.sdkVersion) >= 23) {
|
||||
if (platform.isAndroid && parseInt(platform.device.sdkVersion) >= 23) {
|
||||
let handler = (args: application.AndroidActivityRequestPermissionsEventData) => {
|
||||
application.android.off(application.AndroidApplication.activityRequestPermissionsEvent, handler);
|
||||
if (args.requestCode === 1234 && args.grantResults.length > 0 && args.grantResults[0] === android.content.pm.PackageManager.PERMISSION_GRANTED) {
|
||||
|
@ -176,8 +176,13 @@ function printRunTestStats() {
|
||||
testFileContent.push("</testsuite>");
|
||||
testFileContent.push("</testsuites>");
|
||||
|
||||
let testFilePath = fs.path.join(android.os.Environment.getExternalStorageDirectory().getAbsolutePath(), "Documents", "test-results.xml");
|
||||
console.log("testFilePath =====>>>>>>> " + testFilePath);
|
||||
let testFilePath: string;
|
||||
let testResultsFileName = "test-results.xml";
|
||||
if (platform.isIOS) {
|
||||
testFilePath = fs.path.join(fs.knownFolders.documents().path, testResultsFileName);
|
||||
} else {
|
||||
testFilePath = fs.path.join(android.os.Environment.getExternalStorageDirectory().getAbsolutePath(), "Documents", testResultsFileName);
|
||||
}
|
||||
|
||||
let testFile = fs.File.fromPath(testFilePath);
|
||||
testFile.writeTextSync(testFileContent.join(""));
|
||||
|
Reference in New Issue
Block a user