diff --git a/tests/app/app/mainPage.ts b/tests/app/app/mainPage.ts index f6571c320..586dbe66f 100644 --- a/tests/app/app/mainPage.ts +++ b/tests/app/app/mainPage.ts @@ -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) { diff --git a/tests/app/testRunner.ts b/tests/app/testRunner.ts index d0414cdb2..c0c47631a 100644 --- a/tests/app/testRunner.ts +++ b/tests/app/testRunner.ts @@ -176,8 +176,13 @@ function printRunTestStats() { testFileContent.push(""); testFileContent.push(""); - 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(""));