-
Notifications
You must be signed in to change notification settings - Fork 38
Config file structure
The json config file used by phonegap desktop is a simple three level hierarchy.
Section
Element
Data
Additional files (e.g. for plugins) can be merged in to the in-memory object easily.
There are some initial config settings at the start of the file;
true/false: Determines whether data in arrays will be returned with each element in sequence, otherwise a random element will be chosen.
This setting can be overridden in each section.
decimal 0-1: if a random number number is less than this value an exception will be generated. Set to 0 if you want no errors to be triggered by the PhoneGap api. Set to 1 if you want to test all your error handlers. This setting can be overridden in each section.
integer: number of milliseconds after startup to trigger the deviceready event. Defaults to 200
string: path to an additional config file to load at startup. This setting is intended for situations where different sets of test data are regularly needed. Each set can be defined in separate files and easily switched as needed.
- Simple config where test data is defined in a separate file
{
"internal":{
"arraySequence":true,
"exceptionThreshold":0,
"startupDelay" : 200,
"currentFile": "android-test-data.json"
}
}
- Define base settings. accelerometer data will be returned in random order, camera functions will cause errors 3 times out of 10
{
"internal":{
"arraySequence":true,
"exceptionThreshold":0,
"startupDelay" : 200
},
"accelerometer":{
"arraySequence": false,
...
},
"camera":{
"exceptionThreshold": 0.3,
...
},
...