Best JavaScript code snippet using playwright-internal
systemParams.js
Source:systemParams.js  
1var setGetSystem = new Array;2var getSystem = new Array;3setGetSystem[setGetSystem.length] = [["VT278-003","call getProperty with  applicationIconBadge as 1","1"],4["System","applicationIconBadge","1"],5["System","getProperty","method","'applicationIconBadge'|returnGetProperty","sync"]6]7setGetSystem[setGetSystem.length] = [["VT278-004","call getProperty with applicationIconBadge as 0","0"],8["System","applicationIconBadge","0"],9["System","getProperty","method","'applicationIconBadge'|returnGetProperty","sync"]10]11getSystem[getSystem.length] = [["VT278-005","call getProperty with country"],12["System","getProperty","method","'country'|returnGetProperty","sync"]13]14getSystem[getSystem.length] = [["VT278-006","call getProperty with deviceName"],15["System","getProperty","method","'deviceName'|returnGetProperty","sync"]16]17getSystem[getSystem.length] = [["VT278-007","call getProperty with deviceOwnerEmail"],18["System","getProperty","method","'deviceOwnerEmail'|returnGetProperty","sync"]19]20getSystem[getSystem.length] = [["VT278-008","call getProperty with deviceOwnerName"],21["System","getProperty","method","'deviceOwnerName'|returnGetProperty","sync"]22]23getSystem[getSystem.length] = [["VT278-009","call getProperty with devicePushId"],24["System","getProperty","method","'devicePushId'|returnGetProperty","sync"]25]26getSystem[getSystem.length] = [["VT278-010","call getProperty with freeServerPort"],27["System","getProperty","method","'freeServerPort'|returnGetProperty","sync"]28]29getSystem[getSystem.length] = [["VT278-011","call getProperty with hasCalendar"],30["System","getProperty","method","'hasCalendar'|returnGetProperty","sync"]31]32getSystem[getSystem.length] = [["VT278-012","call getProperty with hasCamera"],33["System","getProperty","method","'hasCamera'|returnGetProperty","sync"]34]35getSystem[getSystem.length] = [["VT278-013","call getProperty with hasCellNetwork"],36["System","getProperty","method","'hasCellNetwork'|returnGetProperty","sync"]37]38getSystem[getSystem.length] = [["VT278-015","call getProperty with hasNetwork"],39["System","getProperty","method","'hasNetwork'|returnGetProperty","sync"]40]41getSystem[getSystem.length] = [["VT278-017","call getProperty with hasSqlite"],42["System","getProperty","method","'hasSqlite'|returnGetProperty","sync"]43]44getSystem[getSystem.length] = [["VT278-018","call getProperty with hasTouchscreen"],45["System","getProperty","method","'hasTouchscreen'|returnGetProperty","sync"]46]47getSystem[getSystem.length] = [["VT278-019","call getProperty with hasWifiNetwork"],48["System","getProperty","method","'hasTouchscreen'|returnGetProperty","sync"]49]50setGetSystem[setGetSystem.length] = [["VT278-022","call getProperty with httpProxyURI"],51["System","httpProxyURI","'http://wwwgate0.mot.com:1080'"],52["System","getProperty","method","'httpProxyURI'|returnGetProperty","sync"]53]54getSystem[getSystem.length] = [["VT278-024","call getProperty with isEmulator"],55["System","getProperty","method","'isEmulator'|returnGetProperty","sync"]56]57getSystem[getSystem.length] = [["VT278-026","call getProperty with isMotorolaDevice"],58["System","getProperty","method","'isMotorolaDevice'|returnGetProperty","sync"]59]60getSystem[getSystem.length] = [["VT278-028","default localServerPort","8080"],61["System","getProperty","method","'localServerPort'|returnGetProperty","sync"]62]63setGetSystem[setGetSystem.length] = [["VT278-027","set localServerPort","8081"],64["System","localServerPort","8081"],65["System","getProperty","method","'localServerPort'|returnGetProperty","sync"]66]67setGetSystem[setGetSystem.length] = [["VT278-029","call getProperty with locale"],68["System","localServerPort","8081"],69["System","getProperty","method","'locale'|returnGetProperty","sync"]70]71setGetSystem[setGetSystem.length] = [["VT278-033","set lockWindowSize as True, call getProperty with lockWindowSize","true"],72["System","lockWindowSize","true"],73["System","getProperty","method","'lockWindowSize'|returnGetProperty","sync"]74]75setGetSystem[setGetSystem.length] = [["VT278-034","set lockWindowSize as false, call getProperty with lockWindowSize","false"],76["System","lockWindowSize","false"],77["System","getProperty","method","'lockWindowSize'|returnGetProperty","sync"]78]79getSystem[getSystem.length] = [["VT278-035","call getProperty with oemInfo"],80["System","getProperty","method","'oemInfo'|returnGetProperty","sync"]81]82getSystem[getSystem.length] = [["VT278-036","call getProperty with osVersion"],83["System","getProperty","method","'osVersion'|returnGetProperty","sync"]84]85getSystem[getSystem.length] = [["VT278-037","call getProperty with phoneId"],86["System","getProperty","method","'phoneId'|returnGetProperty","sync"]87]88getSystem[getSystem.length] = [["VT278-038","call getProperty with phoneNumber"],89["System","getProperty","method","'phoneNumber'|returnGetProperty","sync"]90]91getSystem[getSystem.length] = [["VT278-039","call getProperty with platform"],92["System","getProperty","method","'platform'|returnGetProperty","sync"]93]94getSystem[getSystem.length] = [["VT278-040","call getProperty with ppiX"],95["System","getProperty","method","'ppiX'|returnGetProperty","sync"]96]97getSystem[getSystem.length] = [["VT278-041","call getProperty with ppiY"],98["System","getProperty","method","'ppiY'|returnGetProperty","sync"]99]100getSystem[getSystem.length] = [["VT278-042","call getProperty with realScreenHeight"],101["System","getProperty","method","'realScreenHeight'|returnGetProperty","sync"]102]103getSystem[getSystem.length] = [["VT278-043","call getProperty with realScreenWidth"],104["System","getProperty","method","'realScreenWidth'|returnGetProperty","sync"]105]106setGetSystem[setGetSystem.length] = [["VT278-046","set screenAutoRotate as false, call getProperty with screenAutoRotate","false"],107["System","screenAutoRotate","false"],108["System","getProperty","method","'screenAutoRotate'|returnGetProperty","sync"]109]110setGetSystem[setGetSystem.length] = [["VT278-047","set screenAutoRotate as true, call getProperty with screenAutoRotate","true"],111["System","screenAutoRotate","true"],112["System","getProperty","method","'screenAutoRotate'|returnGetProperty","sync"]113]114getSystem[getSystem.length] = [["VT278-048","call getProperty with screenHeight"],115["System","getProperty","method","'screenHeight'|returnGetProperty","sync"]116]117getSystem[getSystem.length] = [["VT278-049","call getProperty with screenWidth"],118["System","getProperty","method","'screenWidth'|returnGetProperty","sync"]119]120setGetSystem[setGetSystem.length] = [["VT278-054","set screenSleeping as true, call getProperty with screenSleeping","true"],121["System","screenSleeping","true"],122["System","getProperty","method","'screenSleeping'|returnGetProperty","sync"]123]124setGetSystem[setGetSystem.length] = [["VT278-055","set screenSleeping as false, call getProperty with screenSleeping","false"],125["System","screenSleeping","false"],126["System","getProperty","method","'screenSleeping'|returnGetProperty","sync"]127]128getSystem[getSystem.length] = [["VT278-056","call getProperty with securityTokenNotPassed"],129["System","getProperty","method","'securityTokenNotPassed'|returnGetProperty","sync"]130]131getSystem[getSystem.length] = [["VT278-061","call getProperty with uuid"],132["System","getProperty","method","'uuid'|returnGetProperty","sync"]133]134setGetSystem[setGetSystem.length] = [["VT278-062","call getProperty with webviewFramework"],135["System","getProperty","method","'webviewFramework'|returnGetProperty","sync"]136]137setGetSystem[setGetSystem.length] = [["VT278-062","call getProperty with webviewFramework"],138["System","getProperty","method","'webviewFramework'|returnGetProperty","sync"]139]140// TODO: Need to provide path to delete the folder141setGetSystem[setGetSystem.length] = [["VT281-069","call deleteFolder"],142["System","deleteFolder","method","returnGetProperty","sync"],143]144getSystem[getSystem.length] = [["VT278-070","call getAllProperties()"],145["System","getAllProperties","method","returnGetProperty","sync"]146]147getSystem[getSystem.length] = [["VT278-070","call getAllProperties()"],148["System","getAllProperties","method","returnGetProperty","sync"]149]150// TODO:  getRegistrySetting returns error as docs clearly not updated151getSystem[getSystem.length] = [["VT278-071","getRegistrySetting with hive, subkey and setting"],152["System","getRegistrySetting","method","{hive:'HKLM', key:'software', Setting:'RhoElementsTest'}|returnGetProperty","sync"]153]154setGetSystem[setGetSystem.length] = [["VT278-072","call getRegistrySetting with hive as HKLM type as MULTISZ subkey as Software setting as Rhoelements value as hello\nworld , call setRegistrySetting with hive, subkey and setting"],155["System","setRegistrySetting","method","{hive:'HKLM', key:'software', Setting:'RhoElementsTest', persistent:true}|returnGetProperty","sync"]156["System","getRegistrySetting","method","{hive:'HKLM', type:'MULTISZ', key:'Software', setting:'RhoElementsTest', value:'hello\nworld', persistent:true}|returnGetProperty","sync"]157]158setGetSystem[setGetSystem.length] = [["VT278-073","call getRegistrySetting with hive as HKCU type as DWORD subkey as Software setting as Rhoelements value as 12345 , call setRegistrySetting with hive, subkey and setting"],159["System","setRegistrySetting","method","{hive:'HKCU', key:'software', Setting:'RhoElementsTest', persistent:true}|returnGetProperty","sync"]160["System","getRegistrySetting","method","{hive:'HKCU', type:'DWORD', key:'Software', setting:'RhoElementsTest', value:'12345', persistent:true}|returnGetProperty","sync"]161]162setGetSystem[setGetSystem.length] = [["VT278-074","call getRegistrySetting with hive as HKCR type as string subkey as Software setting as symbol value as hello12 , call setRegistrySetting with hive, subkey and setting"],163["System","setRegistrySetting","method","{hive:'HKCR', key:'software', Setting:'symbol', persistent:true}|returnGetProperty","sync"]164["System","getRegistrySetting","method","{hive:'HKCR', type:'string', key:'Software', setting:'symbol', value:'hello12', persistent:true}|returnGetProperty","sync"]165]166setGetSystem[setGetSystem.length] = [["VT278-075","call getRegistrySetting with hive as HKCR type as binary subkey as Software setting as Motorola value as 11111 , call setRegistrySetting with hive, subkey and setting"],167["System","setRegistrySetting","method","{hive:'HKCR', key:'software', Setting:'Motorola', persistent:true}|returnGetProperty","sync"]168["System","getRegistrySetting","method","{hive:'HKCR', type:'binary', key:'Software', setting:'Motorola', value:'11111', persistent:true}|returnGetProperty","sync"]169]170getSystem[getSystem.length] = [["VT278-076","call getStartParams()"],171["System","getStartParams","method","returnGetProperty","sync"]172]173getSystem[getSystem.length] = [["VT278-077","call isApplicationInstalled() with application name which is there in device"],174["System","isApplicationInstalled","method","'rhomobile nativejasmine'|returnGetProperty","sync"]175]176getSystem[getSystem.length] = [["VT278-077","call isApplicationInstalled() with application name which is there in device"],177["System","isApplicationInstalled","method","'com.rhomobile.nativejasmine'|returnGetProperty","sync"]178]179getSystem[getSystem.length] = [["VT278-078","call isApplicationInstalled() with application name which is not there in device"],180["System","isApplicationInstalled","method","'RhoElements3'|returnGetProperty","sync"]181]182// TODO: We may remove this to manual code from VT278-084 to VT278-092183setGetSystem[setGetSystem.length] = [["VT278-084","call setWindowFrame() with X 50, Y 50, width 200 and height 200"],184["System","setWindowFrame","method","50,50,200,200|returnGetProperty","sync"]185]186setGetSystem[setGetSystem.length] = [["VT278-085","call setWindowFrame() with X 200, Y 200, width 500 and height 500"],187["System","setWindowFrame","method","200,200,500,500|returnGetProperty","sync"]188]189setGetSystem[setGetSystem.length] = [["VT278-086","call setWindowFrame() with X -50, Y -50, width -500 and height -500"],190["System","setWindowFrame","method","-50,-50,-500,-500|returnGetProperty","sync"]191]192setGetSystem[setGetSystem.length] = [["VT278-087","call setWindowPosition() with X 100, Y 200"],193["System","setWindowPosition","method","100,200|returnGetProperty","sync"]194]195setGetSystem[setGetSystem.length] = [["VT278-088","call setWindowPosition() with X 100, Y 0"],196["System","setWindowPosition","method","100,0|returnGetProperty","sync"]197]198setGetSystem[setGetSystem.length] = [["VT278-089","call setWindowPosition() with X -50, Y -50"],199["System","setWindowPosition","method","-50,-50|returnGetProperty","sync"]200]201setGetSystem[setGetSystem.length] = [["VT278-090","call setWindowSize() with width 400 and height 300"],202["System","setWindowSize","method","400,300|returnGetProperty","sync"]203]204setGetSystem[setGetSystem.length] = [["VT278-091","call setWindowSize() with width 400 and height 600"],205["System","setWindowSize","method","400,600|returnGetProperty","sync"]206]207setGetSystem[setGetSystem.length] = [["VT278-092","call setWindowSize() with width -500 and height 0"],208["System","setWindowSize","method","-500,0|returnGetProperty","sync"]209]210setGetSystem[setGetSystem.length] = [["VT278-107","set httpProxyURI , call getProperty with httpProxyURI","http://wwwgate0.mot.com:1080"],211["System","setProperty","method","'httpProxyURI','http://wwwgate0.mot.com:1080'"],212["System","getProperty","method","'httpProxyURI'|returnGetProperty","sync"]213]214setGetSystem[setGetSystem.length] = [["VT278-108","set localServerPort to 8081 , call getpropety with localServerPort","8081"],215["System","setProperty","method","'localServerPort', '8081'"],216["System","getProperty","method","'localServerPort'|returnGetProperty","sync"]217]218setGetSystem[setGetSystem.length] = [["VT278-109","Don't set localServerPort to any value , call getpropety with localServerPort",""],219["System","setProperty","method","'localServerPort', ''"],220["System","getProperty","method","'localServerPort'|returnGetProperty","sync"]221]222setGetSystem[setGetSystem.length] = [["VT278-116"," set screenAutoRotate as true , call getProperty with screenAutoRotate","true"],223["System","setProperty","method","'screenAutoRotate', 'true'"],224["System","getProperty","method","'screenAutoRotate'|returnGetProperty","sync"]225]226setGetSystem[setGetSystem.length] = [["VT278-117"," set screenAutoRotate as false , call getProperty with screenAutoRotate","false"],227["System","setProperty","method","'screenAutoRotate', 'false'"],228["System","getProperty","method","'screenAutoRotate'|returnGetProperty","sync"]229]230setGetSystem[setGetSystem.length] = [["VT278-120"," set screenSleeping as true , call getProperty with screenSleeping","true"],231["System","setProperty","method","'screenSleeping', 'true'"],232["System","getProperty","method","'screenSleeping'|returnGetProperty","sync"]233]234setGetSystem[setGetSystem.length] = [["VT278-121"," set screenSleeping as false , call getProperty with screenSleeping","false"],235["System","setProperty","method","'screenSleeping', 'false'"],236["System","getProperty","method","'screenSleeping'|returnGetProperty","sync"]237]238// TODO : Need to analyze this test case239setGetSystem[setGetSystem.length] = [["VT278-123"," call setproperty with screenSleeping as false , call setproperty with screenAutoRotate as false , call setproperty with lockWindowSize as false, call clearAllProperties() , call getproperties with screenSleeping, screenAutoRotate and lockWindowSize"],240["System","setProperty","method",":screenSleeping, 'false'"],241["System","setProperty","method",":screenAutoRotate, 'false'"],242["System","setProperty","method",":lockWindowSize, 'false'"],243["System","clearAllProperties","method","returnGetProperty"],244["System","getproperties","method","['screenSleeping','screenAutoRotate','lockWindowSize'","sync"]245]246// Need to Check what is callback as action URL (Looks to me same as async call)247getSystem[getSystem.length] = [["VT278-124","call getproperties with country,deviceName, devicePushId, freeServerPort and callback as action URL"],248["System","getProperties","method","['country','deviceName','devicePushId','freeServerPort'], url_for(:action => :returnGetProperty)","async"]249]250getSystem[getSystem.length] = [["VT278-125","call getproperties with country,deviceName, devicePushId, freeServerPort and sync callback"],251["System","getProperties","method","['country','deviceName','devicePushId','freeServerPort']|returnGetProperty","sync"]252]253// TODO: Lambda call is not working here254getSystem[getSystem.length] = [["VT278-126","call getproperties with country,deviceName, devicePushId, freeServerPort and callback as anonymous function"],255["System","getProperties","method","['country','deviceName','devicePushId','freeServerPort']|returnGetProperty","lambda"]256]257getSystem[getSystem.length] = [["VT278-127","call getproperties with country,deviceName, devicePushId, freeServerPort and callback as async callback function"],258["System","getProperties","method","['country','deviceName','devicePushId','freeServerPort'], url_for(:action => :returnGetProperty)","async"]259]260// Need to Check what is callback as action URL (Looks to me same as async call)261getSystem[getSystem.length] = [["VT278-128","call getproperty with deviceName and callback as action URL"],262["System","getProperties","method","['deviceName'], url_for(:action => :returnGetProperty)","async"]263]264getSystem[getSystem.length] = [["VT278-129"," call getproperty with deviceName and  and sync callback"],265["System","getProperties","method","['deviceName']|returnGetProperty","sync"]266]267getSystem[getSystem.length] = [["VT278-130"," call getproperty with deviceName and  and callback as anonymous function"],268["System","getProperties","method","['deviceName']|returnGetProperty","lambda"]269]270getSystem[getSystem.length] = [["VT278-131","call getproperty with deviceName and  and callback as  async defined function"],271]272setGetSystem[setGetSystem.length] = [["VT278-132","call setproperties with applicationIconBadge as 1, call getproperties with  applicationIconBadge","1"],273["System","setProperties","method","{'applicationIconBadge'=>1}"]274["System","getProperties","method","['applicationIconBadge']|returnGetProperty","sync"]275]276setGetSystem[setGetSystem.length] = [["VT278-133","call setproperties with applicationIconBadge as 0, call getproperties with  applicationIconBadge","0"],277["System","setProperties","method","{'applicationIconBadge'=>0}"]278["System","getProperties","method","['applicationIconBadge']|returnGetProperty","sync"]279]280getSystem[getSystem.length] = [["VT278-134"," call getproperties with country"],281["System","getProperties","method","['country']|returnGetProperty","sync"]282]283getSystem[getSystem.length] = [["VT278-135","call getproperties with deviceName"],284["System","getProperties","method","['deviceName']|returnGetProperty","sync"]285]286getSystem[getSystem.length] = [["VT278-136","call getproperties with deviceOwnerEmail"],287["System","getProperties","method","['deviceOwnerEmail']|returnGetProperty","sync"]288]289getSystem[getSystem.length] = [["VT278-137","call getproperties with deviceOwnerName"],290["System","getProperties","method","['deviceOwnerName']|returnGetProperty","sync"]291]292getSystem[getSystem.length] = [["VT278-138","call getproperties with devicePushId"],293["System","getProperties","method","['devicePushId']|returnGetProperty","sync"]294]295getSystem[getSystem.length] = [["VT278-139","call getproperties with freeServerPort"],296["System","getProperties","method","['freeServerPort']|returnGetProperty","sync"]297]298getSystem[getSystem.length] = [["VT278-140","call getproperties with hasCalendar"],299["System","getProperties","method","['hasCalendar']|returnGetProperty","sync"]300]301getSystem[getSystem.length] = [["VT278-141","call getproperties with hasCamera"],302["System","getProperties","method","['hasCamera']|returnGetProperty","sync"]303]304getSystem[getSystem.length] = [["VT278-142","connect the device to cell network, call getproperties with hasCellNetwork"],305["System","getProperties","method","['hasCellNetwork']|returnGetProperty","sync"]306]307getSystem[getSystem.length] = [["VT278-143","Disconnect the device from cell network,  call getproperties with hasCellNetwork"],308["System","getProperties","method","['hasCellNetwork']|returnGetProperty","sync"]309]310getSystem[getSystem.length] = [["VT278-144","connect the device to network, call getproperties with hasNetwork"],311["System","getProperties","method","['hasNetwork']|returnGetProperty","sync"]312]313getSystem[getSystem.length] = [["VT278-145","Disconnect the device from network, call getproperties with hasNetwork"],314["System","getProperties","method","['hasNetwork']|returnGetProperty","sync"]315]316getSystem[getSystem.length] = [["VT278-146","call getproperties with hasSqlite"],317["System","getProperties","method","['hasSqlite']|returnGetProperty","sync"]318]319getSystem[getSystem.length] = [["VT278-147","call getproperties with hasTouchscreen"],320["System","getProperties","method","['hasTouchscreen']|returnGetProperty","sync"]321]322getSystem[getSystem.length] = [["VT278-148","connect the device to wifi network, call getproperties with hasWifiNetwork"],323["System","getProperties","method","['hasWifiNetwork']|returnGetProperty","sync"]324]325getSystem[getSystem.length] = [["VT278-149","Disconnect the device from wifi network, call getproperties with hasWifiNetwork"],326["System","getProperties","method","['hasWifiNetwork']|returnGetProperty","sync"]327]328setGetSystem[setGetSystem.length] = [["VT278-150","call setproperties with httpProxyURI, call call getproperties with httpProxyURI","Bibash"],329["System","setProperties","method","{'httpProxyURI'=>Bibash}"],330["System","getProperties","method","['httpProxyURI']|returnGetProperty","sync"]331]332getSystem[getSystem.length] = [["VT278-152","Run the application on device, call getproperties with isEmulator"],333["System","getProperties","method","['isEmulator']|returnGetProperty","sync"]334]335getSystem[getSystem.length] = [["VT278-154","call getproperties with isMotorolaDevice"],336["System","getProperties","method","['isMotorolaDevice']|returnGetProperty","sync"]337]338getSystem[getSystem.length] = [["VT278-157","call getproperties with locale"],339["System","getProperties","method","['locale']|returnGetProperty","sync"]340]341getSystem[getSystem.length] = [["VT278-161","call getproperties with oemInfo"],342["System","getProperties","method","['oemInfo']|returnGetProperty","sync"]343]344getSystem[getSystem.length] = [["VT278-162","call getproperties with osVersion"],345["System","getProperties","method","['osVersion']|returnGetProperty","sync"]346]347getSystem[getSystem.length] = [["VT278-163","call getproperties with phoneId"],348["System","getProperties","method","['phoneId']|returnGetProperty","sync"]349]350getSystem[getSystem.length] = [["VT278-164","call getproperties with phoneNumber"],351["System","getProperties","method","['phoneNumber']|returnGetProperty","sync"]352]353getSystem[getSystem.length] = [["VT278-165","call getproperties with platform"],354["System","getProperties","method","['platform']|returnGetProperty","sync"]355]356getSystem[getSystem.length] = [["VT278-166","call getproperties with ppiX"],357["System","getProperties","method","['ppiX']|returnGetProperty","sync"]358]359getSystem[getSystem.length] = [["VT278-167","call getproperties with ppiY"],360["System","getProperties","method","['ppiY']|returnGetProperty","sync"]361]362getSystem[getSystem.length] = [["VT278-168","call getproperties with realScreenHeight"],363["System","getProperties","method","['realScreenHeight']|returnGetProperty","sync"]364]365getSystem[getSystem.length] = [["VT278-169","call getproperties with realScreenWidth"],366["System","getProperties","method","['realScreenWidth']|returnGetProperty","sync"]367]368getSystem[getSystem.length] = [["VT278-172","call getproperties with screenHeight"],369["System","getProperties","method","['screenHeight']|returnGetProperty","sync"]370]371getSystem[getSystem.length] = [["VT278-173","call getproperties with screenWidth"],372["System","getProperties","method","['screenWidth']|returnGetProperty","sync"]373]374setGetSystem[setGetSystem.length] = [["VT278-178"," call setproperties with screenSleeping as true, call getproperties with screenSleeping","true"],375["System","setProperties","method","{'screenSleeping'=>true}"],376["System","getProperties","method","['screenSleeping']|returnGetProperty","sync"]377]378setGetSystem[setGetSystem.length] = [["VT278-179"," call setproperties with screenSleeping as false, call getproperties with screenSleeping","false"],379["System","setProperties","method","{'screenSleeping'=>false}"],380["System","getProperties","method","['screenSleeping']|returnGetProperty","sync"]381]382getSystem[getSystem.length] = [["VT278-180","call getproperties with securityTokenNotPassed"],383["System","getProperties","method","['securityTokenNotPassed']|returnGetProperty","sync"]384]385getSystem[getSystem.length] = [["VT278-183","call getproperties with uuid"],386["System","getProperties","method","['uuid']|returnGetProperty","sync"]387]388getSystem[getSystem.length] = [["VT278-184","call getproperties with webviewFramework"],389["System","getProperties","method","['webviewFramework']|returnGetProperty","sync"]390] 391setGetSystem[setGetSystem.length] = [["VT278-185","call getOemInfo method "," "],392["System","oemInfo","method","returnGetProperty","sync"]393]394setGetSystem[setGetSystem.length] = [["VT278-186","call getUuid method"," "],395["System","uuid","method","returnGetProperty","sync"]396]397setGetSystem[setGetSystem.length] = [["VT278-187","call getRegistrySetting with hive as HKLM type as MULTISZ subkey as Software setting as Rhoelements value as hello world , call setRegistrySetting with hive, subkey and setting","hello world"],398["System","setRegistrySetting","method","{hive:'HKLM', type:'MULTISZ', key:'Software', setting:'RhoElementsTest', value:'hello world', persistent:'true'}"],399["System","getRegistrySetting","method","{hive:'HKLM', key:'Software', setting:'RhoElementsTest'}|returnGetProperty","sync"]400]401setGetSystem[setGetSystem.length] = [["VT278-188","call getRegistrySetting with hive as HKLM type as MULTISZ subkey as Software setting as Rhoelements value as hello world , call setRegistrySetting with hive, subkey and setting","true"],402["System","setRegistrySetting","method","{hive:'HKLM', type:'MULTISZ', key:'Software', setting:'RhoElementsTest', value:'hello world', persistent:'true'}|returnGetProperty","sync"],403]404setGetSystem[setGetSystem.length] = [["VT278-189","call setRegistrySetting with hive, subkey and setting and check the ret value ","true"],405["System","setRegistrySetting","method","{hive:'HKLM', type:'Binary', key:'Software', setting:'Rho', value:'10101010', persistent:'false'}|returnGetProperty","sync"],406]407setGetSystem[setGetSystem.length] = [["VT278-190","call setRegistrySetting with invalid key and check the ret value ","false"],408["System","setRegistrySetting","method","{hive:'HKLM', type:'Binary', key:'Honey', setting:'RhoElementsTest', value:'1010101', persistent:'false'}|returnGetProperty","sync"],409]410setGetSystem[setGetSystem.length] = [["VT278-191","call deleteRegistrySetting  with Persistence  check the return value","true"],411["System","setRegistrySetting","method","{hive:'HKCU', type:'String', key:'Software', setting:'RhoElementsTest', value:'Test123', persistent:'true'}"],412["System","deleteRegistrySetting","method","{hive:'HKCU', key:'Software', setting:'RhoElementsTest',persistent:'true'}|returnGetProperty","sync"]413]414setGetSystem[setGetSystem.length] = [["VT278-192","call setRegistrySetting with invalid key and check the ret value ","false"],415["System","deleteRegistrySetting","method","{hive:'HKLM',key:'Softy', setting:'RhoElementsTest',persistent:'true'}|returnGetProperty","sync"],416]417setGetSystem[setGetSystem.length] = [["VT278-193","set and getRegistry setting with HKU and persistence as True and type MultiSZ","hello world"],418["System","setRegistrySetting","method","{hive:'HKU', type:'MultiSZ', key:'Software', setting:'RhoElementsTest', value:'hello world', persistent:'true'}"],419["System","getRegistrySetting","method","{hive:'HKU', key:'Software', setting:'RhoElementsTest'}|returnGetProperty","sync"]420]421setGetSystem[setGetSystem.length] = [["VT278-194","set and getRegistry setting with HKCU and persistence as False and Type as String","Test123"],422["System","setRegistrySetting","method","{hive:'HKCU', type:'String', key:'Software', setting:'Motorola', value:'Test123', persistent:'false'}"],423["System","getRegistrySetting","method","{hive:'HKCU', key:'Software', setting:'Motorola'}|returnGetProperty","sync"]424]425setGetSystem[setGetSystem.length] = [["VT278-195","set and getRegistry setting with HKCR and persistence as False and Type as DWORD","12345"],426["System","setRegistrySetting","method","{hive:'HKCR', type:'DWORD', key:'Software', setting:'Symbol', value:'12345', persistent:'false'}"],427["System","getRegistrySetting","method","{hive:'HKCR', key:'Software', setting:'Symbol'}|returnGetProperty","sync"]428]429setGetSystem[setGetSystem.length] = [["VT278-196","set and getRegistry setting with HKLM and persistence True and Type as Binary","111111"],430["System","setRegistrySetting","method","{hive:'HKLM', type:'Binary', key:'Software', setting:'RhoTnV', value:'111111', persistent:'true'}"],431["System","getRegistrySetting","method","{hive:'HKLM', key:'Software', setting:'RhoTnV'}|returnGetProperty","sync"]432]433setGetSystem[setGetSystem.length] = [["VT278-197","set and getRegistry setting with HKLM and persistence False and Type as Binary and key as multilevel path","111111"],434["System","setRegistrySetting","method","{hive:'HKLM', type:'Binary', key:'Software\Symbol\Audio', setting:'Rhoelement', value:'111111', persistent:'false'}"],435["System","getRegistrySetting","method","{hive:'HKLM', key:'Software\Symbol\Audio', setting:'Rhoelement'}|returnGetProperty","sync"]436]437setGetSystem[setGetSystem.length] = [["VT278-198","call getRegistry setting with invalid properties",""],438["System","getRegistrySetting","method","{hive:'HKLM', key:'Boo', setting:'Rhoelement'}|returnGetProperty","sync"],439] 440setGetSystem[setGetSystem.length] = [["VT278-199","call setRegistry with key as null","false"],441["System","setRegistrySetting","method","{hive:'HKLM', type:'Binary', key:'', setting:'Rhoelement', value:'111111', persistent:'false'}|returnGetProperty","sync"],442]443setGetSystem[setGetSystem.length] = [["VT278-200","call setRegistry with setting as null","false"],444["System","setRegistrySetting","method","{hive:'HKLM', type:'Binary', key:'Software', setting:'', value:'111111', persistent:'false'}|returnGetProperty","sync"],445]446setGetSystem[setGetSystem.length] = [["VT278-201","call setRegistry with persisten value as inalid ","false"],447["System","setRegistrySetting","method","{hive:'HKLM', type:'Binary', key:'Software', setting:'Rhoelement', value:'111111', persistent:'boo'}|returnGetProperty","sync"],...system_js_test.js
Source:system_js_test.js  
1	var sys_get_property = [2	3	{4		testName		:	"VT300-005 | call getProperty with country | US",5		propertyName	:	"country",6		osType			: 	["WINDOWS","ANDROID","APPLE","WP8","WINDOWS_DESKTOP"]7	},8	{9		testName		:	"VT300-006 | call getProperty with deviceName | MC75",10		propertyName	:	"deviceName",11		osType			: 	["WINDOWS","ANDROID","APPLE","WP8","WINDOWS_DESKTOP"]12	},13	{14		testName		:	"VT300-007 | call getProperty with deviceOwnerEmail | ",15		propertyName	:	"deviceOwnerEmail",16		osType			: 	["ANDROID"]17	},18	{19		testName		:	"VT300-008 | call getProperty with deviceOwnerName | ",20		propertyName	:	"deviceOwnerName",21		osType			: 	["ANDROID"]22	},23	{24		testName		:	"VT300-009 | call getProperty with devicePushId | ",25		propertyName	:	"devicePushId",26		osType			: 	["WINDOWS","ANDROID","APPLE","WP8","WINDOWS_DESKTOP"]27	},28	{29		testName		:	"VT300-010 | call getProperty with freeServerPort | ",30		propertyName	:	"freeServerPort",31		osType			: 	["WINDOWS","ANDROID","APPLE","WP8","WINDOWS_DESKTOP"]32	},33	{34		testName		:	"VT300-011 | call getProperty with hasCalendar | ",35		propertyName	:	"hasCalendar",36		osType			: 	["WINDOWS","ANDROID","APPLE","WP8","WINDOWS_DESKTOP"]37	},38	{39		testName		:	"VT300-012 | call getProperty with hasCamera | ",40		propertyName	:	"hasCamera",41		osType			: 	["WINDOWS","ANDROID","APPLE","WP8","WINDOWS_DESKTOP"]42	},43	{44		testName		:	"VT300-017 | call getProperty with isRhoSimulator | ",45		propertyName	:	"isRhoSimulator",46		osType			: 	["WINDOWS","ANDROID","APPLE","WP8","WINDOWS_DESKTOP"]47	},48	{49		testName		:	"VT300-018 | call getProperty with hasTouchscreen | ",50		propertyName	:	"hasTouchscreen",51		osType			: 	["WINDOWS","ANDROID","APPLE","WP8","WINDOWS_DESKTOP"]52	},53	{54		testName		:	"VT300-023 | call getProperty with isEmulator | ",55		propertyName	:	"isEmulator",56		osType			: 	["WINDOWS","ANDROID","APPLE","WP8","WINDOWS_DESKTOP"]57	},58	{59		testName		:	"VT300-024 | call getProperty with isSymbolDevice | ",60		propertyName	:	"isSymbolDevice",61		osType			: 	["WINDOWS","ANDROID","APPLE","WP8","WINDOWS_DESKTOP"]62	},63	{64		testName		:	"VT300-026 | default localServerPort | ",65		propertyName	:	"localServerPort",66		osType			: 	["WINDOWS","ANDROID","APPLE","WP8","WINDOWS_DESKTOP"]67	},68	{69		testName		:	"VT300-033 | call getProperty with oemInfo | ",70		propertyName	:	"oemInfo",71		osType			: 	["WINDOWS","ANDROID","SYMBOL"]72	},73	74	{75		testName		:	"VT300-034 | call getProperty with osVersion | ",76		propertyName	:	"osVersion",77		osType			: 	["WINDOWS","ANDROID","APPLE","WP8","WINDOWS_DESKTOP"]78	},79	80	{81		testName		:	"VT300-035 | call getProperty with phoneId | ",82		propertyName	:	"phoneId",83		osType			: 	["WINDOWS","ANDROID"]84	},85	{86		testName		:	"VT300-038 | call getProperty with ppiX | ",87		propertyName	:	"ppiX",88		osType			: 	["WINDOWS","ANDROID","APPLE","WP8","WINDOWS_DESKTOP"]89	},90	{91		testName		:	"VT300-039 | call getProperty with ppiY | ",92		propertyName	:	"ppiY",93		osType			: 	["WINDOWS","ANDROID","APPLE","WP8","WINDOWS_DESKTOP"]94	},95	{96		testName		:	"VT300-040 | call getProperty with realScreenHeight | ",97		propertyName	:	"realScreenHeight",98		osType			: 	["WINDOWS","ANDROID","APPLE","WP8","WINDOWS_DESKTOP"]99	},100	{101		testName		:	"VT300-041 | call getProperty with realScreenWidth | ",102		propertyName	:	"realScreenWidth",103		osType			: 	["WINDOWS","ANDROID","APPLE","WP8","WINDOWS_DESKTOP"]104	},105	{106		testName		:	"VT300-046 | call getProperty with screenHeight | ",107		propertyName	:	"screenHeight",108		osType			: 	["WINDOWS","ANDROID","APPLE","WP8","WINDOWS_DESKTOP"]109	},110	{111		testName		:	"VT300-047 | call getProperty with screenWidth | ",112		propertyName	:	"screenWidth",113		osType			: 	["WINDOWS","ANDROID","APPLE","WP8","WINDOWS_DESKTOP"]114	},115	{116		testName		:	"VT300-059 | call getProperty with uuid | ",117		propertyName	:	"uuid",118		osType			: 	["WINDOWS","ANDROID","SYMBOL"]119	},120	{121		testName		:	"VT300-060 | call getProperty with webviewFramework | ",122		propertyName	:	"webviewFramework",123		osType			: 	["WINDOWS","ANDROID","APPLE","WP8","WINDOWS_DESKTOP"]124	}125	];126	127	var sys_get_properties = [128	129	{130		testName		:	"VT300-134 | call getproperties with country | ",131		propertyName	:	"country",132		osType			: 	["WINDOWS","ANDROID","APPLE","WP8","WINDOWS_DESKTOP"]133	},134	{135		testName		:	"VT300-135 | call getproperties with deviceName | ",136		propertyName	:	"deviceName",137		osType			: 	["WINDOWS","ANDROID","APPLE","WP8","WINDOWS_DESKTOP"]138	},139	{140		testName		:	"VT300-136 | call getproperties with deviceOwnerEmail | ",141		propertyName	:	"deviceOwnerEmail",142		osType			: 	["ANDROID"]143	},144	{145		testName		:	"VT300-137 | call getproperties with deviceOwnerName | ",146		propertyName	:	"deviceOwnerName",147		osType			: 	["ANDROID"]148	},149	{150		testName		:	"VT300-138 | call getproperties with devicePushId | ",151		propertyName	:	"devicePushId",152		osType			: 	["WINDOWS","ANDROID","APPLE","WP8","WINDOWS_DESKTOP"]153	},154	{155		testName		:	"VT300-139 | call getproperties with freeServerPort | ",156		propertyName	:	"freeServerPort",157		osType			: 	["WINDOWS","ANDROID","APPLE","WP8","WINDOWS_DESKTOP"]158	},159	{160		testName		:	"VT300-140 | call getproperties with hasCalendar | ",161		propertyName	:	"hasCalendar",162		osType			: 	["WINDOWS","ANDROID","APPLE","WP8","WINDOWS_DESKTOP"]163	},164	{165		testName		:	"VT300-141 | call getproperties with hasCamera | ",166		propertyName	:	"hasCamera",167		osType			: 	["WINDOWS","ANDROID","APPLE","WP8","WINDOWS_DESKTOP"]168	},169	{170		testName		:	"VT300-146 | call getproperties with hasSqlite | ",171		propertyName	:	"hasSqlite",172		osType			: 	["WINDOWS","ANDROID","APPLE","WP8","WINDOWS_DESKTOP"]173	},174	{175		testName		:	"VT300-147 | call getproperties with hasTouchscreen | ",176		propertyName	:	"hasTouchscreen",177		osType			: 	["WINDOWS","ANDROID","APPLE","WP8","WINDOWS_DESKTOP"]178	},179	{180		testName		:	"VT300-151 | Run the application on device, call getproperties with isEmulator | ",181		propertyName	:	"isEmulator",182		osType			: 	["WINDOWS","ANDROID","APPLE","WP8","WINDOWS_DESKTOP"]183	},184	{185		testName		:	"VT300-152 | call getproperties with isSymbolDevice | ",186		propertyName	:	"isSymbolDevice",187		osType			: 	["WINDOWS","ANDROID","APPLE","WP8","WINDOWS_DESKTOP"]188	},189	{190		testName		:	"VT300-153 | getproperties with localServerPort | ",191		propertyName	:	"localServerPort",192		osType			: 	["WINDOWS","ANDROID","APPLE","WP8","WINDOWS_DESKTOP"]193	},194	{195		testName		:	"VT300-154 | call getproperties with locale | ",196		propertyName	:	"locale",197		osType			: 	["WINDOWS","ANDROID","APPLE","WP8","WINDOWS_DESKTOP"]198	},199	{200		testName		:	"VT300-161 | call getproperties with oemInfo | ",201		propertyName	:	"oemInfo",202		osType			: 	["WINDOWS","ANDROID","SYMBOL"]203	},204	{205		testName		:	"VT300-162 | call getproperties with osVersion | ",206		propertyName	:	"osVersion",207		osType			: 	["WINDOWS","ANDROID","APPLE","WP8","WINDOWS_DESKTOP"]208	},209	{210		testName		:	"VT300-163 | call getproperties with phoneId | ",211		propertyName	:	"phoneId",212		osType			: 	["WINDOWS","ANDROID","APPLE","WP8","WINDOWS_DESKTOP"]213	},214	{215		testName		:	"VT300-164 | call getproperties with phoneNumber | ",216		propertyName	:	"phoneNumber",217		osType			: 	["WINDOWS","ANDROID","APPLE","WP8","WINDOWS_DESKTOP"]218	},219	{220		testName		:	"VT300-165 | call getproperties with platform | ",221		propertyName	:	"platform",222		osType			: 	["WINDOWS","ANDROID","APPLE","WP8","WINDOWS_DESKTOP"]223	},224	{225		testName		:	"VT300-166 | call getproperties with ppiX | ",226		propertyName	:	"ppiX",227		osType			: 	["WINDOWS","ANDROID","APPLE","WP8","WINDOWS_DESKTOP"]228	},229	{230		testName		:	"VT300-167 | call getproperties with ppiY | ",231		propertyName	:	"ppiY",232		osType			: 	["WINDOWS","ANDROID","APPLE","WP8","WINDOWS_DESKTOP"]233	},234	{235		testName		:	"VT300-168 | call getproperties with realScreenHeight | ",236		propertyName	:	"realScreenHeight",237		osType			: 	["WINDOWS","ANDROID","APPLE","WP8","WINDOWS_DESKTOP"]238	},239	{240		testName		:	"VT300-169 | call getproperties with realScreenWidth | ",241		propertyName	:	"realScreenWidth",242		osType			: 	["WINDOWS","ANDROID","APPLE","WP8","WINDOWS_DESKTOP"]243	},244	{245		testName		:	"VT300-172 | call getproperties with screenHeight | ",246		propertyName	:	"screenHeight",247		osType			: 	["WINDOWS","ANDROID","APPLE","WP8","WINDOWS_DESKTOP"]248	},249	{250		testName		:	"VT300-173 | call getproperties with screenWidth | ",251		propertyName	:	"screenWidth",252		osType			: 	["WINDOWS","ANDROID","APPLE","WP8","WINDOWS_DESKTOP"]253	},254	{255		testName		:	"VT300-183 | call getproperties with uuid | ",256		propertyName	:	"uuid",257		osType			: 	["WINDOWS","ANDROID","SYMBOL"]258	},259	{260		testName		:	"VT300-184 | call getproperties with webviewFramework | ",261		propertyName	:	"webviewFramework",262		osType			: 	["WINDOWS","ANDROID","APPLE","WP8","WINDOWS_DESKTOP"]263	}...test.transaction.js
Source:test.transaction.js  
2function NewTransactionObject1(sName) {3	return Hemi.newObject(sName, "1.0", 1, 1, {4		object_create: function () {5			Hemi.transaction.service.register(this, 1);6			this.getProperties().handle_1 = 0;7		},8		_handle_testpacket1: function (s, v) {9			Module.log("Handle test 1 #" + v.data.src);10			this.getProperties().handle_1++;11			return true;12		}13	}).getObjects().promise;14}15function NewTransactionObject2(sName) {16	return Hemi.newObject(sName, "1.0", 1, 1, {17		object_create: function () {18			Hemi.transaction.service.register(this, 1);19			this.getProperties().handle_1 = 0;20			this.getProperties().handle_2 = 0;21		},22		serveTestPacket2: function () {23			this.serveTransaction("testpacket2", "2");24		},25		_handle_testpacket1: function (s, v) {26			Module.log("Handle test 1 #" + v.data.src);27			this.serveTestPacket2();28			this.getProperties().handle_1++;29		},30		_handle_testpacket2: function (s, v) {31			Module.log("Handle test 2 #" + v.data.src);32			this.getProperties().handle_2++;33		}34	}).getObjects().promise;35}36function NewTransactionObject3(sName) {37	return Hemi.newObject(sName, "1.0", 1, 1, {38		object_create: function () {39			Hemi.transaction.service.register(this, 1);40		},41		object_destroy: function () {42			if (this.getObjects().ptr) this.getObjects().ptr.destroy();43		},44		_handle_testpacket2: function (s, v) {45			this.getProperties().handle_2 = 1;46		},47		_handle_outerpacket1: function (s, v) {48			Module.log("Handle test 1 #" + v.data.src);49			if (!this.getObjects().ptr) {50				this.getObjects().ptr = NewTransactionObject1("InnerBasic");51				this.getObjects().ptr.joinTransactionPacket("testpacket");52				this.serveTransaction("testpacket1");53			}54			// this.joinTransactionPacket("testpacket");55			this.serveTestPacket2();56			this.getProperties().handle_1 = 1;57		}58	}).getObjects().promise;59}60function NewTransactionObject4(sName) {61	return Hemi.newObject(sName, "1.0", 1, 1, {62		object_create: function () {63			Hemi.transaction.service.register(this, 1);64			this.getProperties().handle_1 = 0;65		},66		_handle_testpacket1: function (s, v) {67			Module.log("Handle test 1 #" + v.data.src);68			this.getProperties().handle_1++;69		}70	}).getObjects().promise;71}72/// This is expected to fail73/// The packet type changes in-flight, causing it to be redirected74///75function TestCrossUsePacketTransaction() {76	var ob1 = NewTransactionObject2("Basic");77	var ob2 = NewTransactionObject2("Basic");78	var ob3 = NewTransactionObject2("Basic");79	Promise.all([ob1,ob2,ob3]).then((aO)=>{80		var o1 = aO[0];81		var o2 = aO[1];82		var o3 = aO[2];83		o1.joinTransactionPacket("testpacket");84		o2.joinTransactionPacket("testpacket");85		o3.joinTransactionPacket("testpacket");86		o1.serveTransaction("testpacket1", "1", 1);87		var p1 = o1.getPacket("testpacket");88		this.log("Packet type: " + p1.data.type);89		this.Assert(o2.getProperties().handle_1, "Packet was not handled");90		this.Assert(o3.getProperties().handle_1, "Packet was not handled");91	92		o1.destroy();93		o2.destroy();94		EndTestCrossUsePacketTransaction(true);95	});96	return false;97}98function TestDualMultiSelfTransaction() {99	var ob1 = NewTransactionObject3("DualMultiSelf");100	var ob2 = NewTransactionObject2("Basic");101	Promise.all([ob1,ob2]).then((aO)=>{102		var o1 = aO[0];103		var o2 = aO[1];104		var p1 = o1.joinTransactionPacket("outerpacket");105		var p2 = o1.joinTransactionPacket("testpacket");106		var p3 = o2.joinTransactionPacket("testpacket");107	108		o1.destroy();109		o2.destroy();110		EndTestDualMultiSelfTransaction(true);111	});112	return false;113}114function TestSelfTransaction() {115	var ob = NewTransactionObject1("Basic");116	ob.then((o)=>{117		var p = o.joinTransactionPacket("testpacket");118		this.Assert(p, "Object did not join packet");119		o.serveTransaction("testpacket1", "1", 1);120		this.Assert(o.getProperties().handle_1, "Packet was not handled");121		o.destroy();122		EndTestSelfTransaction(true);123	});124	return false;125}126function TestDualNonSelfTransaction() {127	var ob1 = NewTransactionObject1("Basic");128	var ob2 = NewTransactionObject1("Basic");129	Promise.all([ob1,ob2]).then((aO)=>{130		var o1 = aO[0];131		var o2 = aO[1];132			133		var p1 = o1.joinTransactionPacket("testpacket");134		var p2 = o2.joinTransactionPacket("testpacket");135		this.Assert(p1 && p2, "Objects did not join packet");136		o1.serveTransaction("testpacket1", "1");137		this.Assert(!o1.getProperties().handle_1, "Packet was not supposed to be handled");138		this.Assert(o2.getProperties().handle_1, "Packet was supposed to be handled");139		o1.destroy();140		o2.destroy();141		EndTestDualNonSelfTransaction(true);142	});143	return false;144}145function TestDualSelfTransaction() {146	var ob1 = NewTransactionObject1("Basic");147	var ob2 = NewTransactionObject1("Basic");148	Promise.all([ob1,ob2]).then((aO)=>{149		var o1 = aO[0];150		var o2 = aO[1];151		152		var p1 = o1.joinTransactionPacket("testpacket");153		var p2 = o2.joinTransactionPacket("testpacket");154		this.Assert(p1 && p2, "Objects did not join packet");155		o1.serveTransaction("testpacket1", "1", 1);156		this.Assert(o1.getProperties().handle_1, "Packet was supposed to be handled");157		this.Assert(o2.getProperties().handle_1, "Packet was supposed to be handled");158		o1.destroy();159		o2.destroy();160		EndTestDualSelfTransaction(true);161	});162	return false;163}164function TestDualSelfCleanupTransaction() {165	var ob1 = NewTransactionObject1("Basic");166	var ob2 = NewTransactionObject1("Basic");167	Promise.all([ob1,ob2]).then((aO)=>{168		var o1 = aO[0];169		var o2 = aO[1];170		var p1 = o1.joinTransactionPacket("testpacket");171		var p2 = o2.joinTransactionPacket("testpacket");172		this.Assert(p1 && p2, "Objects did not join packet");173		o1.serveTransaction("testpacket1", "1", 1);174		o1.getProperties().handle_1 = 0;175		o2.getProperties().handle_1 = 0;176		o1.removeFromTransactionPacket("testpacket");177		o2.serveTransaction("testpacket1", "1", 1);178		this.Assert(!o1.getProperties().handle_1, "Packet was not supposed to be handled");179		this.Assert(o2.getProperties().handle_1, "Packet was supposed to be handled");180		o1.destroy();181		o2.destroy();182		EndTestDualSelfCleanupTransaction(true);183	});184	return false;185}186function TestMultiSelfTransaction() {187	var ob1 = NewTransactionObject2("Basic");188	var ob2 = NewTransactionObject2("Basic");189	Promise.all([ob1,ob2]).then((aO)=>{190		var o1 = aO[0];191		var o2 = aO[1];192		var p1 = o1.joinTransactionPacket("testpacket");193		var p2 = o2.joinTransactionPacket("testpacket");194		this.Assert(p1 && p2, "Objects did not join packet");195		o2.serveTransaction("testpacket1", "1", 1);196		o1.serveTransaction("testpacket1", "1", 1);197		this.Assert(o1.getProperties().handle_2, "Packet was supposed to be handled");198		this.Assert(o2.getProperties().handle_2, "Packet was supposed to be handled");199		o1.destroy();200		o2.destroy();201		EndTestMultiSelfTransaction(true);202	});203	return false;204}205function TestEndTransaction() {206	var ob1 = NewTransactionObject1("Basic");207	var ob2 = NewTransactionObject4("Basic");208	Promise.all([ob1,ob2]).then((aO)=>{209		var o1 = aO[0];210		var o2 = aO[1];211//		window.dbgObj = o1;212//		window.dbgObjs = aO;213		o1.joinTransactionPacket("testpacket1");214		o2.joinTransactionPacket("testpacket1");215		o1.serveTransaction("testpacket1", "1", 1);216		this.Assert(o1.getProperties().handle_1, "Packet was supposed to be handled");217		this.Assert(o2.getProperties().handle_1, "Packet was supposed to be handled");218		o1.serveTransaction("testpacket1", "1", 1);219		this.Assert(o1.getProperties().handle_1==1, "Packet was supposed to be handled only once");220		this.Assert(o2.getProperties().handle_1==2, "Packet was supposed to be handled twice");221		EndTestEndTransaction(true);222	});223	return false;224}225window.debugTest = this;...object_manipulate_manager.js
Source:object_manipulate_manager.js  
...39            }4041            if (feature.getProperties.type === "geofence"){42                //here should be a drone id;43                //thing_id: feature.getProperties().drone_id,44            }454647            if (feature.getGeometry().getType().toLowerCase() === "circle") {48                obj.objt_type = feature.getProperties().type;49                obj.objt_name = feature.getProperties().name;50                obj.lowerHeight = feature.getProperties().lowerHeight;51                obj.upperHeight = feature.getProperties().upperHeight;52                obj.groundRadius = feature.getProperties().groundRadius;53                obj.map_id = 1;54                obj.coordinateInfo = {}; 55                obj.coordinateInfo.type = feature.getGeometry().getType().toLowerCase();56                obj.coordinateInfo.coordinate = feature.getProperties().center;57                obj.coordinateInfo.radius = feature.getProperties().groundRadius*1.2286877340658            } else {59                obj.objt_type = feature.getProperties().type;60                obj.objt_name = feature.getProperties().name;61                obj.lowerHeight = feature.getProperties().lowerHeight;62                obj.upperHeight = feature.getProperties().upperHeight;63                obj.map_id = 1;64                obj.coordinateInfo = {}; 65                obj.coordinateInfo.type = feature.getGeometry().getType().toLowerCase();66                obj.coordinateInfo.coordinate = feature.getGeometry().getCoordinates();67            }68                featureArray.push(obj);69                var obtJson = JSON.stringify(featureArray);7071               console.log(obtJson);7273                return obtJson;7475        },7677        writeDevice: function (feature) {7879            if (feature === undefined) {80                console.log('feature is empty');81                return 0;82            }8384            var featureArray = [];85            //for (var i = 0; i < features.length; i++) {86            var obj = {};8788            if (feature.getId() !== undefined) {89                obj.objt_id = feature.getId();90            }9192            obj.objt_type = feature.getProperties().type;93            obj.objt_name = feature.getProperties().name;94            obj.angle = feature.getProperties().angle;95            obj.ip = feature.getProperties().ip;96            obj.map_id = 1;97            obj.coordinateInfo = {}; 98            obj.coordinateInfo.type = feature.getGeometry().getType().toLowerCase();99            obj.coordinateInfo.coordinate = feature.getGeometry().getCoordinates();100                101            featureArray.push(obj);102            var obtJson = JSON.stringify(featureArray);103104            console.log(obtJson);105106            return obtJson;107108        },109110        converterDroneToFeatureInfo: function(drone){111112            var tempPosition = drone.coordinateInfo.coordinate;113            var transpos = this.myMapMan.transformCoord4326To3857(tempPosition);114115            var featureInfo = {116                coordinateInfo: {117                    type: drone.coordinateInfo.type,118                    coordinate: transpos,119                },120                properties : {121                    id: drone.id,122                    type: drone.type,123                    name: drone.name,124                }125126            };127128            return featureInfo;129        },130131        convertObjectToFeatureInfo: function(obj){132133            var featureInfo = {134                coordinateInfo: {135                    type: obj.coordinateInfo.type,136                    coordinate: obj.coordinateInfo.coordinate,137                    radius: obj.coordinateInfo.radius138                },139                properties : {140                    id: obj.objt_id,141                    type: obj.objt_type,142                    name: obj.objt_name,143                    lowerHeight: obj.lowerHeight,144                    upperHeight: obj.upperHeight,145                    map_id: obj.map_id,146                    groundRadius: obj.groundRadius147                }148149            };150151152            return featureInfo;153154        },155156        convertObjectFeatureToFeatureInfo: function (feature) {157           158            var featureInfo = {};159160            if (feature.getGeometry().getType().toLowerCase() === "circle") {161                featureInfo = {162                    properties: {163                        type: feature.getProperties().type,164                        name: feature.getProperties().name,165                        lowerHeight: feature.getProperties().lowerHeight,166                        upperHeight: feature.getProperties().upperHeight,167                        groundRadius: feature.getProperties().groundRadius,168                        map_id: 1  169                    },170                    coordinateInfo: {171                        type: feature.getGeometry().getType().toLowerCase(),172                        coordinate: feature.getProperties().center,173                        radius: feature.getProperties().groundRadius*1.22868773406174                    }175                };176177            } else {178                featureInfo = {179                    properties: {180                        type: feature.getProperties().type,181                        name: feature.getProperties().name,182                        lowerHeight: feature.getProperties().lowerHeight,183                        upperHeight: feature.getProperties().upperHeight,184                        map_id: 1,185186                    },187                    188                    coordinateInfo: {189                        type: feature.getGeometry().getType().toLowerCase(),190                        coordinate: feature.getGeometry().getCoordinates()191                    }192                };193194            }195196            return featureInfo;197        },
...no-get-properties-for-flat-props.js
Source:no-get-properties-for-flat-props.js  
...4    RuleTester = require('eslint').RuleTester5const ruleTester = new RuleTester({ parserOptions: { ecmaVersion: 6 } })6ruleTester.run('no-get-properties-for-flat-props', rule, {7    valid: [{8        code: 'const { prop1, prop3 } = getProperties(object, \'prop1\', \'prop2\')'9    }, {10        code: 'const { prop1, prop2, prop3 } = getProperties(object, \'prop1\', \'prop2\')'11    }, {12        code: 'const { prop1 } = this.getProperties()'13    }, {14        code: 'const props = this.getProperties(\'prop1\', \'prop2\')'15    }, {16        code: 'const { \'order.id\': orderId, prop2 } = getProperties(object, \'order.id\', \'prop2\')'17    }],18    invalid: [{19        code: 'const { prop1, prop2 } = getProperties(object, \'prop1\', \'prop2\')',20        errors: [{21            message: 'Use of getProperties can be replaced by destructuring.',22            type: 'VariableDeclarator'23        }],24        output: 'const { prop1, prop2 } = object'25    }, {26        code: 'const { prop1, prop2 } = this.getProperties(\'prop1\', \'prop2\')',27        errors: [{28            message: 'Use of getProperties can be replaced by destructuring.',29            type: 'VariableDeclarator'30        }],31        output: 'const { prop1, prop2 } = this'32    }, {33        code: 'const { \'dashed-prop1\': dashedProp1, \'dashed-prop2\': dashedProp2 } = this.getProperties(\'dashed-prop1\', \'dashed-prop2\')',34        errors: [{35            message: 'Use of getProperties can be replaced by destructuring.',36            type: 'VariableDeclarator'37        }],38        output: 'const { \'dashed-prop1\': dashedProp1, \'dashed-prop2\': dashedProp2 } = this'39    }, {40        code: 'const { prop1, prop2 } = object.getProperties(\'prop1\', \'prop2\')',41        errors: [{42            message: 'Use of getProperties can be replaced by destructuring.',43            type: 'VariableDeclarator'44        }],45        output: 'const { prop1, prop2 } = object'46    }, {47        code: 'const { prop1, prop2 } = this.object.getProperties(\'prop1\', \'prop2\')',48        errors: [{49            message: 'Use of getProperties can be replaced by destructuring.',50            type: 'VariableDeclarator'51        }],52        output: 'const { prop1, prop2 } = this.object'53    }, {54        code: `55const {56    prop1,57    prop258} = this.getProperties('prop1', 'prop2'),59{60    prop4,61    prop362} = object.getProperties('prop3', 'prop4'),63{ prop5: prop7, prop6 } = getProperties(anotherObject,64    'prop5',65    'prop6'66)`,67        errors: [{68            message: 'Use of getProperties can be replaced by destructuring.',69            type: 'VariableDeclarator'70        }, {71            message: 'Use of getProperties can be replaced by destructuring.',72            type: 'VariableDeclarator'73        }, {74            message: 'Use of getProperties can be replaced by destructuring.',75            type: 'VariableDeclarator'76        }],77        output: `...no-get-properties-with-array.js
Source:no-get-properties-with-array.js  
...4    RuleTester = require('eslint').RuleTester5const ruleTester = new RuleTester({ parserOptions: { ecmaVersion: 6 } })6ruleTester.run('no-get-properties-with-array', rule, {7    valid: [{8        code: 'getProperties(object, \'prop1\', \'prop2\')'9    }, {10        code: 'object.getProperties(\'prop1\', \'prop2\')'11    }],12    invalid: [{13        code: 'getProperties(object, [\'prop1\', \'prop2\'])',14        errors: [{15            message: 'Use getProperties without an array with properties.',16            type: 'CallExpression'17        }],18        output: 'getProperties(object, \'prop1\', \'prop2\')'19    }, {20        code: 'this.getProperties([\'prop1\', \'prop2\'])',21        errors: [{22            message: 'Use getProperties without an array with properties.',23            type: 'CallExpression'24        }],25        output: 'this.getProperties(\'prop1\', \'prop2\')'26    }, {27        code: 'this.getProperties([ \'prop1\', \'prop2\' ])',28        errors: [{29            message: 'Use getProperties without an array with properties.',30            type: 'CallExpression'31        }],32        output: 'this.getProperties(\'prop1\', \'prop2\')'33    }, {34        code: `35this.getProperties([36    'prop1',37    'prop2'38])`,39        errors: [{40            message: 'Use getProperties without an array with properties.',41            type: 'CallExpression'42        }],43        output: `44this.getProperties(45    'prop1',46    'prop2'47)`48    }]...server.js
Source:server.js  
...3const config = require('./config');4const fs = require('fs');5var express = require('express');6const app = express();7const prod = config.getProperties('prod');8var global_json = {9  "secure" : config.getProperties().secure,10  "insecure": config.getProperties().insecure,11  "web_port" : config.getProperties().web_port,12  "web_endpoint": config.getProperties().web_endpoint,13  "api_port" : config.getProperties().api_port,14  "api_endpoint": config.getProperties().api_endpoint,15  "client_id": config.getProperties().client_id,16  "node_port": config.getProperties().node_port17}18fs.writeFile("config/global.json", JSON.stringify(global_json), function(err) {19    if(err) {20        return console.log(err);21    }22    console.log("The file was saved!");23});24console.log(config.getProperties().node_port);25app.listen(config.getProperties().node_port, () => console.log('Listening on port: ' + config.getProperties().node_port));26app.use(express.static(__dirname));27app.use('/media', express.static(path.join(__dirname, "..", "API"))); //__dir and not _dir28app.use((req, res, next) => {29  console.log('Time: ', Date.now());30  next();...get-properties.spec.js
Source:get-properties.spec.js  
...3  it('is a function', () => {4    expect(getProperties).toBeInstanceOf(Function)5  })6  it('returns {} when no arguments are passed', () => {7    const emptyObj = getProperties()8    expect(emptyObj).toEqual({})9  })10  it('returns {} when invalid arguments are passed', () => {11    const invalid1 = getProperties({})12    const invalid2 = getProperties('hello')13    const invalid3 = getProperties(() => 1)14    expect(invalid1).toEqual({})15    expect(invalid2).toEqual({})16    expect(invalid3).toEqual({})17  })18  it('returns {} if options is an empty array', () => {19    const result = getProperties([])20    expect(result).toEqual({})21  })22  it('returns first element of options array', () => {23    const option1 = [{ foo: 'bar', one: 1 }]24    const option2 = [{ foo: 'bar', one: 1, two: 2 }, 'more', 'items']25    const result1 = getProperties(option1)26    const result2 = getProperties(option2)27    expect(result1).toEqual(option1[0])28    expect(result2).toEqual(option2[0])29  })...Using AI Code Generation
1const { getProperties } = require('playwright/lib/server/chromium/crPage');2const { chromium } = require('playwright');3(async () => {4  const browser = await chromium.launch();5  const context = await browser.newContext();6  const page = await context.newPage();7  const [response] = await Promise.all([8    page.waitForResponse('**/json'),9  ]);10  const request = response.request();11  const { frame } = request;12  const properties = await getProperties(frame);13  console.log(properties);14  await browser.close();15})();Using AI Code Generation
1const { getProperties } = require('playwright/lib/server/supplements/recorder/recorderSupplement.js');2const { chromium } = require('playwright');3(async () => {4  const browser = await chromium.launch();5  const page = await browser.newPage();6  await page.click('text=Get started');7  const properties = await getProperties(page, 'css=div[class="navbar__inner"] >> text=Get started');8  console.log(properties);9  await browser.close();10})();11{12}Using AI Code Generation
1const { getProperties } = require('playwright/lib/server/frames');2const { getProperties } = require('playwright/lib/server/frames');3const frame = page.mainFrame();4const properties = await getProperties(frame, elementHandle);5console.log(properties);6{7  attributes: {8  },9  parent: {10    attributes: {},11  },12  ownerDocument: {13    attributes: {},14    frame: {15      attributes: {},Using AI Code Generation
1const { getProperties } = require('playwright/lib/server/supplements/recorder/recorderSupplement');2const { Page } = require('playwright');3const page = new Page();4(async () => {5  const properties = await getProperties(page, 'document.querySelector("input")');6  console.log(properties);7})();8{9  attributes: {10  },11  properties: {Using AI Code Generation
1const { getProperties } = require('playwright/lib/server/domSnapshot');2const { getTestState } = require('playwright/lib/server/test');3(async () => {4  const page = await getTestState().pagePool.acquire();5  const { root } = await page._delegate._pageProxy._frameManager.mainFrame()._document;6  const { properties } = await getProperties(root, { computedStyles: ['color'] });7  console.log(properties);8  await getTestState().pagePool.dispose();9})();10  {11    "value": "rgb(0, 0, 0)",12    "text": "color: rgb(0, 0, 0);",13    "range": {14    }15  }16const { getTestState } = require('playwright/lib/server/test');17(async () => {18  const page = await getTestState().pagePool.acquire();19  const result = await page._delegate._pageProxy._frameManager.mainFrame().evaluate(() => {20    return document.documentElement.innerHTML;21  });22  console.log(result);23  await getTestState().pagePool.dispose();24})();25const { getTestState } = require('playwright/lib/server/test');LambdaTest’s Playwright tutorial will give you a broader idea about the Playwright automation framework, its unique features, and use cases with examples to exceed your understanding of Playwright testing. This tutorial will give A to Z guidance, from installing the Playwright framework to some best practices and advanced concepts.
Get 100 minutes of automation test minutes FREE!!
