Skip to content

Instantly share code, notes, and snippets.

@halemmerich
Created April 20, 2024 04:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save halemmerich/3d0f1d41d8eebe76eedc8553530e5dd5 to your computer and use it in GitHub Desktop.
Save halemmerich/3d0f1d41d8eebe76eedc8553530e5dd5 to your computer and use it in GitHub Desktop.
{
"app" : "android",
"tests" : [ {
"steps" : [
{"t":"wrap", "fn": "Bangle.setGPSPower", "id": "gpspower"},
{"t":"cmd", "js": "NRF.getSecurityStatus = () => {}"},
{"t":"cmd", "js": "eval(require('Storage').read('android.boot.js'))"},
{"t":"assert", "js": "!NRF.getSecurityStatus().connected", "is":"true", "text": "Not connected"},
{"t":"assertArray", "js": "Bangle._PWR.GPS", "is":"undefinedOrEmpty", "text": "No GPS clients"},
{"t":"assert", "js": "Bangle.isGPSOn()", "is":"false", "text": "isGPSOn is correct"},
{"t":"assert", "js": "Bangle.setGPSPower(1, 'test')", "is":"true", "text": "setGPSPower returns true when switching on"},
{"t":"assertArray", "js": "Bangle._PWR.GPS", "is":"notEmpty", "text": "GPS clients"},
{"t":"assert", "js": "Bangle.isGPSOn()", "is":"true", "text": "isGPSOn is correct"},
{"t":"assertCall", "id": "gpspower", "argAsserts": [ { "t": "assert", "arg": "0", "is": "equal", "to": 1 } ] , "text": "internal GPS switched on"}
{"t":"assert", "js": "Bangle.setGPSPower(0, 'test')", "is":"false", "text": "setGPSPower returns false when switching off"},
{"t":"assertArray", "js": "Bangle._PWR.GPS", "is":"undefinedOrEmpty", "text": "No GPS clients"},
{"t":"assert", "js": "Bangle.isGPSOn()", "is":"false", "text": "isGPSOn is correct"},
{"t":"assertCall", "id": "gpspower", "argAsserts": [ { "t": "assert", "arg": "0", "is": "equal", "to": 0 } ] , "text": "internal GPS switched off"}
]
}]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment