Best Python code snippet using playwright-python
code1.js
Source:code1.js
1gdjs.PauseCode = {};2gdjs.PauseCode.GDplayerKnightObjects1= [];3gdjs.PauseCode.GDplayerKnightObjects2= [];4gdjs.PauseCode.GDplayerWeaponObjects1= [];5gdjs.PauseCode.GDplayerWeaponObjects2= [];6gdjs.PauseCode.GDdemonObjects1= [];7gdjs.PauseCode.GDdemonObjects2= [];8gdjs.PauseCode.GDsentryObjects1= [];9gdjs.PauseCode.GDsentryObjects2= [];10gdjs.PauseCode.GDprojectileObjects1= [];11gdjs.PauseCode.GDprojectileObjects2= [];12gdjs.PauseCode.GDexplosionObjects1= [];13gdjs.PauseCode.GDexplosionObjects2= [];14gdjs.PauseCode.GDGameOverObjects1= [];15gdjs.PauseCode.GDGameOverObjects2= [];16gdjs.PauseCode.GDfloorObjects1= [];17gdjs.PauseCode.GDfloorObjects2= [];18gdjs.PauseCode.GDwallObjects1= [];19gdjs.PauseCode.GDwallObjects2= [];20gdjs.PauseCode.GDwallRightObjects1= [];21gdjs.PauseCode.GDwallRightObjects2= [];22gdjs.PauseCode.GDwallLeftObjects1= [];23gdjs.PauseCode.GDwallLeftObjects2= [];24gdjs.PauseCode.GDdoorObjects1= [];25gdjs.PauseCode.GDdoorObjects2= [];26gdjs.PauseCode.GDspikesObjects1= [];27gdjs.PauseCode.GDspikesObjects2= [];28gdjs.PauseCode.GDholeObjects1= [];29gdjs.PauseCode.GDholeObjects2= [];30gdjs.PauseCode.GDplayerHPObjects1= [];31gdjs.PauseCode.GDplayerHPObjects2= [];32gdjs.PauseCode.GDframerateObjects1= [];33gdjs.PauseCode.GDframerateObjects2= [];34gdjs.PauseCode.GDhealthBarObjects1= [];35gdjs.PauseCode.GDhealthBarObjects2= [];36gdjs.PauseCode.GDpermaSpikeObjects1= [];37gdjs.PauseCode.GDpermaSpikeObjects2= [];38gdjs.PauseCode.GDhealthBarBackgroundObjects1= [];39gdjs.PauseCode.GDhealthBarBackgroundObjects2= [];40gdjs.PauseCode.GDcoinObjects1= [];41gdjs.PauseCode.GDcoinObjects2= [];42gdjs.PauseCode.GDpodiumObjects1= [];43gdjs.PauseCode.GDpodiumObjects2= [];44gdjs.PauseCode.GDcoinImageObjects1= [];45gdjs.PauseCode.GDcoinImageObjects2= [];46gdjs.PauseCode.GDcoinScoreObjects1= [];47gdjs.PauseCode.GDcoinScoreObjects2= [];48gdjs.PauseCode.GDlevelCompleteObjects1= [];49gdjs.PauseCode.GDlevelCompleteObjects2= [];50gdjs.PauseCode.GDobjectiveObjects1= [];51gdjs.PauseCode.GDobjectiveObjects2= [];52gdjs.PauseCode.GDswordIconObjects1= [];53gdjs.PauseCode.GDswordIconObjects2= [];54gdjs.PauseCode.GDenemyHealthBarObjects1= [];55gdjs.PauseCode.GDenemyHealthBarObjects2= [];56gdjs.PauseCode.GDhealthPowerupObjects1= [];57gdjs.PauseCode.GDhealthPowerupObjects2= [];58gdjs.PauseCode.GDhealthIncreasedTextObjects1= [];59gdjs.PauseCode.GDhealthIncreasedTextObjects2= [];60gdjs.PauseCode.GDswordPowerupObjects1= [];61gdjs.PauseCode.GDswordPowerupObjects2= [];62gdjs.PauseCode.GDdamageIncreasedTextObjects1= [];63gdjs.PauseCode.GDdamageIncreasedTextObjects2= [];64gdjs.PauseCode.GDHPpotionObjects1= [];65gdjs.PauseCode.GDHPpotionObjects2= [];66gdjs.PauseCode.GDHPpotionTextObjects1= [];67gdjs.PauseCode.GDHPpotionTextObjects2= [];68gdjs.PauseCode.GDmaxHPObjects1= [];69gdjs.PauseCode.GDmaxHPObjects2= [];70gdjs.PauseCode.GDinvinciblePowerupObjects1= [];71gdjs.PauseCode.GDinvinciblePowerupObjects2= [];72gdjs.PauseCode.GDinvincibleTextObjects1= [];73gdjs.PauseCode.GDinvincibleTextObjects2= [];74gdjs.PauseCode.GDogreObjects1= [];75gdjs.PauseCode.GDogreObjects2= [];76gdjs.PauseCode.GDzombieObjects1= [];77gdjs.PauseCode.GDzombieObjects2= [];78gdjs.PauseCode.GDwizardObjects1= [];79gdjs.PauseCode.GDwizardObjects2= [];80gdjs.PauseCode.GDopenDoorObjects1= [];81gdjs.PauseCode.GDopenDoorObjects2= [];82gdjs.PauseCode.GDlavaObjects1= [];83gdjs.PauseCode.GDlavaObjects2= [];84gdjs.PauseCode.GDlavaBaseObjects1= [];85gdjs.PauseCode.GDlavaBaseObjects2= [];86gdjs.PauseCode.GDtrapTriggerObjects1= [];87gdjs.PauseCode.GDtrapTriggerObjects2= [];88gdjs.PauseCode.GDwizardProjectileObjects1= [];89gdjs.PauseCode.GDwizardProjectileObjects2= [];90gdjs.PauseCode.GDpathOpenedObjects1= [];91gdjs.PauseCode.GDpathOpenedObjects2= [];92gdjs.PauseCode.GDfogObjects1= [];93gdjs.PauseCode.GDfogObjects2= [];94gdjs.PauseCode.GDblockerObjects1= [];95gdjs.PauseCode.GDblockerObjects2= [];96gdjs.PauseCode.GDmainMenuObjects1= [];97gdjs.PauseCode.GDmainMenuObjects2= [];98gdjs.PauseCode.GDquitButtonObjects1= [];99gdjs.PauseCode.GDquitButtonObjects2= [];100gdjs.PauseCode.GDdeathsObjects1= [];101gdjs.PauseCode.GDdeathsObjects2= [];102gdjs.PauseCode.GDpausedObjects1= [];103gdjs.PauseCode.GDpausedObjects2= [];104gdjs.PauseCode.GDNewObjectObjects1= [];105gdjs.PauseCode.GDNewObjectObjects2= [];106gdjs.PauseCode.GDresumeObjects1= [];107gdjs.PauseCode.GDresumeObjects2= [];108gdjs.PauseCode.GDresumeButtonObjects1= [];109gdjs.PauseCode.GDresumeButtonObjects2= [];110gdjs.PauseCode.conditionTrue_0 = {val:false};111gdjs.PauseCode.condition0IsTrue_0 = {val:false};112gdjs.PauseCode.condition1IsTrue_0 = {val:false};113gdjs.PauseCode.condition2IsTrue_0 = {val:false};114gdjs.PauseCode.mapOfGDgdjs_46PauseCode_46GDresumeButtonObjects1Objects = Hashtable.newFrom({"resumeButton": gdjs.PauseCode.GDresumeButtonObjects1});gdjs.PauseCode.mapOfGDgdjs_46PauseCode_46GDquitButtonObjects1Objects = Hashtable.newFrom({"quitButton": gdjs.PauseCode.GDquitButtonObjects1});gdjs.PauseCode.mapOfGDgdjs_46PauseCode_46GDresumeButtonObjects1Objects = Hashtable.newFrom({"resumeButton": gdjs.PauseCode.GDresumeButtonObjects1});gdjs.PauseCode.mapOfGDgdjs_46PauseCode_46GDquitButtonObjects1Objects = Hashtable.newFrom({"quitButton": gdjs.PauseCode.GDquitButtonObjects1});gdjs.PauseCode.mapOfGDgdjs_46PauseCode_46GDresumeButtonObjects1Objects = Hashtable.newFrom({"resumeButton": gdjs.PauseCode.GDresumeButtonObjects1});gdjs.PauseCode.mapOfGDgdjs_46PauseCode_46GDquitButtonObjects1Objects = Hashtable.newFrom({"quitButton": gdjs.PauseCode.GDquitButtonObjects1});gdjs.PauseCode.eventsList0xb2358 = function(runtimeScene) {115{116gdjs.PauseCode.condition0IsTrue_0.val = false;117{118gdjs.PauseCode.condition0IsTrue_0.val = gdjs.evtTools.runtimeScene.sceneJustBegins(runtimeScene);119}if (gdjs.PauseCode.condition0IsTrue_0.val) {120gdjs.PauseCode.GDquitButtonObjects1.createFrom(runtimeScene.getObjects("quitButton"));121gdjs.PauseCode.GDresumeButtonObjects1.createFrom(runtimeScene.getObjects("resumeButton"));122{for(var i = 0, len = gdjs.PauseCode.GDresumeButtonObjects1.length ;i < len;++i) {123 gdjs.PauseCode.GDresumeButtonObjects1[i].hide();124}125}{for(var i = 0, len = gdjs.PauseCode.GDquitButtonObjects1.length ;i < len;++i) {126 gdjs.PauseCode.GDquitButtonObjects1[i].hide();127}128}}129}130{131gdjs.PauseCode.GDresumeButtonObjects1.createFrom(runtimeScene.getObjects("resumeButton"));132gdjs.PauseCode.condition0IsTrue_0.val = false;133{134gdjs.PauseCode.condition0IsTrue_0.val = gdjs.evtTools.input.cursorOnObject(gdjs.PauseCode.mapOfGDgdjs_46PauseCode_46GDresumeButtonObjects1Objects, runtimeScene, true, true);135}if (gdjs.PauseCode.condition0IsTrue_0.val) {136gdjs.PauseCode.GDresumeObjects1.createFrom(runtimeScene.getObjects("resume"));137{for(var i = 0, len = gdjs.PauseCode.GDresumeObjects1.length ;i < len;++i) {138 gdjs.PauseCode.GDresumeObjects1[i].setColor("255;255;255");139}140}}141}142{143gdjs.PauseCode.GDquitButtonObjects1.createFrom(runtimeScene.getObjects("quitButton"));144gdjs.PauseCode.condition0IsTrue_0.val = false;145{146gdjs.PauseCode.condition0IsTrue_0.val = gdjs.evtTools.input.cursorOnObject(gdjs.PauseCode.mapOfGDgdjs_46PauseCode_46GDquitButtonObjects1Objects, runtimeScene, true, true);147}if (gdjs.PauseCode.condition0IsTrue_0.val) {148gdjs.PauseCode.GDmainMenuObjects1.createFrom(runtimeScene.getObjects("mainMenu"));149{for(var i = 0, len = gdjs.PauseCode.GDmainMenuObjects1.length ;i < len;++i) {150 gdjs.PauseCode.GDmainMenuObjects1[i].setColor("255;255;255");151}152}}153}154{155gdjs.PauseCode.GDresumeButtonObjects1.createFrom(runtimeScene.getObjects("resumeButton"));156gdjs.PauseCode.condition0IsTrue_0.val = false;157{158gdjs.PauseCode.condition0IsTrue_0.val = gdjs.evtTools.input.cursorOnObject(gdjs.PauseCode.mapOfGDgdjs_46PauseCode_46GDresumeButtonObjects1Objects, runtimeScene, true, false);159}if (gdjs.PauseCode.condition0IsTrue_0.val) {160gdjs.PauseCode.GDresumeObjects1.createFrom(runtimeScene.getObjects("resume"));161{for(var i = 0, len = gdjs.PauseCode.GDresumeObjects1.length ;i < len;++i) {162 gdjs.PauseCode.GDresumeObjects1[i].setColor("252;7;7");163}164}}165}166{167gdjs.PauseCode.GDquitButtonObjects1.createFrom(runtimeScene.getObjects("quitButton"));168gdjs.PauseCode.condition0IsTrue_0.val = false;169{170gdjs.PauseCode.condition0IsTrue_0.val = gdjs.evtTools.input.cursorOnObject(gdjs.PauseCode.mapOfGDgdjs_46PauseCode_46GDquitButtonObjects1Objects, runtimeScene, true, false);171}if (gdjs.PauseCode.condition0IsTrue_0.val) {172gdjs.PauseCode.GDmainMenuObjects1.createFrom(runtimeScene.getObjects("mainMenu"));173{for(var i = 0, len = gdjs.PauseCode.GDmainMenuObjects1.length ;i < len;++i) {174 gdjs.PauseCode.GDmainMenuObjects1[i].setColor("252;7;7");175}176}}177}178{179gdjs.PauseCode.GDresumeButtonObjects1.createFrom(runtimeScene.getObjects("resumeButton"));180gdjs.PauseCode.condition0IsTrue_0.val = false;181gdjs.PauseCode.condition1IsTrue_0.val = false;182{183gdjs.PauseCode.condition0IsTrue_0.val = gdjs.evtTools.input.cursorOnObject(gdjs.PauseCode.mapOfGDgdjs_46PauseCode_46GDresumeButtonObjects1Objects, runtimeScene, true, false);184}if ( gdjs.PauseCode.condition0IsTrue_0.val ) {185{186gdjs.PauseCode.condition1IsTrue_0.val = gdjs.evtTools.input.isMouseButtonReleased(runtimeScene, "Left");187}}188if (gdjs.PauseCode.condition1IsTrue_0.val) {189{gdjs.evtTools.runtimeScene.popScene(runtimeScene);190}}191}192{193gdjs.PauseCode.GDquitButtonObjects1.createFrom(runtimeScene.getObjects("quitButton"));194gdjs.PauseCode.condition0IsTrue_0.val = false;195gdjs.PauseCode.condition1IsTrue_0.val = false;196{197gdjs.PauseCode.condition0IsTrue_0.val = gdjs.evtTools.input.cursorOnObject(gdjs.PauseCode.mapOfGDgdjs_46PauseCode_46GDquitButtonObjects1Objects, runtimeScene, true, false);198}if ( gdjs.PauseCode.condition0IsTrue_0.val ) {199{200gdjs.PauseCode.condition1IsTrue_0.val = gdjs.evtTools.input.isMouseButtonReleased(runtimeScene, "Left");201}}202if (gdjs.PauseCode.condition1IsTrue_0.val) {203{gdjs.evtTools.runtimeScene.replaceScene(runtimeScene, "Startup", true);204}}205}206}; //End of gdjs.PauseCode.eventsList0xb2358207gdjs.PauseCode.func = function(runtimeScene) {208runtimeScene.getOnceTriggers().startNewFrame();209gdjs.PauseCode.GDplayerKnightObjects1.length = 0;210gdjs.PauseCode.GDplayerKnightObjects2.length = 0;211gdjs.PauseCode.GDplayerWeaponObjects1.length = 0;212gdjs.PauseCode.GDplayerWeaponObjects2.length = 0;213gdjs.PauseCode.GDdemonObjects1.length = 0;214gdjs.PauseCode.GDdemonObjects2.length = 0;215gdjs.PauseCode.GDsentryObjects1.length = 0;216gdjs.PauseCode.GDsentryObjects2.length = 0;217gdjs.PauseCode.GDprojectileObjects1.length = 0;218gdjs.PauseCode.GDprojectileObjects2.length = 0;219gdjs.PauseCode.GDexplosionObjects1.length = 0;220gdjs.PauseCode.GDexplosionObjects2.length = 0;221gdjs.PauseCode.GDGameOverObjects1.length = 0;222gdjs.PauseCode.GDGameOverObjects2.length = 0;223gdjs.PauseCode.GDfloorObjects1.length = 0;224gdjs.PauseCode.GDfloorObjects2.length = 0;225gdjs.PauseCode.GDwallObjects1.length = 0;226gdjs.PauseCode.GDwallObjects2.length = 0;227gdjs.PauseCode.GDwallRightObjects1.length = 0;228gdjs.PauseCode.GDwallRightObjects2.length = 0;229gdjs.PauseCode.GDwallLeftObjects1.length = 0;230gdjs.PauseCode.GDwallLeftObjects2.length = 0;231gdjs.PauseCode.GDdoorObjects1.length = 0;232gdjs.PauseCode.GDdoorObjects2.length = 0;233gdjs.PauseCode.GDspikesObjects1.length = 0;234gdjs.PauseCode.GDspikesObjects2.length = 0;235gdjs.PauseCode.GDholeObjects1.length = 0;236gdjs.PauseCode.GDholeObjects2.length = 0;237gdjs.PauseCode.GDplayerHPObjects1.length = 0;238gdjs.PauseCode.GDplayerHPObjects2.length = 0;239gdjs.PauseCode.GDframerateObjects1.length = 0;240gdjs.PauseCode.GDframerateObjects2.length = 0;241gdjs.PauseCode.GDhealthBarObjects1.length = 0;242gdjs.PauseCode.GDhealthBarObjects2.length = 0;243gdjs.PauseCode.GDpermaSpikeObjects1.length = 0;244gdjs.PauseCode.GDpermaSpikeObjects2.length = 0;245gdjs.PauseCode.GDhealthBarBackgroundObjects1.length = 0;246gdjs.PauseCode.GDhealthBarBackgroundObjects2.length = 0;247gdjs.PauseCode.GDcoinObjects1.length = 0;248gdjs.PauseCode.GDcoinObjects2.length = 0;249gdjs.PauseCode.GDpodiumObjects1.length = 0;250gdjs.PauseCode.GDpodiumObjects2.length = 0;251gdjs.PauseCode.GDcoinImageObjects1.length = 0;252gdjs.PauseCode.GDcoinImageObjects2.length = 0;253gdjs.PauseCode.GDcoinScoreObjects1.length = 0;254gdjs.PauseCode.GDcoinScoreObjects2.length = 0;255gdjs.PauseCode.GDlevelCompleteObjects1.length = 0;256gdjs.PauseCode.GDlevelCompleteObjects2.length = 0;257gdjs.PauseCode.GDobjectiveObjects1.length = 0;258gdjs.PauseCode.GDobjectiveObjects2.length = 0;259gdjs.PauseCode.GDswordIconObjects1.length = 0;260gdjs.PauseCode.GDswordIconObjects2.length = 0;261gdjs.PauseCode.GDenemyHealthBarObjects1.length = 0;262gdjs.PauseCode.GDenemyHealthBarObjects2.length = 0;263gdjs.PauseCode.GDhealthPowerupObjects1.length = 0;264gdjs.PauseCode.GDhealthPowerupObjects2.length = 0;265gdjs.PauseCode.GDhealthIncreasedTextObjects1.length = 0;266gdjs.PauseCode.GDhealthIncreasedTextObjects2.length = 0;267gdjs.PauseCode.GDswordPowerupObjects1.length = 0;268gdjs.PauseCode.GDswordPowerupObjects2.length = 0;269gdjs.PauseCode.GDdamageIncreasedTextObjects1.length = 0;270gdjs.PauseCode.GDdamageIncreasedTextObjects2.length = 0;271gdjs.PauseCode.GDHPpotionObjects1.length = 0;272gdjs.PauseCode.GDHPpotionObjects2.length = 0;273gdjs.PauseCode.GDHPpotionTextObjects1.length = 0;274gdjs.PauseCode.GDHPpotionTextObjects2.length = 0;275gdjs.PauseCode.GDmaxHPObjects1.length = 0;276gdjs.PauseCode.GDmaxHPObjects2.length = 0;277gdjs.PauseCode.GDinvinciblePowerupObjects1.length = 0;278gdjs.PauseCode.GDinvinciblePowerupObjects2.length = 0;279gdjs.PauseCode.GDinvincibleTextObjects1.length = 0;280gdjs.PauseCode.GDinvincibleTextObjects2.length = 0;281gdjs.PauseCode.GDogreObjects1.length = 0;282gdjs.PauseCode.GDogreObjects2.length = 0;283gdjs.PauseCode.GDzombieObjects1.length = 0;284gdjs.PauseCode.GDzombieObjects2.length = 0;285gdjs.PauseCode.GDwizardObjects1.length = 0;286gdjs.PauseCode.GDwizardObjects2.length = 0;287gdjs.PauseCode.GDopenDoorObjects1.length = 0;288gdjs.PauseCode.GDopenDoorObjects2.length = 0;289gdjs.PauseCode.GDlavaObjects1.length = 0;290gdjs.PauseCode.GDlavaObjects2.length = 0;291gdjs.PauseCode.GDlavaBaseObjects1.length = 0;292gdjs.PauseCode.GDlavaBaseObjects2.length = 0;293gdjs.PauseCode.GDtrapTriggerObjects1.length = 0;294gdjs.PauseCode.GDtrapTriggerObjects2.length = 0;295gdjs.PauseCode.GDwizardProjectileObjects1.length = 0;296gdjs.PauseCode.GDwizardProjectileObjects2.length = 0;297gdjs.PauseCode.GDpathOpenedObjects1.length = 0;298gdjs.PauseCode.GDpathOpenedObjects2.length = 0;299gdjs.PauseCode.GDfogObjects1.length = 0;300gdjs.PauseCode.GDfogObjects2.length = 0;301gdjs.PauseCode.GDblockerObjects1.length = 0;302gdjs.PauseCode.GDblockerObjects2.length = 0;303gdjs.PauseCode.GDmainMenuObjects1.length = 0;304gdjs.PauseCode.GDmainMenuObjects2.length = 0;305gdjs.PauseCode.GDquitButtonObjects1.length = 0;306gdjs.PauseCode.GDquitButtonObjects2.length = 0;307gdjs.PauseCode.GDdeathsObjects1.length = 0;308gdjs.PauseCode.GDdeathsObjects2.length = 0;309gdjs.PauseCode.GDpausedObjects1.length = 0;310gdjs.PauseCode.GDpausedObjects2.length = 0;311gdjs.PauseCode.GDNewObjectObjects1.length = 0;312gdjs.PauseCode.GDNewObjectObjects2.length = 0;313gdjs.PauseCode.GDresumeObjects1.length = 0;314gdjs.PauseCode.GDresumeObjects2.length = 0;315gdjs.PauseCode.GDresumeButtonObjects1.length = 0;316gdjs.PauseCode.GDresumeButtonObjects2.length = 0;317gdjs.PauseCode.eventsList0xb2358(runtimeScene);318return;319}...
stepping-with-natives-and-frameworks.js
Source:stepping-with-natives-and-frameworks.js
...17Protocol.Debugger.enable();18Protocol.Debugger.setBlackboxPatterns({patterns: ['framework\.js']});19InspectorTest.runAsyncTestSuite([20 async function testNativeCodeStepOut() {21 Protocol.Debugger.pause();22 Protocol.Runtime.evaluate({expression: '[1,2].map(v => v);'});23 await logPauseLocation(await Protocol.Debugger.oncePaused());24 Protocol.Debugger.stepInto();25 await logPauseLocation(await Protocol.Debugger.oncePaused());26 Protocol.Debugger.stepOut();27 await logPauseLocation(await Protocol.Debugger.oncePaused());28 await Protocol.Debugger.resume();29 },30 async function testNativeCodeStepOver() {31 Protocol.Debugger.pause();32 Protocol.Runtime.evaluate({expression: '[1,2].map(v => v);'});33 await logPauseLocation(await Protocol.Debugger.oncePaused());34 Protocol.Debugger.stepInto();35 await logPauseLocation(await Protocol.Debugger.oncePaused());36 Protocol.Debugger.stepOver();37 await logPauseLocation(await Protocol.Debugger.oncePaused());38 Protocol.Debugger.stepOver();39 await logPauseLocation(await Protocol.Debugger.oncePaused());40 Protocol.Debugger.stepOver();41 await logPauseLocation(await Protocol.Debugger.oncePaused());42 Protocol.Debugger.stepOver();43 await logPauseLocation(await Protocol.Debugger.oncePaused());44 await Protocol.Debugger.resume();45 },46 async function testNativeCodeStepInto() {47 Protocol.Debugger.pause();48 Protocol.Runtime.evaluate({expression: '[1,2].map(v => v);'});49 await logPauseLocation(await Protocol.Debugger.oncePaused());50 Protocol.Debugger.stepInto();51 await logPauseLocation(await Protocol.Debugger.oncePaused());52 Protocol.Debugger.stepInto();53 await logPauseLocation(await Protocol.Debugger.oncePaused());54 Protocol.Debugger.stepInto();55 await logPauseLocation(await Protocol.Debugger.oncePaused());56 Protocol.Debugger.stepInto();57 await logPauseLocation(await Protocol.Debugger.oncePaused());58 Protocol.Debugger.stepInto();59 await logPauseLocation(await Protocol.Debugger.oncePaused());60 await Protocol.Debugger.resume();61 },62 async function testFrameworkCodeStepInto() {63 Protocol.Debugger.pause();64 Protocol.Runtime.evaluate({expression: 'callAll(() => 1, () => 2);'});65 await logPauseLocation(await Protocol.Debugger.oncePaused());66 Protocol.Debugger.stepInto();67 await logPauseLocation(await Protocol.Debugger.oncePaused());68 Protocol.Debugger.stepInto();69 await logPauseLocation(await Protocol.Debugger.oncePaused());70 Protocol.Debugger.stepInto();71 await logPauseLocation(await Protocol.Debugger.oncePaused());72 Protocol.Debugger.stepInto();73 await logPauseLocation(await Protocol.Debugger.oncePaused());74 Protocol.Debugger.stepInto();75 await logPauseLocation(await Protocol.Debugger.oncePaused());76 await Protocol.Debugger.resume();77 },78 async function testFrameworkCodeStepOver() {79 Protocol.Debugger.pause();80 Protocol.Runtime.evaluate({expression: 'callAll(() => 1, () => 2);'});81 await logPauseLocation(await Protocol.Debugger.oncePaused());82 Protocol.Debugger.stepInto();83 await logPauseLocation(await Protocol.Debugger.oncePaused());84 Protocol.Debugger.stepOver();85 await logPauseLocation(await Protocol.Debugger.oncePaused());86 Protocol.Debugger.stepOver();87 await logPauseLocation(await Protocol.Debugger.oncePaused());88 Protocol.Debugger.stepOver();89 await logPauseLocation(await Protocol.Debugger.oncePaused());90 Protocol.Debugger.stepOver();91 await logPauseLocation(await Protocol.Debugger.oncePaused());92 await Protocol.Debugger.resume();93 },94 async function testFrameworkCodeStepOut() {95 Protocol.Debugger.pause();96 Protocol.Runtime.evaluate({expression: 'callAll(() => 1, () => 2);'});97 await logPauseLocation(await Protocol.Debugger.oncePaused());98 Protocol.Debugger.stepInto();99 await logPauseLocation(await Protocol.Debugger.oncePaused());100 Protocol.Debugger.stepOut();101 await logPauseLocation(await Protocol.Debugger.oncePaused());102 Protocol.Debugger.stepOut();103 await logPauseLocation(await Protocol.Debugger.oncePaused());104 await Protocol.Debugger.resume();105 },106 async function testFrameworkNextCallDeeperStepOut() {107 Protocol.Debugger.pause();108 Protocol.Runtime.evaluate({109 expression: 'callAll(() => 1, callAll.bind(null, () => 2));'});110 await logPauseLocation(await Protocol.Debugger.oncePaused());111 Protocol.Debugger.stepInto();112 await logPauseLocation(await Protocol.Debugger.oncePaused());113 Protocol.Debugger.stepOut();114 await logPauseLocation(await Protocol.Debugger.oncePaused());115 Protocol.Debugger.stepOut();116 await logPauseLocation(await Protocol.Debugger.oncePaused());117 await Protocol.Debugger.resume();118 },119 async function testFrameworkNextCallDeeperStepOutSameFunction() {120 await Protocol.Runtime.evaluate({expression: 'foo = () => 1'});121 Protocol.Debugger.pause();122 Protocol.Runtime.evaluate({123 expression: 'callAll(foo, callAll.bind(null, foo));'});124 await logPauseLocation(await Protocol.Debugger.oncePaused());125 Protocol.Debugger.stepInto();126 await logPauseLocation(await Protocol.Debugger.oncePaused());127 Protocol.Debugger.stepOut();128 await logPauseLocation(await Protocol.Debugger.oncePaused());129 await Protocol.Debugger.resume();130 },131 async function testFrameworkNextCallDeeperStepInto() {132 Protocol.Debugger.pause();133 Protocol.Runtime.evaluate({134 expression: 'callAll(() => 1, callAll.bind(null, () => 2));'});135 await logPauseLocation(await Protocol.Debugger.oncePaused());136 Protocol.Debugger.stepInto();137 await logPauseLocation(await Protocol.Debugger.oncePaused());138 Protocol.Debugger.stepOver();139 await logPauseLocation(await Protocol.Debugger.oncePaused());140 Protocol.Debugger.stepOver();141 await logPauseLocation(await Protocol.Debugger.oncePaused());142 Protocol.Debugger.stepOver();143 await logPauseLocation(await Protocol.Debugger.oncePaused());144 Protocol.Debugger.stepOver();145 await logPauseLocation(await Protocol.Debugger.oncePaused());146 await Protocol.Debugger.resume();147 },148 async function testFrameworkNextCallDeeperStepOver() {149 Protocol.Debugger.pause();150 Protocol.Runtime.evaluate({151 expression: 'callAll(() => 1, callAll.bind(null, () => 2));'});152 await logPauseLocation(await Protocol.Debugger.oncePaused());153 Protocol.Debugger.stepInto();154 await logPauseLocation(await Protocol.Debugger.oncePaused());155 Protocol.Debugger.stepOver();156 await logPauseLocation(await Protocol.Debugger.oncePaused());157 Protocol.Debugger.stepOver();158 await logPauseLocation(await Protocol.Debugger.oncePaused());159 Protocol.Debugger.stepOver();160 await logPauseLocation(await Protocol.Debugger.oncePaused());161 Protocol.Debugger.stepOver();162 await logPauseLocation(await Protocol.Debugger.oncePaused());163 await Protocol.Debugger.resume();164 },165 async function testFrameworkCurrentCallDeeperStepOut() {166 Protocol.Debugger.pause();167 Protocol.Runtime.evaluate({168 expression: 'callAll(callAll.bind(null, () => 1), () => 2);'});169 await logPauseLocation(await Protocol.Debugger.oncePaused());170 Protocol.Debugger.stepInto();171 await logPauseLocation(await Protocol.Debugger.oncePaused());172 Protocol.Debugger.stepOut();173 await logPauseLocation(await Protocol.Debugger.oncePaused());174 Protocol.Debugger.stepOut();175 await logPauseLocation(await Protocol.Debugger.oncePaused());176 await Protocol.Debugger.resume();177 },178 async function testFrameworkCurrentCallDeeperStepOutSameFunction() {179 await Protocol.Runtime.evaluate({expression: 'foo = () => 1'});180 Protocol.Debugger.pause();181 Protocol.Runtime.evaluate({182 expression: 'callAll(callAll.bind(null, foo), foo);'});183 await logPauseLocation(await Protocol.Debugger.oncePaused());184 Protocol.Debugger.stepInto();185 await logPauseLocation(await Protocol.Debugger.oncePaused());186 Protocol.Debugger.stepOut();187 await logPauseLocation(await Protocol.Debugger.oncePaused());188 await Protocol.Debugger.resume();189 },190 async function testFrameworkCurrentCallDeeperStepOver() {191 Protocol.Debugger.pause();192 Protocol.Runtime.evaluate({193 expression: 'callAll(callAll.bind(null, () => 1), () => 2);'});194 await logPauseLocation(await Protocol.Debugger.oncePaused());195 Protocol.Debugger.stepInto();196 await logPauseLocation(await Protocol.Debugger.oncePaused());197 Protocol.Debugger.stepOver();198 await logPauseLocation(await Protocol.Debugger.oncePaused());199 Protocol.Debugger.stepOver();200 await logPauseLocation(await Protocol.Debugger.oncePaused());201 Protocol.Debugger.stepOver();202 await logPauseLocation(await Protocol.Debugger.oncePaused());203 Protocol.Debugger.stepOver();204 await logPauseLocation(await Protocol.Debugger.oncePaused());205 await Protocol.Debugger.resume();206 },207 async function testFrameworkCurrentCallDeeperStepInto() {208 Protocol.Debugger.pause();209 Protocol.Runtime.evaluate({210 expression: 'callAll(callAll.bind(null, () => 1), () => 2);'});211 await logPauseLocation(await Protocol.Debugger.oncePaused());212 Protocol.Debugger.stepInto();213 await logPauseLocation(await Protocol.Debugger.oncePaused());214 Protocol.Debugger.stepInto();215 await logPauseLocation(await Protocol.Debugger.oncePaused());216 Protocol.Debugger.stepInto();217 await logPauseLocation(await Protocol.Debugger.oncePaused());218 Protocol.Debugger.stepInto();219 await logPauseLocation(await Protocol.Debugger.oncePaused());220 Protocol.Debugger.stepInto();221 await logPauseLocation(await Protocol.Debugger.oncePaused());222 await Protocol.Debugger.resume();223 },224 async function testFrameworkStepOverMixed() {225 await Protocol.Runtime.evaluate({expression: 'foo = () => 1'});226 Protocol.Debugger.pause();227 Protocol.Runtime.evaluate({228 expression: 'callAll(foo, foo, () => 2);'});229 await logPauseLocation(await Protocol.Debugger.oncePaused());230 Protocol.Debugger.stepInto();231 await logPauseLocation(await Protocol.Debugger.oncePaused());232 Protocol.Debugger.stepOver();233 await logPauseLocation(await Protocol.Debugger.oncePaused());234 Protocol.Debugger.stepOver();235 await logPauseLocation(await Protocol.Debugger.oncePaused());236 Protocol.Debugger.stepOver();237 await logPauseLocation(await Protocol.Debugger.oncePaused());238 Protocol.Debugger.stepOver();239 await logPauseLocation(await Protocol.Debugger.oncePaused());240 Protocol.Debugger.stepOver();241 await logPauseLocation(await Protocol.Debugger.oncePaused());242 Protocol.Debugger.stepOver();243 await logPauseLocation(await Protocol.Debugger.oncePaused());244 await Protocol.Debugger.resume();245 },246 async function testFrameworkStepOutMixed() {247 await Protocol.Runtime.evaluate({expression: 'foo = () => 1'});248 Protocol.Debugger.pause();249 Protocol.Runtime.evaluate({250 expression: 'callAll(foo, foo, () => 2);'});251 await logPauseLocation(await Protocol.Debugger.oncePaused());252 Protocol.Debugger.stepInto();253 await logPauseLocation(await Protocol.Debugger.oncePaused());254 Protocol.Debugger.stepOut();255 await logPauseLocation(await Protocol.Debugger.oncePaused());256 Protocol.Debugger.stepOut();257 await logPauseLocation(await Protocol.Debugger.oncePaused());258 await Protocol.Debugger.resume();259 },260 async function testStepOutFrameworkSameFunctionAtReturn() {261 await Protocol.Runtime.evaluate({expression: 'foo = () => 1'});262 Protocol.Debugger.pause();263 Protocol.Runtime.evaluate({264 expression: 'callAll(foo, foo, () => 2);'});265 await logPauseLocation(await Protocol.Debugger.oncePaused());266 Protocol.Debugger.stepInto();267 await logPauseLocation(await Protocol.Debugger.oncePaused());268 Protocol.Debugger.stepOver();269 await logPauseLocation(await Protocol.Debugger.oncePaused());270 Protocol.Debugger.stepOut();271 await logPauseLocation(await Protocol.Debugger.oncePaused());272 Protocol.Debugger.stepOut();273 await logPauseLocation(await Protocol.Debugger.oncePaused());274 await Protocol.Debugger.resume();275 }276]);...
pauseGuardianTest.js
Source:pauseGuardianTest.js
1const { address, both, etherMantissa } = require('../Utils/Ethereum');2const { makeComptroller, makeCToken } = require('../Utils/Compound');3describe('Comptroller', () => {4 let comptroller, cToken;5 let root, accounts;6 beforeEach(async () => {7 [root, ...accounts] = saddle.accounts;8 });9 describe("_setPauseGuardian", () => {10 beforeEach(async () => {11 comptroller = await makeComptroller();12 });13 describe("failing", () => {14 it("emits a failure log if not sent by admin", async () => {15 let result = await send(comptroller, '_setPauseGuardian', [root], {from: accounts[1]});16 expect(result).toHaveTrollFailure('UNAUTHORIZED', 'SET_PAUSE_GUARDIAN_OWNER_CHECK');17 });18 it("does not change the pause guardian", async () => {19 let pauseGuardian = await call(comptroller, 'pauseGuardian');20 expect(pauseGuardian).toEqual(address(0));21 await send(comptroller, '_setPauseGuardian', [root], {from: accounts[1]});22 pauseGuardian = await call(comptroller, 'pauseGuardian');23 expect(pauseGuardian).toEqual(address(0));24 });25 });26 describe('succesfully changing pause guardian', () => {27 let result;28 beforeEach(async () => {29 comptroller = await makeComptroller();30 result = await send(comptroller, '_setPauseGuardian', [accounts[1]]);31 });32 it('emits new pause guardian event', async () => {33 expect(result).toHaveLog(34 'NewPauseGuardian',35 {newPauseGuardian: accounts[1], oldPauseGuardian: address(0)}36 );37 });38 it('changes pending pause guardian', async () => {39 let pauseGuardian = await call(comptroller, 'pauseGuardian');40 expect(pauseGuardian).toEqual(accounts[1]);41 });42 });43 });44 describe('setting paused', () => {45 beforeEach(async () => {46 cToken = await makeCToken({supportMarket: true});47 comptroller = cToken.comptroller;48 });49 let globalMethods = ["Transfer", "Seize"];50 describe('succeeding', () => {51 let pauseGuardian;52 beforeEach(async () => {53 pauseGuardian = accounts[1];54 await send(comptroller, '_setPauseGuardian', [accounts[1]], {from: root});55 });56 globalMethods.forEach(async (method) => {57 it(`only pause guardian or admin can pause ${method}`, async () => {58 await expect(send(comptroller, `_set${method}Paused`, [true], {from: accounts[2]})).rejects.toRevert("revert only pause guardian and admin can pause");59 await expect(send(comptroller, `_set${method}Paused`, [false], {from: accounts[2]})).rejects.toRevert("revert only pause guardian and admin can pause");60 });61 it(`PauseGuardian can pause of ${method}GuardianPaused`, async () => {62 result = await send(comptroller, `_set${method}Paused`, [true], {from: pauseGuardian});63 expect(result).toHaveLog(`ActionPaused`, {action: method, pauseState: true});64 let camelCase = method.charAt(0).toLowerCase() + method.substring(1);65 state = await call(comptroller, `${camelCase}GuardianPaused`);66 expect(state).toEqual(true);67 await expect(send(comptroller, `_set${method}Paused`, [false], {from: pauseGuardian})).rejects.toRevert("revert only admin can unpause");68 result = await send(comptroller, `_set${method}Paused`, [false]);69 expect(result).toHaveLog(`ActionPaused`, {action: method, pauseState: false});70 state = await call(comptroller, `${camelCase}GuardianPaused`);71 expect(state).toEqual(false);72 });73 it(`pauses ${method}`, async() => {74 await send(comptroller, `_set${method}Paused`, [true], {from: pauseGuardian});75 switch (method) {76 case "Transfer":77 await expect(78 send(comptroller, 'transferAllowed', [address(1), address(2), address(3), 1])79 ).rejects.toRevert(`revert ${method.toLowerCase()} is paused`);80 break;81 case "Seize":82 await expect(83 send(comptroller, 'seizeAllowed', [address(1), address(2), address(3), address(4), 1])84 ).rejects.toRevert(`revert ${method.toLowerCase()} is paused`);85 break;86 default:87 break;88 }89 });90 });91 });92 let marketMethods = ["Borrow", "Mint"];93 describe('succeeding', () => {94 let pauseGuardian;95 beforeEach(async () => {96 pauseGuardian = accounts[1];97 await send(comptroller, '_setPauseGuardian', [accounts[1]], {from: root});98 });99 marketMethods.forEach(async (method) => {100 it(`only pause guardian or admin can pause ${method}`, async () => {101 await expect(send(comptroller, `_set${method}Paused`, [cToken._address, true], {from: accounts[2]})).rejects.toRevert("revert only pause guardian and admin can pause");102 await expect(send(comptroller, `_set${method}Paused`, [cToken._address, false], {from: accounts[2]})).rejects.toRevert("revert only pause guardian and admin can pause");103 });104 it(`PauseGuardian can pause of ${method}GuardianPaused`, async () => {105 result = await send(comptroller, `_set${method}Paused`, [cToken._address, true], {from: pauseGuardian});106 expect(result).toHaveLog(`ActionPaused`, {cToken: cToken._address, action: method, pauseState: true});107 let camelCase = method.charAt(0).toLowerCase() + method.substring(1);108 state = await call(comptroller, `${camelCase}GuardianPaused`, [cToken._address]);109 expect(state).toEqual(true);110 await expect(send(comptroller, `_set${method}Paused`, [cToken._address, false], {from: pauseGuardian})).rejects.toRevert("revert only admin can unpause");111 result = await send(comptroller, `_set${method}Paused`, [cToken._address, false]);112 expect(result).toHaveLog(`ActionPaused`, {cToken: cToken._address, action: method, pauseState: false});113 state = await call(comptroller, `${camelCase}GuardianPaused`, [cToken._address]);114 expect(state).toEqual(false);115 });116 it(`pauses ${method}`, async() => {117 await send(comptroller, `_set${method}Paused`, [cToken._address, true], {from: pauseGuardian});118 switch (method) {119 case "Mint":120 expect(await call(comptroller, 'mintAllowed', [address(1), address(2), 1])).toHaveTrollError('MARKET_NOT_LISTED');121 await expect(send(comptroller, 'mintAllowed', [cToken._address, address(2), 1])).rejects.toRevert(`revert ${method.toLowerCase()} is paused`);122 break;123 case "Borrow":124 expect(await call(comptroller, 'borrowAllowed', [address(1), address(2), 1])).toHaveTrollError('MARKET_NOT_LISTED');125 await expect(send(comptroller, 'borrowAllowed', [cToken._address, address(2), 1])).rejects.toRevert(`revert ${method.toLowerCase()} is paused`);126 break;127 default:128 break;129 }130 });131 });132 });133 });...
music.js
Source:music.js
...34 $("playSearch").onclick=playSearch;35 $("playHole").onclick=playHole;36};37var pauseAll=function(){38 cant.pause();39 waves.pause();40 highway.pause();41 escape.pause();42 autumn.pause();43 penny.pause();44 solitude.pause();45 dusty.pause();46 corner.pause();47 search.pause();48 hole.pause();49 like.pause();50 saturn.pause();51 twisting.pause();52 fire.pause();53}54var playCant=function(){55 if(!cant.paused){56 cant.pause();57 $("playCant").innerHTML="<img src='Images/play.png' alt='play icon'>"58 }59 else{60 pauseAll();61 cant.play();62 $("playCant").innerHTML="<img src='Images/pause.png' alt='pause icon'>"63 }64}65var playLike = function(){66 if(!like.paused){67 like.pause();68 $("playLike").innerHTML="<img src='Images/play.png' alt='play icon'>"69 }70 else{71 pauseAll();72 like.play();73 $("playLike").innerHTML="<img src='Images/pause.png' alt='pause icon'>"74 }75}76var playSaturn = function(){77 if(!saturn.paused){78 saturn.pause();79 $("playSaturn").innerHTML="<img src='Images/play.png' alt='play icon'>"80 }81 else{82 pauseAll();83 saturn.play();84 $("playSaturn").innerHTML="<img src='Images/pause.png' alt='pause icon'>"85 }86}87var playFire = function(){88 if(!fire.paused){89 fire.pause();90 $("playFire").innerHTML="<img src='Images/play.png' alt='play icon'>"91 }92 else{93 pauseAll();94 fire.play();95 $("playFire").innerHTML="<img src='Images/pause.png' alt='pause icon'>"96 }97}98var playWire = function(){99 if(!twisting.paused){100 twisting.pause();101 $("playWire").innerHTML="<img src='Images/play.png' alt='play icon'>"102 }103 else{104 pauseAll();105 twisting.play();106 $("playWire").innerHTML="<img src='Images/pause.png' alt='pause icon'>"107 }108}109var playWaves = function(){110 if(!waves.paused){111 waves.pause();112 $("playWaves").innerHTML="<img src='Images/play.png' alt='play icon'>"113 }114 else{115 pauseAll();116 waves.play();117 $("playWaves").innerHTML="<img src='Images/pause.png' alt='pause icon'>"118 }119}120var playHighway = function(){121 if(!highway.paused){122 highway.pause();123 $("playHighway").innerHTML="<img src='Images/play.png' alt='play icon'>"124 }125 else{126 pauseAll();127 highway.play();128 $("playHighway").innerHTML="<img src='Images/pause.png' alt='pause icon'>"129 }130}131var playEscape = function(){132 if(!escape.paused){133 escape.pause();134 $("playEscape").innerHTML="<img src='Images/play.png' alt='play icon'>"135 }136 else{137 pauseAll();138 escape.play();139 $("playEscape").innerHTML="<img src='Images/pause.png' alt='pause icon'>"140 }141}142var playAutumn = function(){143 if(!autumn.paused){144 autumn.pause();145 $("playAutumn").innerHTML="<img src='Images/play.png' alt='play icon'>"146 }147 else{148 pauseAll();149 autumn.play();150 $("playAutumn").innerHTML="<img src='Images/pause.png' alt='pause icon'>"151 }152}153var playPenny = function(){154 if(!penny.paused){155 penny.pause();156 $("playPenny").innerHTML="<img src='Images/play.png' alt='play icon'>"157 }158 else{159 pauseAll();160 penny.play();161 $("playPenny").innerHTML="<img src='Images/pause.png' alt='pause icon'>"162 }163}164var playSolitude = function(){165 if(!solitude.paused){166 solitude.pause();167 $("playSolitude").innerHTML="<img src='Images/play.png' alt='play icon'>"168 }169 else{170 pauseAll();171 solitude.play();172 $("playSolitude").innerHTML="<img src='Images/pause.png' alt='pause icon'>"173 }174}175var playDusty = function(){176 if(!dusty.paused){177 dusty.pause();178 $("playDusty").innerHTML="<img src='Images/play.png' alt='play icon'>"179 }180 else{181 pauseAll();182 dusty.play();183 $("playDusty").innerHTML="<img src='Images/pause.png' alt='pause icon'>"184 }185}186var playCorner = function(){187 if(!corner.paused){188 corner.pause();189 $("playCorner").innerHTML="<img src='Images/play.png' alt='play icon'>"190 }191 else{192 pauseAll();193 corner.play();194 $("playCorner").innerHTML="<img src='Images/pause.png' alt='pause icon'>"195 }196}197var playSearch = function(){198 if(!search.paused){199 search.pause();200 $("playSearch").innerHTML="<img src='Images/play.png' alt='play icon'>"201 }202 else{203 pauseAll();204 search.play();205 $("playSearch").innerHTML="<img src='Images/pause.png' alt='pause icon'>"206 }207}208var playHole= function(){209 if(!hole.paused){210 hole.pause();211 $("playHole").innerHTML="<img src='Images/play.png' alt='play icon'>"212 }213 else{214 pauseAll();215 hole.play();216 $("playHole").innerHTML="<img src='Images/pause.png' alt='pause icon'>"217 }...
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!!