[
https://issues.apache.org/jira/browse/CB-11084?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15247544#comment-15247544
]
ASF GitHub Bot commented on CB-11084:
-------------------------------------
Github user vladimir-kotikov commented on a diff in the pull request:
https://github.com/apache/cordova-medic/pull/92#discussion_r60209962
--- Diff: medic/medic-appium.js ---
@@ -222,6 +223,37 @@ function getLocalCLI(appPath) {
return "./cordova";
}
+function getConfigPath(appPath) {
+ return path.join(appPath, "config.xml");
+}
+
+function parseElementtreeSync(filename) {
+ var contents = fs.readFileSync(filename, util.DEFAULT_ENCODING);
+ if(contents) {
+ // Skip the Byte Order Mark (BOM)
+ contents = contents.substring(contents.indexOf("<"));
+ }
+ return new elementTree.ElementTree(elementTree.XML(contents));
+}
+
+function setPreference(appPath, preference, value) {
+ var configFile = getConfigPath(appPath);
+ var xml = parseElementtreeSync(configFile);
+ var pref = xml.find("preference[@name=\"" + preference + "\"]");
+
+ util.medicLog("Setting \"" + preference + "\" preference to \"" +
value + "\"");
--- End diff --
Conside using single quotes to avoid escaping
> Implement an Appium test for CB-10873
> -------------------------------------
>
> Key: CB-11084
> URL: https://issues.apache.org/jira/browse/CB-11084
> Project: Apache Cordova
> Issue Type: Test
> Components: Appium, Medic, Plugin Camera
> Environment: iOS
> Reporter: Alexander Sorokin
> Assignee: Alexander Sorokin
>
> Make Appium test the following scenario:
> When this preference is present in config.xml:
> <preference name="CameraUsesGeolocation" value="true" />
> The app shouldn't crash on iOS when taking a JPEG picture.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]