How to use setFrame method in Appium Base Driver

Best JavaScript code snippet using appium-base-driver

menus.js

Source:menus.js Github

copy

Full Screen

...152 x: 1*dx,153 154 duration: 1*duration,155 call_back: function(){156 voters[index(0, 0)].setFrame(0)157 }158 },159 {160 targets: pointers[0],161 x: 5*dx,162 163 duration: 5*duration,164 call_back: function(){165 voters[index(1, 0)].setFrame(1)166 }167 },168 {169 targets: mouse,170 on_complete: function(){171 container.destroy()172 anims['Suppress'].create(scene)173 }174 }175 176 ]177 178 tweens.forEach((tween, i) => {179 180 if(tweens[i+1]){181 tween.onComplete = function(){182 if(tween.on_complete){183 tween.on_complete()184 }185 scene.add.tween(tweens[i+1])186 }187 }188 })189 190 scene.add.tween(tweens[0])191 }192 },193 "Nonvoter" : {194 create: function(scene){195 let container = scene.add.container(scene.cameras.main.centerX, 1.125*scene.cameras.main.centerY)196 197 let index = (i, j) => 10*j + i198 container.setScale(0.75)199 200 let corners = {}201 202 203 let dx = 280 /2204 let dy = 350 /2205 206 for(let i = -1; i < 2; i+= 1){207 for(let j = 0; j < 2; j += 1){208 209 210 211 let x = i*dx212 let y = j*dy213 let tl = scene.add.sprite(x, y, 'borders', 0)214 tl.setOrigin(1,1)215 tl.index = 0 216 container.add(tl)217 218 219 let tr = scene.add.sprite(x, y, 'borders', 2)220 tr.index = 2221 tr.setOrigin(0,1)222 container.add(tr)223 224 let bl = scene.add.sprite(x, y, 'borders', 8)225 bl.index = 8226 bl.setOrigin(1,0)227 container.add(bl)228 229 let br = scene.add.sprite(x, y, 'borders', 10)230 br.index = 10 231 br.setOrigin(0,0)232 container.add(br)233 234 corners[index(i, j)] = {235 tl: tl, bl: bl, tr: tr, br: br236 }237 238 let party = j+1239 if(Math.abs(i) == 1 && (i === 1 || j !== 0)){240 party = 0241 }242 let voter = scene.add.sprite(x, y, 'voters', 12*party + Math.abs(i+j)%12)243 244 container.add(voter)245 246 247 248 249 }250 }251 252 let mouse = scene.add.sprite(-2*dx, dy, 'dots', 4)253 mouse.setScale(3)254 container.add(mouse)255 let duration = 200256 257 let tweens = [258 {259 targets: mouse,260 x: -1.5*dx,261 duration: duration,262 },263 {264 targets: mouse,265 x: -dx,266 duration: duration,267 on_complete: ()=>{268 let c = corners[index(-1,1)]269 c.tl.setFrame(c.tl.index + 36)270 c.tr.setFrame(c.tr.index + 36)271 c.bl.setFrame(c.bl.index + 36)272 c.br.setFrame(c.br.index + 36)273 }274 },275 {276 targets: mouse,277 y: dy/2,278 duration: duration,279 280 },281 {282 targets: mouse,283 y: 0,284 duration: duration,285 on_complete: ()=>{286 let c = corners[index(-1,0)]287 c.tl.setFrame(c.tl.index + 36)288 c.tr.setFrame(c.tr.index + 36)289 c.bl.setFrame(c.bl.index + 36)290 c.br.setFrame(c.br.index + 36)291 }292 },293 {294 targets: mouse,295 x: -dx/2,296 duration: duration297 },298 {299 targets: mouse,300 x: 0,301 duration: duration,302 on_complete: ()=>{303 let c = corners[index(0,0)]304 c.tl.setFrame(c.tl.index + 36)305 c.tr.setFrame(c.tr.index + 36)306 c.bl.setFrame(c.bl.index + 36)307 c.br.setFrame(c.br.index + 36)308 }309 },310 {311 targets: mouse,312 x: 0.5*dx,313 duration: duration,314 315 },316 {317 targets: mouse,318 x: dx,319 duration: duration,320 on_complete: ()=>{321 let c = corners[index(-1,1)]322 c.tl.setFrame(28-12)323 c.tr.setFrame(30-12)324 c.bl.setFrame(32-12)325 c.br.setFrame(34-12)326 327 c = corners[index(-1,0)]328 c.tl.setFrame(24-12)329 c.tr.setFrame(25-12)330 c.bl.setFrame(28-12)331 c.br.setFrame(35-12)332 333 c = corners[index(0,0)]334 c.tl.setFrame(25-12)335 c.tr.setFrame(26-12)336 c.bl.setFrame(33-12)337 c.br.setFrame(34-12)338 339 c = corners[index(1, 0)]340 c.tl.setFrame(c.tl.index + 36)341 c.tr.setFrame(c.tr.index + 36)342 c.bl.setFrame(c.bl.index + 36)343 c.br.setFrame(c.br.index + 36)344 }345 },346 {347 targets: mouse,348 y: 0.5*dy,349 duration: duration,350 351 },352 {353 targets: mouse,354 y: dy,355 duration: duration,356 on_complete: function(){357 c = corners[index(1, 1)]358 c.tl.setFrame(c.tl.index + 36)359 c.tr.setFrame(c.tr.index + 36)360 c.bl.setFrame(c.bl.index + 36)361 c.br.setFrame(c.br.index + 36)362 }363 364 },365 {366 targets: mouse,367 x: 0.5*dx,368 duration: duration,369 370 },371 {372 targets: mouse,373 x: 0*dx,374 duration: duration,375 on_complete: function(){376 c = corners[index(0, 1)]377 c.tl.setFrame(c.tl.index + 36)378 c.tr.setFrame(c.tr.index + 36)379 c.bl.setFrame(c.bl.index + 36)380 c.br.setFrame(c.br.index + 36)381 }382 383 },384 {385 targets: mouse,386 y: 1.5*dy,387 duration: duration,388 389 },390 {391 targets: mouse,392 y: 3*dy,393 duration: 5*duration,394 on_complete: function(){395 c = corners[index(1, 0)]396 c.tl.setFrame(24)397 c.tr.setFrame(26)398 c.bl.setFrame(28)399 c.br.setFrame(30)400 401 c = corners[index(1, 1)]402 c.tl.setFrame(31)403 c.tr.setFrame(30)404 c.bl.setFrame(33)405 c.br.setFrame(34)406 407 c = corners[index(0, 1)]408 c.tl.setFrame(24)409 c.tr.setFrame(25)410 c.bl.setFrame(32)411 c.br.setFrame(33)412 } 413 414 },415 {416 targets: mouse,417 on_complete: function(){418 container.destroy()419 anims['Nonvoter'].create(scene)420 }421 }422 423 ]424 425 tweens.forEach((tween, i) => {426 427 if(tweens[i+1]){428 tween.onComplete = function(){429 if(tween.on_complete){430 tween.on_complete()431 }432 scene.add.tween(tweens[i+1])433 }434 }435 })436 437 scene.add.tween(tweens[0])438 }439 },440 "Dense": {441 create: function(scene){442 let container = scene.add.container(scene.cameras.main.centerX, 1.125*scene.cameras.main.centerY)443 444 let index = (i, j) => 10*j + i445 container.setScale(0.75)446 447 let corners = {}448 449 450 let dx = 280 /2451 let dy = 350 /2452 453 for(let i = -1; i < 2; i+= 1){454 for(let j = 0; j < 2; j += 1){455 456 if(i === 0 && j == 0){457 continue 458 }459 460 let x = i*dx461 let y = j*dy462 let tl = scene.add.sprite(x, y, 'borders', 0)463 tl.setOrigin(1,1)464 tl.index = 0 465 container.add(tl)466 467 468 let tr = scene.add.sprite(x, y, 'borders', 2)469 tr.index = 2470 tr.setOrigin(0,1)471 container.add(tr)472 473 let bl = scene.add.sprite(x, y, 'borders', 8)474 bl.index = 8475 bl.setOrigin(1,0)476 container.add(bl)477 478 let br = scene.add.sprite(x, y, 'borders', 10)479 br.index = 10 480 br.setOrigin(0,0)481 container.add(br)482 483 corners[index(i, j)] = {484 tl: tl, bl: bl, tr: tr, br: br485 }486 487 let party = j+1488 let voter = scene.add.sprite(x, y, 'voters', 12*party + Math.abs(i+j)%12)489 490 container.add(voter)491 492 if(i == -1 && j == 0){493 voter.x -= 25494 voter = scene.add.sprite(x, y, 'voters', 12*party + Math.abs(i+j + 1)%12)495 container.add(voter)496 voter.x += 25 497 }498 499 500 501 }502 }503 504 let mouse = scene.add.sprite(-2*dx, dy, 'dots', 4)505 mouse.setScale(3)506 container.add(mouse)507 let duration = 200508 509 let tweens = [510 {511 targets: mouse,512 x: -1.5*dx,513 duration: duration,514 },515 {516 targets: mouse,517 x: -dx,518 duration: duration,519 on_complete: ()=>{520 let c = corners[index(-1,1)]521 c.tl.setFrame(c.tl.index + 36)522 c.tr.setFrame(c.tr.index + 36)523 c.bl.setFrame(c.bl.index + 36)524 c.br.setFrame(c.br.index + 36)525 }526 },527 {528 targets: mouse,529 y: dy/2,530 duration: duration,531 532 },533 {534 targets: mouse,535 y: 0,536 duration: duration,537 on_complete: ()=>{538 let c = corners[index(-1,0)]539 c.tl.setFrame(c.tl.index + 36)540 c.tr.setFrame(c.tr.index + 36)541 c.bl.setFrame(c.bl.index + 36)542 c.br.setFrame(c.br.index + 36)543 }544 },545 {546 targets: mouse,547 x: -dx/2,548 duration: duration549 },550 {551 targets: mouse,552 x: 0,553 duration: duration,554 on_complete: ()=>{555 let c = corners[index(-1,1)]556 c.tl.setFrame(28-12)557 c.tr.setFrame(30-12)558 c.bl.setFrame(32-12)559 c.br.setFrame(34-12)560 561 c = corners[index(-1,0)]562 c.tl.setFrame(24-12)563 c.tr.setFrame(26-12)564 c.bl.setFrame(28-12)565 c.br.setFrame(30-12)566 567 }568 },569 {570 targets: mouse,571 x: 0.5*dx,572 duration: duration,573 574 },575 {576 targets: mouse,577 x: dx,578 duration: duration,579 on_complete: ()=>{580 581 582 let c = corners[index(1, 0)]583 c.tl.setFrame(c.tl.index + 36)584 c.tr.setFrame(c.tr.index + 36)585 c.bl.setFrame(c.bl.index + 36)586 c.br.setFrame(c.br.index + 36)587 }588 },589 {590 targets: mouse,591 y: 0.5*dy,592 duration: duration,593 594 },595 {596 targets: mouse,597 y: dy,598 duration: duration,599 on_complete: function(){600 c = corners[index(1, 1)]601 c.tl.setFrame(c.tl.index + 36)602 c.tr.setFrame(c.tr.index + 36)603 c.bl.setFrame(c.bl.index + 36)604 c.br.setFrame(c.br.index + 36)605 }606 607 },608 {609 targets: mouse,610 x: 0.5*dx,611 duration: duration,612 613 },614 {615 targets: mouse,616 x: 0*dx,617 duration: duration,618 on_complete: function(){619 c = corners[index(0, 1)]620 c.tl.setFrame(c.tl.index + 36)621 c.tr.setFrame(c.tr.index + 36)622 c.bl.setFrame(c.bl.index + 36)623 c.br.setFrame(c.br.index + 36)624 }625 626 },627 {628 targets: mouse,629 y: 1.5*dy,630 duration: duration,631 632 },633 {634 targets: mouse,635 y: 3*dy,636 duration: 5*duration,637 on_complete: function(){638 c = corners[index(1, 0)]639 c.tl.setFrame(24)640 c.tr.setFrame(26)641 c.bl.setFrame(28)642 c.br.setFrame(30)643 644 c = corners[index(1, 1)]645 c.tl.setFrame(31)646 c.tr.setFrame(30)647 c.bl.setFrame(33)648 c.br.setFrame(34)649 650 c = corners[index(0, 1)]651 c.tl.setFrame(24)652 c.tr.setFrame(25)653 c.bl.setFrame(32)654 c.br.setFrame(33)655 } 656 657 },658 {659 targets: mouse,660 on_complete: function(){661 container.destroy()662 anims['Dense'].create(scene)663 }664 }665 666 ]667 668 tweens.forEach((tween, i) => {669 670 if(tweens[i+1]){671 tween.onComplete = function(){672 if(tween.on_complete){673 tween.on_complete()674 }675 scene.add.tween(tweens[i+1])676 }677 }678 })679 680 scene.add.tween(tweens[0])681 }682 },683 "Majority": {684 create: function(scene){685 let container = scene.add.container(scene.cameras.main.centerX, 1.125*scene.cameras.main.centerY)686 687 let index = (i, j) => 10*j + i688 container.setScale(0.75)689 690 let corners = {}691 692 693 let dx = 280 /2694 let dy = 350 /2695 696 for(let i = -1; i < 2; i+= 1){697 for(let j = 0; j < 2; j += 1){698 699 700 701 let x = i*dx702 let y = j*dy703 let tl = scene.add.sprite(x, y, 'borders', 0)704 tl.setOrigin(1,1)705 tl.index = 0 706 container.add(tl)707 708 709 let tr = scene.add.sprite(x, y, 'borders', 2)710 tr.index = 2711 tr.setOrigin(0,1)712 container.add(tr)713 714 let bl = scene.add.sprite(x, y, 'borders', 8)715 bl.index = 8716 bl.setOrigin(1,0)717 container.add(bl)718 719 let br = scene.add.sprite(x, y, 'borders', 10)720 br.index = 10 721 br.setOrigin(0,0)722 container.add(br)723 724 corners[index(i, j)] = {725 tl: tl, bl: bl, tr: tr, br: br726 }727 728 let party = j+1729 let voter = scene.add.sprite(x, y, 'voters', 12*party + Math.abs(i+j)%12)730 731 container.add(voter)732 733 734 735 736 }737 }738 739 let mouse = scene.add.sprite(-2*dx, dy, 'dots', 4)740 mouse.setScale(3)741 container.add(mouse)742 let duration = 200743 744 let tweens = [745 {746 targets: mouse,747 x: -1.5*dx,748 duration: duration,749 },750 {751 targets: mouse,752 x: -dx,753 duration: duration,754 on_complete: ()=>{755 let c = corners[index(-1,1)]756 c.tl.setFrame(c.tl.index + 36)757 c.tr.setFrame(c.tr.index + 36)758 c.bl.setFrame(c.bl.index + 36)759 c.br.setFrame(c.br.index + 36)760 }761 },762 {763 targets: mouse,764 y: dy/2,765 duration: duration,766 767 },768 {769 targets: mouse,770 y: 0,771 duration: duration,772 on_complete: ()=>{773 let c = corners[index(-1,0)]774 c.tl.setFrame(c.tl.index + 36)775 c.tr.setFrame(c.tr.index + 36)776 c.bl.setFrame(c.bl.index + 36)777 c.br.setFrame(c.br.index + 36)778 }779 },780 {781 targets: mouse,782 x: -dx/2,783 duration: duration784 },785 {786 targets: mouse,787 x: 0,788 duration: duration,789 on_complete: ()=>{790 let c = corners[index(0,0)]791 c.tl.setFrame(c.tl.index + 36)792 c.tr.setFrame(c.tr.index + 36)793 c.bl.setFrame(c.bl.index + 36)794 c.br.setFrame(c.br.index + 36)795 }796 },797 {798 targets: mouse,799 x: 0.5*dx,800 duration: duration,801 802 },803 {804 targets: mouse,805 x: dx,806 duration: duration,807 on_complete: ()=>{808 let c = corners[index(-1,1)]809 c.tl.setFrame(28-12)810 c.tr.setFrame(30-12)811 c.bl.setFrame(32-12)812 c.br.setFrame(34-12)813 814 c = corners[index(-1,0)]815 c.tl.setFrame(24-12)816 c.tr.setFrame(25-12)817 c.bl.setFrame(28-12)818 c.br.setFrame(35-12)819 820 c = corners[index(0,0)]821 c.tl.setFrame(25-12)822 c.tr.setFrame(26-12)823 c.bl.setFrame(33-12)824 c.br.setFrame(34-12)825 826 c = corners[index(1, 0)]827 c.tl.setFrame(c.tl.index + 36)828 c.tr.setFrame(c.tr.index + 36)829 c.bl.setFrame(c.bl.index + 36)830 c.br.setFrame(c.br.index + 36)831 }832 },833 {834 targets: mouse,835 y: 0.5*dy,836 duration: duration,837 838 },839 {840 targets: mouse,841 y: dy,842 duration: duration,843 on_complete: function(){844 c = corners[index(1, 1)]845 c.tl.setFrame(c.tl.index + 36)846 c.tr.setFrame(c.tr.index + 36)847 c.bl.setFrame(c.bl.index + 36)848 c.br.setFrame(c.br.index + 36)849 }850 851 },852 {853 targets: mouse,854 x: 0.5*dx,855 duration: duration,856 857 },858 {859 targets: mouse,860 x: 0*dx,861 duration: duration,862 on_complete: function(){863 c = corners[index(0, 1)]864 c.tl.setFrame(c.tl.index + 36)865 c.tr.setFrame(c.tr.index + 36)866 c.bl.setFrame(c.bl.index + 36)867 c.br.setFrame(c.br.index + 36)868 }869 870 },871 {872 targets: mouse,873 y: 1.5*dy,874 duration: duration,875 876 },877 {878 targets: mouse,879 y: 3*dy,880 duration: 5*duration,881 on_complete: function(){882 c = corners[index(1, 0)]883 c.tl.setFrame(24)884 c.tr.setFrame(26)885 c.bl.setFrame(28)886 c.br.setFrame(30)887 888 c = corners[index(1, 1)]889 c.tl.setFrame(31)890 c.tr.setFrame(30)891 c.bl.setFrame(33)892 c.br.setFrame(34)893 894 c = corners[index(0, 1)]895 c.tl.setFrame(24)896 c.tr.setFrame(25)897 c.bl.setFrame(32)898 c.br.setFrame(33)899 } 900 901 },902 {903 targets: mouse,904 on_complete: function(){905 container.destroy()906 anims['Majority'].create(scene)907 }908 }909 910 ]911 912 tweens.forEach((tween, i) => {913 914 if(tweens[i+1]){915 tween.onComplete = function(){916 if(tween.on_complete){917 tween.on_complete()918 }919 scene.add.tween(tweens[i+1])920 }921 }922 })923 924 scene.add.tween(tweens[0])925 }926 },927 "Show Voters": {928 create: function(scene){929 for(let i = -1; i < 2; i+= 1){930 for(let j = 0; j < 2; j += 1){931 let s = 0.75 932 933 let dx = 280 /2934 let dy = 350 /2935 936 let x = scene.cameras.main.centerX + s*i*dx937 let y = 1.125*scene.cameras.main.centerY + s*j*dy938 let tl = scene.add.sprite(x, y, 'borders', 0)939 tl.setOrigin(1,1)940 tl.setScale(s)941 942 let tr = scene.add.sprite(x, y, 'borders', 2)943 tr.setOrigin(0,1)944 tr.setScale(s)945 946 let bl = scene.add.sprite(x, y, 'borders', 8)947 bl.setOrigin(1,0)948 bl.setScale(s)949 950 let br = scene.add.sprite(x, y, 'borders', 10)951 br.setOrigin(0,0)952 br.setScale(s)953 954 955 let party = j+1956 let voter = scene.add.sprite(x, y, 'voters', 12*party + Math.abs(i+j)%12)957 958 voter.setScale(s)959 }960 }961 }962 },963 "Click and Drag": {964 create: function(scene){965 let container = scene.add.container(scene.cameras.main.centerX, 1.125*scene.cameras.main.centerY)966 967 let index = (i, j) => 10*j + i968 container.setScale(0.75)969 970 let corners = {}971 972 973 let dx = 280 /2974 let dy = 350 /2975 976 for(let i = -1; i < 2; i+= 1){977 for(let j = 0; j < 2; j += 1){978 979 980 981 let x = i*dx982 let y = j*dy983 let tl = scene.add.sprite(x, y, 'borders', 0)984 tl.setOrigin(1,1)985 tl.index = 0 986 container.add(tl)987 988 989 let tr = scene.add.sprite(x, y, 'borders', 2)990 tr.index = 2991 tr.setOrigin(0,1)992 container.add(tr)993 994 let bl = scene.add.sprite(x, y, 'borders', 8)995 bl.index = 8996 bl.setOrigin(1,0)997 container.add(bl)998 999 let br = scene.add.sprite(x, y, 'borders', 10)1000 br.index = 10 1001 br.setOrigin(0,0)1002 container.add(br)1003 1004 corners[index(i, j)] = {1005 tl: tl, bl: bl, tr: tr, br: br1006 }1007 1008 let party = j+11009 let voter = scene.add.sprite(x, y, 'voters', 12*party + Math.abs(i+j)%12)1010 1011 container.add(voter)1012 1013 1014 1015 1016 }1017 }1018 1019 let mouse = scene.add.sprite(-2*dx, 0, 'dots', 4)1020 mouse.setScale(3)1021 container.add(mouse)1022 let duration = 2001023 1024 let tweens = [1025 {1026 targets: mouse,1027 x: -1.5*dx,1028 duration: duration,1029 },1030 {1031 targets: mouse,1032 x: -dx,1033 duration: duration,1034 on_complete: ()=>{1035 let c = corners[index(-1,0)]1036 c.tl.setFrame(c.tl.index + 36)1037 c.tr.setFrame(c.tr.index + 36)1038 c.bl.setFrame(c.bl.index + 36)1039 c.br.setFrame(c.br.index + 36)1040 }1041 },1042 {1043 targets: mouse,1044 x: -dx/2,1045 duration: duration,1046 1047 },1048 {1049 targets: mouse,1050 x: 0,1051 duration: duration,1052 on_complete: ()=>{1053 let c = corners[index(0,0)]1054 c.tl.setFrame(c.tl.index + 36)1055 c.tr.setFrame(c.tr.index + 36)1056 c.bl.setFrame(c.bl.index + 36)1057 c.br.setFrame(c.br.index + 36)1058 }1059 },1060 {1061 targets: mouse,1062 y: dy/2,1063 duration: duration1064 },1065 {1066 targets: mouse,1067 y: dy,1068 duration: duration,1069 on_complete: ()=>{1070 let c = corners[index(0,1)]1071 c.tl.setFrame(c.tl.index + 36)1072 c.tr.setFrame(c.tr.index + 36)1073 c.bl.setFrame(c.bl.index + 36)1074 c.br.setFrame(c.br.index + 36)1075 }1076 },1077 {1078 targets: mouse,1079 y: 1.5*dy,1080 duration: duration,1081 1082 },1083 {1084 targets: mouse,1085 y: 5*dy,1086 duration: 5*duration,1087 on_complete: ()=>{1088 let c = corners[index(-1,0)]1089 c.tl.setFrame(12)1090 c.tr.setFrame(13)1091 c.bl.setFrame(20)1092 c.br.setFrame(21)1093 1094 c = corners[index(0,0)]1095 c.tl.setFrame(13)1096 c.tr.setFrame(14)1097 c.bl.setFrame(17)1098 c.br.setFrame(18)1099 1100 c = corners[index(0,1)]1101 c.tl.setFrame(16)1102 c.tr.setFrame(18)1103 c.bl.setFrame(20)1104 c.br.setFrame(22)1105 }1106 },1107 {1108 targets: mouse,1109 on_complete: function(){1110 container.destroy()1111 anims['Click and Drag'].create(scene)1112 }1113 }1114 1115 ]1116 1117 tweens.forEach((tween, i) => {1118 ...

Full Screen

Full Screen

Player.js

Source:Player.js Github

copy

Full Screen

...66 case 'LSS':67 // Move Player68 this.move(game.dropZones[0].data.get('action') === 'R' ? 'RIGHT': 'LEFT')69 // Turn on indicators70 game.instructions[game.dropZones[0].data.get('action') === 'R' ? 0: 1].setFrame(1)71 // Stop player and turn off indicators72 timeOne = setTimeout(() => { 73 game.instructions[game.dropZones[0].data.get('action') === 'R' ? 0: 1].setFrame(0); 74 game.lights[1].setFrame(1) 75 this.move('STOP')76 }, 500)77 timeTwo = setTimeout(() => { 78 game.lights[1].setFrame(0)79 game.lights[2].setFrame(1)80 }, 1500)81 timeThree = setTimeout(() => { game.lights[2].setFrame(0) }, 2500)82 break83 84 case 'SSR':85 case 'SSL':86 game.lights[0].setFrame(1)87 timeOne = setTimeout(() => { 88 game.lights[0].setFrame(0); 89 game.lights[1].setFrame(1)90 }, 1000)91 timeTwo = setTimeout(() => { 92 this.move(game.dropZones[2].data.get('action') === 'R' ? 'RIGHT': 'LEFT')93 game.instructions[game.dropZones[2].data.get('action') === 'R' ? 0: 1].setFrame(1)94 game.lights[1].setFrame(0) 95 }, 2000)96 timeThree = setTimeout(() => { 97 game.instructions[game.dropZones[2].data.get('action') === 'R' ? 0: 1].setFrame(0) 98 this.move('STOP')99 }, 2500)100 break101 case 'SRS':102 case 'SLS':103 game.lights[0].setFrame(1)104 timeOne = setTimeout(() => { 105 game.lights[0].setFrame(0) 106 game.instructions[game.dropZones[1].data.get('action') === 'R' ? 0: 1].setFrame(1)107 this.move(game.dropZones[1].data.get('action') === 'R' ? 'RIGHT': 'LEFT')108 }, 1000)109 timeTwo = setTimeout(() => { 110 game.instructions[game.dropZones[1].data.get('action') === 'R' ? 0: 1].setFrame(0)111 game.lights[2].setFrame(1) 112 this.move('STOP')113 }, 1500)114 timeThree = setTimeout(() => { game.lights[2].setFrame(0) }, 2500)115 break116 case 'LRS':117 case 'RLS':118 // Move Player119 this.move(game.dropZones[0].data.get('action') === 'R' ? 'RIGHT': 'LEFT')120 // Turn on indicators121 game.instructions[game.dropZones[0].data.get('action') === 'R' ? 0: 1].setFrame(1)122 // Stop player and turn off indicators123 timeOne = setTimeout(() => { 124 game.instructions[game.dropZones[0].data.get('action') === 'R' ? 0: 1].setFrame(0)125 game.instructions[game.dropZones[1].data.get('action') === 'R' ? 0: 1].setFrame(1) 126 this.move(game.dropZones[1].data.get('action') === 'R' ? 'RIGHT': 'LEFT')127 }, 500)128 timeTwo = setTimeout(() => { 129 game.instructions[game.dropZones[1].data.get('action') === 'R' ? 0: 1].setFrame(0)130 game.lights[2].setFrame(1) 131 this.move('STOP')132 }, 1000)133 timeThree = setTimeout(() => { game.lights[2].setFrame(0) }, 2500)134 break135 case 'SLR':136 case 'SRL':137 game.lights[0].setFrame(1)138 timeOne = setTimeout(() => { 139 game.lights[0].setFrame(0) 140 game.instructions[game.dropZones[1].data.get('action') === 'R' ? 0: 1].setFrame(1)141 this.move(game.dropZones[1].data.get('action') === 'R' ? 'RIGHT': 'LEFT')142 }, 1500)143 timeTwo = setTimeout(() => { 144 game.instructions[game.dropZones[1].data.get('action') === 'R' ? 0: 1].setFrame(0)145 game.instructions[game.dropZones[2].data.get('action') === 'R' ? 0: 1].setFrame(1) 146 this.move(game.dropZones[2].data.get('action') === 'R' ? 'RIGHT': 'LEFT')147 }, 2000)148 timeThree = setTimeout(() => { 149 game.instructions[game.dropZones[2].data.get('action') === 'R' ? 0: 1].setFrame(0) 150 this.move('STOP')151 }, 2500)152 break153 case 'LSR':154 case 'RSL':155 // Move Player156 this.move(game.dropZones[0].data.get('action') === 'R' ? 'RIGHT': 'LEFT')157 // Turn on indicators158 game.instructions[game.dropZones[0].data.get('action') === 'R' ? 0: 1].setFrame(1)159 // Stop player and turn off indicators160 timeOne = setTimeout(() => { 161 game.instructions[game.dropZones[0].data.get('action') === 'R' ? 0: 1].setFrame(0)162 game.lights[1].setFrame(1) 163 this.move('STOP')164 }, 500)165 timeTwo = setTimeout(() => { 166 game.lights[1].setFrame(0) 167 game.instructions[game.dropZones[2].data.get('action') === 'R' ? 0: 1].setFrame(1)168 this.move(game.dropZones[2].data.get('action') === 'R' ? 'RIGHT': 'LEFT')169 }, 1500)170 timeThree = setTimeout(() => { 171 game.instructions[game.dropZones[2].data.get('action') === 'R' ? 0: 1].setFrame(0) 172 this.move('STOP')173 }, 2000)174 break175 case 'RJS':176 case 'LJS':177 // Move Player178 this.data.values.speed = 350179 this.data.values.jumpSpeed = 620180 this.move(game.dropZones[0].data.get('action') === 'R' ? 'RIGHT': 'LEFT')181 this.move('JUMP')182 // Turn on indicators183 game.instructions[game.dropZones[0].data.get('action') === 'R' ? 0: 1].setFrame(1)184 game.instructions[2].setFrame(1)185 // Stop player and turn off indicators186 timeOne = setTimeout(() => { game.instructions[game.dropZones[0].data.get('action') === 'R' ? 0: 1].setFrame(0) }, 500)187 timeTwo = setTimeout(() => { this.move('STOP') ; game.instructions[2].setFrame(0) ; game.lights[2].setFrame(1) }, 1000)188 timeThree = setTimeout(() => { game.lights[2].setFrame(0) }, 2000)189 break190 case 'SRJ':191 case 'SLJ':192 this.data.values.speed = 350193 this.data.values.jumpSpeed = 620194 game.lights[0].setFrame(1)195 timeOne = setTimeout(() => { 196 game.lights[0].setFrame(0)197 game.instructions[game.dropZones[1].data.get('action') === 'R' ? 0: 1].setFrame(1)198 game.instructions[2].setFrame(1) 199 this.move(game.dropZones[1].data.get('action') === 'R' ? 'RIGHT': 'LEFT')200 this.move('JUMP')201 }, 1000)202 timeTwo = setTimeout(() => { game.instructions[game.dropZones[1].data.get('action') === 'R' ? 0: 1].setFrame(0) }, 1500)203 timeThree = setTimeout(() => { this.move('STOP') ; game.instructions[2].setFrame(0) }, 2000)204 break205 case 'JSS':206 // Move Player207 this.move('JUMP')208 // Turn on indicators209 game.instructions[2].setFrame(1)210 // Stop player and turn off indicators211 timeOne = setTimeout(() => { this.move('STOP'); game.instructions[2].setFrame(0); game.lights[1].setFrame(1) }, 1000)212 timeTwo = setTimeout(() => { game.lights[1].setFrame(0); game.lights[2].setFrame(1) }, 1800)213 timeThree = setTimeout(() => { game.lights[2].setFrame(0) }, 2300)214 break215 case 'SJS':216 game.lights[0].setFrame(1)217 timeOne = setTimeout(() => { this.move('JUMP'); game.instructions[2].setFrame(1); game.lights[0].setFrame(0) }, 1000)218 timeTwo = setTimeout(() => { this.move('STOP'); game.instructions[2].setFrame(0); game.lights[2].setFrame(1) }, 2000)219 timeThree = setTimeout(() => { game.lights[2].setFrame(0) }, 3000)220 break221 case 'SSJ':222 game.lights[0].setFrame(1)223 timeOne = setTimeout(() => { game.lights[0].setFrame(0); game.lights[1].setFrame(0) }, 1000)224 timeTwo = setTimeout(() => { this.move('JUMP'); game.instructions[2].setFrame(1); game.lights[2].setFrame(0) }, 2000)225 timeThree = setTimeout(() => { this.move('STOP'); game.instructions[2].setFrame(0) }, 3000)226 break227 228 case 'JLS':229 case 'JRS':230 // Move Player231 this.move('JUMP_SHORT')232 // Turn on indicators233 game.instructions[2].setFrame(1)234 // Stop player and turn off indicators235 timeOne = setTimeout(() => { 236 game.instructions[game.dropZones[1].data.get('action') === 'R' ? 0: 1].setFrame(1) 237 this.move((game.dropZones[1].data.get('action') === 'R' ? 'RIGHT': 'LEFT') + '_SHORT') 238 }, 500)239 timeTwo = setTimeout(() => { 240 game.instructions[2].setFrame(0)241 game.instructions[game.dropZones[1].data.get('action') === 'R' ? 0: 1].setFrame(0)242 game.lights[2].setFrame(1) 243 this.move('STOP')244 }, 1000)245 timeThree = setTimeout(() => { game.lights[2].setFrame(0) }, 2000)246 break247 case 'SJL':248 case 'SJR':249 game.lights[0].setFrame(1)250 timeOne = setTimeout(() => { 251 game.instructions[2].setFrame(1)252 game.lights[0].setFrame(0) 253 this.move('JUMP_SHORT')254 }, 1000)255 timeTwo = setTimeout(() => { 256 game.instructions[game.dropZones[2].data.get('action') === 'R' ? 0: 1].setFrame(1) 257 this.move((game.dropZones[2].data.get('action') === 'R' ? 'RIGHT': 'LEFT') + '_SHORT')258 }, 1500)259 timeThree = setTimeout(() => { 260 game.instructions[2].setFrame(0)261 game.instructions[game.dropZones[2].data.get('action') === 'R' ? 0: 1].setFrame(0) 262 this.move('STOP')263 }, 2000)264 break265 case 'JSL':266 case 'JSR':267 // Move Player268 this.move('JUMP')269 // Turn on indicators270 game.instructions[2].setFrame(1)271 // Stop player and turn off indicators272 timeOne = setTimeout(() => { 273 game.instructions[2].setFrame(0); 274 game.lights[1].setFrame(1) 275 this.move('STOP')276 }, 1000)277 timeTwo = setTimeout(() => { 278 game.lights[1].setFrame(0)279 game.lights[2].setFrame(1)280 game.instructions[game.dropZones[2].data.get('action') === 'R' ? 0: 1].setFrame(1) 281 this.move(game.dropZones[2].data.get('action') === 'R' ? 'RIGHT': 'LEFT')282 }, 2000)283 timeThree = setTimeout(() => { 284 game.instructions[game.dropZones[2].data.get('action') === 'R' ? 0: 1].setFrame(0) 285 this.move('STOP')286 }, 2500)287 break288 case 'JLR':289 case 'JRL':290 // Move Player291 this.move('JUMP_SHORT')292 // Turn on indicators293 game.instructions[2].setFrame(1)294 // Stop player and turn off indicators295 timeOne = setTimeout(() => { 296 game.instructions[game.dropZones[1].data.get('action') === 'R' ? 0: 1].setFrame(1) 297 this.move((game.dropZones[1].data.get('action') === 'R' ? 'RIGHT': 'LEFT') + '_SHORT') 298 }, 500)299 timeTwo = setTimeout(() => { 300 game.instructions[2].setFrame(0)301 game.instructions[game.dropZones[1].data.get('action') === 'R' ? 0: 1].setFrame(0)302 game.instructions[game.dropZones[2].data.get('action') === 'R' ? 0: 1].setFrame(1) 303 this.move(game.dropZones[2].data.get('action') === 'R' ? 'RIGHT': 'LEFT')304 }, 1000)305 timeThree = setTimeout(() => { 306 game.instructions[game.dropZones[2].data.get('action') === 'R' ? 0: 1].setFrame(0) 307 this.move('STOP')308 }, 1500)309 break310 case 'LRJ':311 case 'RLJ':312 // Move Player313 this.move(game.dropZones[0].data.get('action') === 'R' ? 'RIGHT': 'LEFT')314 // Turn on indicators315 game.instructions[game.dropZones[0].data.get('action') === 'R' ? 0: 1].setFrame(1)316 // Stop player and turn off indicators317 timeOne = setTimeout(() => { 318 game.instructions[game.dropZones[0].data.get('action') === 'R' ? 0: 1].setFrame(0)319 game.instructions[game.dropZones[1].data.get('action') === 'R' ? 0: 1].setFrame(1) 320 game.instructions[2].setFrame(1)321 // Move Player322 this.data.values.speed = 350323 this.data.values.jumpSpeed = 620324 this.move(game.dropZones[1].data.get('action') === 'R' ? 'RIGHT': 'LEFT')325 this.move('JUMP') 326 }, 500)327 timeTwo = setTimeout(() => { 328 game.instructions[game.dropZones[1].data.get('action') === 'R' ? 0: 1].setFrame(0)329 game.instructions[2].setFrame(0)330 this.move('STOP')331 }, 1500)332 break333 case 'LJR':334 case 'RJL':335 // Move Player336 this.data.values.speed = 350337 this.data.values.jumpSpeed = 620338 this.move(game.dropZones[0].data.get('action') === 'R' ? 'RIGHT': 'LEFT')339 this.move('JUMP')340 // Turn on indicators341 game.instructions[game.dropZones[0].data.get('action') === 'R' ? 0: 1].setFrame(1)342 game.instructions[2].setFrame(1)343 // Stop player and turn off indicators344 timeOne = setTimeout(() => { 345 game.instructions[game.dropZones[0].data.get('action') === 'R' ? 0: 1].setFrame(0) 346 }, 500)347 timeTwo = setTimeout(() => { 348 game.instructions[2].setFrame(0)349 game.instructions[game.dropZones[2].data.get('action') === 'R' ? 0: 1].setFrame(1)350 this.move(game.dropZones[2].data.get('action') === 'R' ? 'RIGHT': 'LEFT')351 }, 1000)352 timeThree = setTimeout(() => { 353 game.instructions[game.dropZones[2].data.get('action') === 'R' ? 0: 1].setFrame(1)354 this.move('STOP')355 }, 1500)356 break357 }358 }359 stopTimerPlayer(){360 clearTimeout(timeOne)361 clearTimeout(timeTwo)362 clearTimeout(timeThree)363 }...

Full Screen

Full Screen

menu.js

Source:menu.js Github

copy

Full Screen

...48 this.im49 50 var sfxClick = false;51 var musicClick = false;52 this.sfxButton = this.add.sprite(gameW/ 1.45, gameH/1.5, 'sfx').setFrame(0).setScale(0.7).setInteractive().on('pointerover', function(){53 54 }).on('pointerdown', function(event){55 56 if(sfxClick == false){57 this.sfxButton.setFrame(1);58 this.buttonClick.setMute(true);59 sfxClick = true;60 }else{61 this.sfxButton.setFrame(0);62 this.buttonClick.setMute(false);63 sfxClick = false;64 }65 66 67 }, this).on('pointerup', function(){68 69 }).on('pointerout', function(){70 71 });7273 this.input.keyboard.on('keydown-N', ()=>{7475 if(sfxClick == false){76 this.sfxButton.setFrame(1);77 this.buttonClick.setMute(true);78 sfxClick = true;79 }else{80 this.sfxButton.setFrame(0);81 this.buttonClick.setMute(false);82 sfxClick = false;83 }84 }, this);8586 this.musicButton = this.add.sprite(gameW/ 1.45, gameH/2.1, 'musicButton').setFrame(0).setScale(0.7).setInteractive().on('pointerover', function(){87 88 }).on('pointerdown', function(event){89 if(musicClick == false){90 this.musicButton.setFrame(1);91 // this.lobbymusic.setMute(true);92 musicClick = true;93 }else{94 this.musicButton.setFrame(0);95 // this.lobbymusic.setMute(false);96 musicClick = false;97 }98 99 }, this).on('pointerup', function(){100 101 }).on('pointerout', function(){102 103 });104105 this.input.keyboard.on('keydown-M', ()=>{106107 if(musicClick == false){108 this.musicButton.setFrame(1);109 // this.lobbymusic.setMute(true);110 musicClick = true;111 }else{112 this.musicButton.setFrame(0);113 // this.lobbymusic.setMute(false);114 musicClick = false;115 }116117 }, this);118119 console.log(this.initMusic, this.initSFX);120121 if(this.initSFX == true){122 this.sfxButton.setFrame(1);123 sfxClick = true;124 this.buttonClick.setMute(this.initSFX);125 };126 if(this.initMusic == true){127 this.musicButton.setFrame(1);128 musicClick = true;129 // this.lobbymusic.setMute(this.initMusic);130 };131 132133134135 this.default = this.add.sprite(gameW/2.2, gameH * 0.10, 'default').setScale(0.7).setInteractive().on('pointerover', function(){136 this.setFrame(0);137 }).on('pointerdown', function(event){138 this.default.setFrame(0);139 if(this.anime != null){140 this.anime.setFrame(1);141 }142 mode = 'default';143 if(this.buttonClick != null){144 this.buttonClick.play();145 };146 147 if(difficulty == 'easy'){148 this.easy.setFrame(0);149 }else{150 this.easy.setFrame(1);151 };152153 if(difficulty == 'normal'){154 this.normal.setFrame(0);155 }else{156 this.normal.setFrame(1);157 };158159 if(difficulty == 'hard'){160 this.hard.setFrame(0);161 }else{162 this.hard.setFrame(1);163 };164165 console.log(mode);166 }, this).on('pointerup', function(){167 this.setFrame(0);168 if(this.buttonClick != null){169 this.buttonClick.play();170 };171 }).on('pointerout', function(){172 if(mode != 'default'){173 this.setFrame(1);174 }175 });176177 this.anime = this.add.sprite(gameW/1.8, gameH * 0.10, 'anime').setScale(0.7).setFrame(1).setInteractive().on('pointerover', function(){178 this.setFrame(0);179 }).on('pointerdown', function(event){180 this.anime.setFrame(0);181 this.default.setFrame(1);182 mode = 'anime';183 if(this.buttonClick != null){184 this.buttonClick.play();185 };186 if(difficulty == 'easy'){187 this.easy.setFrame(2);188 }else{189 this.easy.setFrame(3);190 };191192 if(difficulty == 'normal'){193 this.normal.setFrame(2);194 }else{195 this.normal.setFrame(3);196 };197198 if(difficulty == 'hard'){199 this.hard.setFrame(2);200 }else{201 this.hard.setFrame(3);202 };203204 console.log(mode);205 }, this).on('pointerup', function(){206 this.setFrame(0);207 if(this.buttonClick != null){208 this.buttonClick.play();209 };210 }).on('pointerout', function(){211 if(mode != 'anime'){212 this.setFrame(1);213 }214 });215216 this.easy = this.add.sprite(gameW/2.5, gameH*0.3, 'easy').setScale(0.3).setInteractive().on('pointerover', function(){217 if(mode == 'default'){218 this.setFrame(0);219 }else{220 this.setFrame(2);221 };222 223 }).on('pointerdown', function(event){224 if(mode == 'default'){225 this.easy.setFrame(0);226 }else{227 this.easy.setFrame(2);228 };229 if(this.buttonClick != null){230 this.buttonClick.play();231 };232 // if(this.anime != null){233 // this.anime.setFrame(1);234 // }235 difficulty = 'easy';236237 if(mode == 'default'){238 this.normal.setFrame(1);239 }else{240 this.normal.setFrame(3);241 };242243 if(mode == 'default'){244 this.hard.setFrame(1);245 }else{246 this.hard.setFrame(3);247 };248249 console.log(difficulty);250 }, this).on('pointerup', function(){251 if(this.buttonClick != null){252 this.buttonClick.play();253 };254 if(mode == 'default'){255 this.setFrame(0);256 }else{257 this.setFrame(2);258 };259 }).on('pointerout', function(){260 if(difficulty != 'easy'){261 if(mode == 'default'){262 this.setFrame(1);263 }else{264 this.setFrame(3);265 };266 }267 });268269 if(mode == 'default'){270 this.easy.setFrame(1);271 }else{272 this.easy.setFrame(3);273 };274275 this.normal = this.add.sprite(gameW/2, gameH*0.3, 'normal').setScale(0.3).setInteractive().on('pointerover', function(){276 if(mode == 'default'){277 this.setFrame(0);278 }else{279 this.setFrame(2);280 };281 282 }).on('pointerdown', function(event){283 if(this.buttonClick != null){284 this.buttonClick.play();285 };286 if(mode == 'default'){287 this.normal.setFrame(0);288 }else{289 this.normal.setFrame(2);290 };291 if(mode == 'default'){292 this.easy.setFrame(1);293 }else{294 this.easy.setFrame(3);295 };296297 if(mode == 'default'){298 this.hard.setFrame(1);299 }else{300 this.hard.setFrame(3);301 };302303 difficulty = 'normal';304 console.log(difficulty);305 }, this).on('pointerup', function(){306 if(this.buttonClick != null){307 this.buttonClick.play();308 };309 if(mode == 'default'){310 this.setFrame(0);311 }else{312 this.setFrame(2);313 };314 }).on('pointerout', function(){315 if(difficulty != 'normal'){316 if(mode == 'default'){317 this.setFrame(1);318 }else{319 this.setFrame(3);320 };321 }322 });323324 if(mode == 'default'){325 this.normal.setFrame(0);326 }else{327 this.normal.setFrame(2);328 };329330 this.hard = this.add.sprite(gameW/ 1.665, gameH*0.3, 'hard').setScale(0.3).setInteractive().on('pointerover', function(){331 if(mode == 'default'){332 this.setFrame(0);333 }else{334 this.setFrame(2);335 };336 337 }).on('pointerdown', function(event){338 if(this.buttonClick != null){339 this.buttonClick.play();340 };341 if(mode == 'default'){342 this.hard.setFrame(0);343 }else{344 this.hard.setFrame(2);345 };346 // if(this.anime != null){347 // this.anime.setFrame(1);348 // }349 difficulty = 'hard';350351 if(mode == 'default'){352 this.normal.setFrame(1);353 }else{354 this.normal.setFrame(3);355 };356357 if(mode == 'default'){358 this.easy.setFrame(1);359 }else{360 this.easy.setFrame(3);361 };362363 console.log(difficulty);364 }, this).on('pointerup', function(){365 if(this.buttonClick != null){366 this.buttonClick.play();367 };368 if(mode == 'default'){369 this.setFrame(0);370 }else{371 this.setFrame(2);372 };373 }).on('pointerout', function(){374 if(difficulty != 'hard'){375 if(mode == 'default'){376 this.setFrame(1);377 }else{378 this.setFrame(3);379 };380 }381 });382383 if(mode == 'default'){384 this.hard.setFrame(1);385 }else{386 this.hard.setFrame(3);387 };388389 this.start = this.add.sprite(gameW/2, gameH * 0.9, 'start').setScale(0.7).setFrame(0).setInteractive().on('pointerover', function(){390 this.setFrame(1);391 }).on('pointerdown', function(event){392 this.start.setFrame(1);393 394 // this.cache.audio.remove('lobby');395 if(this.buttonClick != null){396 this.buttonClick.play();397 };398 399 let info = [mode, difficulty, sfxClick, musicClick];400 var timedEvent = this.time.delayedCall(1500, ()=>{401 402 this.scene.restart('Play');403 404 this.scene.start('Play', info);405 // Play.textures.remove('board');406 } , [], this);407408 }, this).on('pointerup', function(){409 this.setFrame(0);410 }).on('pointerout', function(){411412 this.setFrame(0);413 });414415 416 };417418 update(){419420 421 };422};423424425var Pause = new Phaser.Class({426 ...

Full Screen

Full Screen

polyfill-spec.js

Source:polyfill-spec.js Github

copy

Full Screen

...33 unmatchedCount = 034 matchedResults = []35 unmatchedResults = []36 }37 function setFrame(size, timeoutAmount) {38 runs(function() {39 reset()40 iframe.width = size41 // timeoutAmount must be longer than the window.resize debounce42 // time in order for the tests to work in old browsers43 waits(timeoutAmount || 125)44 })45 }46 function createPolyfill(o) {47 runs(function() {48 o || (o = options)49 reset()50 polyfill = Polyfill(o)51 .doMatched(doMatched)52 .undoUnmatched(undoUnmatched)53 waitsFor(function() { return matchedCount > 0 })54 })55 }56 beforeEach(function() {57 reset()58 // Hide scroll bars to be safe. They're different widths59 // in different browsers, which affects our measurements60 document.documentElement.style.overflow = "hidden"61 })62 afterEach(function() {63 polyfill && polyfill.destroy()64 iframe.width = "100%"65 document.documentElement.style.overflow = "auto"66 })67 describe("options:", function() {68 it("defaults to downloading all stylesheets (expect print stylesheets) if no options are passed", function() {69 createPolyfill({declarations: ["prop:*"]}, {})70 runs(function() {71 expect(polyfill._stylesheets.length).toBe(12)72 })73 })74 it("can exlude certain stylesheets from being downloaded", function() {75 createPolyfill({76 exclude:["exclude-test1", "exclude-test2"],77 keywords: {78 declarations: ["prop:*"]79 }80 })81 runs(function() {82 expect(polyfill._stylesheets.length).toBe(10)83 })84 })85 it("can limit the downloads to only included stylesheets", function() {86 createPolyfill({87 include:["include-test1", "include-test2"],88 keywords: {89 declarations: ["prop:*"]90 }91 })92 runs(function() {93 expect(polyfill._stylesheets.length).toBe(2)94 })95 })96 it("can filter rules by selector keywords", function() {97 createPolyfill({98 include: ["filter-test"],99 keywords: {100 selectors:[":nth-of-type", ".flex"]101 }102 })103 runs(function() {104 expect(polyfill._filteredRules.length).toBe(3)105 expect(polyfill._filteredRules[0].selectors).toEqual(["p:nth-of-type(2n-1)", "pre:last-child", "code"])106 expect(polyfill._filteredRules[1].selectors).toEqual([".flex"])107 expect(polyfill._filteredRules[2].selectors).toEqual([".flex"])108 })109 })110 it("can filter rules by declaration keywords", function() {111 createPolyfill({112 include: ["filter-test"],113 keywords: {114 declarations:["display:*flex", "*flex:*"]115 }116 })117 runs(function() {118 expect(polyfill._filteredRules.length).toBe(2)119 expect(polyfill._filteredRules[0].declarations).toEqual([120 {property: "display", value:"-webkit-flex"},121 {property: "foo", value:"bar"}122 ])123 expect(polyfill._filteredRules[1].declarations).toEqual([124 {property: "-webkit-flex", value:"0 0 auto"}125 ])126 })127 })128 it("includes stylesheet media attributes in each filtered rule's media list", function() {129 createPolyfill({130 include: ["media-test"],131 keywords: {132 declarations:["*:*"]133 }134 })135 runs(function() {136 expect(polyfill._filteredRules.length).toBe(1)137 expect(polyfill._filteredRules[0].media).toEqual(["max-width: 800px"])138 })139 })140 it("ignores stylesheets with a `print` media attribute", function() {141 createPolyfill({142 include: ["media-test", "media-print-test"],143 keywords: {144 declarations:["*:*"]145 }146 })147 runs(function() {148 expect(polyfill._filteredRules.length).toBe(1)149 expect(polyfill._filteredRules[0].selectors).toEqual(["#media"])150 })151 })152 it("ignores `all` and `screen` media attributes", function() {153 createPolyfill({154 include: ["media-screen-test", "media-all-test"],155 keywords: {156 declarations:["*:*"]157 }158 })159 runs(function() {160 expect(polyfill._filteredRules.length).toBe(2)161 expect(polyfill._filteredRules[0].media).not.toBeDefined()162 expect(polyfill._filteredRules[1].media).not.toBeDefined()163 })164 })165 it("ignores stylesheets from external domains", function() {166 createPolyfill({167 include: ["media-test", "external-domain"],168 keywords: {169 declarations:["*:*"]170 }171 })172 runs(function() {173 expect(polyfill._filteredRules.length).toBe(1)174 expect(polyfill._filteredRules[0].selectors).toEqual(["#media"])175 })176 })177 })178 describe("getCurrentMatches()", function() {179 it("returns a Ruleset object containing all rules that match the current media", function() {180 setFrame(200)181 runs(function() {182 polyfill = Polyfill(options)183 .doMatched(doMatched)184 .undoUnmatched(undoUnmatched)185 waitsFor(function() { return matchedCount > 0 })186 })187 setFrame(800)188 runs(function() {189 var matches = polyfill.getCurrentMatches()190 expect(matches.size()).toBe(3)191 expect(matches.at(0).getDeclaration()).toEqual({"foo": "bar"})192 expect(matches.at(1).getDeclaration()).toEqual({"bar": "foo"})193 expect(matches.at(2).getDeclaration()).toEqual({"prop": "one"})194 polyfill.destroy()195 })196 })197 })198 describe("A single polyfill instance:", function() {199 function createPolyfill() {200 runs(function() {201 polyfill = Polyfill(options)202 .doMatched(doMatched)203 .undoUnmatched(undoUnmatched)204 waitsFor(function() { return matchedCount > 0 })205 })206 }207 afterEach(function() {208 polyfill && polyfill.destroy()209 polyfill = null210 })211 it("can create a new Polyfill instance with all the correct properties", function() {212 createPolyfill()213 runs(function() {214 expect(polyfill._options).toBeDefined()215 expect(polyfill._stylesheets).toBeDefined()216 expect(polyfill._filteredRules).toBeDefined()217 expect(polyfill._mediaQueryMap).toBeDefined()218 expect(polyfill._promise).toBeDefined()219 expect(polyfill._doMatched).toBeDefined()220 expect(polyfill._undoUnmatched).toBeDefined()221 })222 })223 it("initially returns a list of rules that match the passed keywords", function() {224 setFrame(300)225 createPolyfill()226 runs(function() {227 expect(matchedCount).toBe(1)228 expect(unmatchedCount).toBe(0)229 expect(matchedResults[0].matched.size()).toBe(2)230 })231 })232 it("sends new matches when the media changes", function() {233 setFrame(500)234 createPolyfill()235 setFrame(800)236 runs(function() {237 expect(matchedCount).toBe(1)238 expect(unmatchedCount).toBe(0)239 expect(matchedResults[0].matched.size()).toBe(2)240 expect(matchedResults[0].matched.at(0).getMedia()).toEqual("(min-width: 40em)")241 })242 })243 it("sends matches that previously matched but no longer do when the media changes", function() {244 setFrame(500)245 createPolyfill()246 setFrame(800)247 setFrame(200)248 runs(function() {249 expect(matchedCount).toBe(1)250 expect(unmatchedCount).toBe(1)251 expect(unmatchedResults[0].unmatched.size()).toBe(2)252 expect(unmatchedResults[0].unmatched.at(0).getMedia()).toEqual("(min-width: 40em)")253 expect(matchedResults[0].matched.size()).toBe(1)254 expect(matchedResults[0].matched.at(0).getMedia()).toEqual("(max-width: 30em)")255 })256 })257 it("doesn't send matches on window.resize if the matched media hasn't changed", function() {258 setFrame(500)259 createPolyfill()260 setFrame(550)261 runs(function() {262 expect(matchedCount).toBe(0)263 expect(unmatchedCount).toBe(0)264 })265 })266 it("can destroy itself and remove any attached event listeners", function() {267 setFrame(300)268 createPolyfill()269 runs(function() {270 polyfill.destroy()271 })272 setFrame(900)273 runs(function() {274 expect(matchedCount).toBe(0)275 expect(unmatchedCount).toBe(0)276 })277 })278 })279 describe("Multiple polyfill instances:", function() {280 var polyfill1281 , polyfill2282 , polyfill3283 , options1 = {284 include: ["complex-test"],285 keywords: { declarations: ["foo:*"] }286 }287 , options2 = {288 include: ["complex-test"],289 keywords: { declarations: ["bar:*"] }290 }291 , options3 = {292 include: ["complex-test"],293 keywords: { declarations: ["fizz:*"] }294 }295 function createPolyfills() {296 runs(function() {297 polyfill1 = Polyfill(options1, options)298 .doMatched(doMatched)299 .undoUnmatched(undoUnmatched)300 polyfill2 = Polyfill(options2)301 .doMatched(doMatched)302 .undoUnmatched(undoUnmatched)303 polyfill3 = Polyfill(options3)304 .doMatched(doMatched)305 .undoUnmatched(undoUnmatched)306 waitsFor(function() { return matchedCount === 3 })307 })308 }309 afterEach(function() {310 polyfill1 && polyfill1.destroy()311 polyfill2 && polyfill2.destroy()312 polyfill3 && polyfill3.destroy()313 iframe.width = "100%"314 })315 it("can create new Polyfill instances with all the correct properties", function() {316 createPolyfills()317 runs(function() {318 // polyfill1319 expect(polyfill1._options).toBeDefined()320 expect(polyfill1._stylesheets).toBeDefined()321 expect(polyfill1._filteredRules).toBeDefined()322 expect(polyfill1._mediaQueryMap).toBeDefined()323 expect(polyfill1._promise).toBeDefined()324 expect(polyfill1._doMatched).toBeDefined()325 expect(polyfill1._undoUnmatched).toBeDefined()326 // polyfill2327 expect(polyfill2._options).toBeDefined()328 expect(polyfill2._stylesheets).toBeDefined()329 expect(polyfill2._filteredRules).toBeDefined()330 expect(polyfill2._mediaQueryMap).toBeDefined()331 expect(polyfill2._promise).toBeDefined()332 expect(polyfill2._doMatched).toBeDefined()333 expect(polyfill2._undoUnmatched).toBeDefined()334 // polyfill3335 expect(polyfill3._options).toBeDefined()336 expect(polyfill3._stylesheets).toBeDefined()337 expect(polyfill3._filteredRules).toBeDefined()338 expect(polyfill3._mediaQueryMap).toBeDefined()339 expect(polyfill3._promise).toBeDefined()340 expect(polyfill3._doMatched).toBeDefined()341 expect(polyfill3._undoUnmatched).toBeDefined()342 })343 })344 it("initially returns a list of rules that match the passed keywords", function() {345 setFrame(700)346 createPolyfills()347 runs(function() {348 expect(matchedCount).toBe(3)349 expect(unmatchedCount).toBe(0)350 // polyfill1351 expect(matchedResults[0].polyfill).toBe(polyfill1)352 expect(matchedResults[0].matched.size()).toBe(2)353 // polyfill2354 expect(matchedResults[1].polyfill).toBe(polyfill2)355 expect(matchedResults[1].matched.size()).toBe(0)356 // polyfill3357 expect(matchedResults[2].polyfill).toBe(polyfill3)358 expect(matchedResults[2].matched.size()).toBe(0)359 })360 })361 it("sends new matches when the media changes", function() {362 setFrame(700)363 createPolyfills()364 setFrame(450)365 runs(function() {366 expect(matchedCount).toBe(2)367 expect(unmatchedCount).toBe(0)368 // polyfill2369 expect(matchedResults[0].polyfill).toBe(polyfill2)370 expect(matchedResults[0].matched.size()).toBe(1)371 // polyfill3372 expect(matchedResults[1].polyfill).toBe(polyfill3)373 expect(matchedResults[1].matched.size()).toBe(1)374 })375 })376 it("sends matches that previously matched but no longer do when the media changes", function() {377 setFrame(700)378 createPolyfills()379 setFrame(450)380 setFrame(100)381 runs(function() {382 expect(matchedCount).toBe(1)383 expect(unmatchedCount).toBe(3)384 // polyfill1385 expect(unmatchedResults[0].polyfill).toBe(polyfill1)386 expect(unmatchedResults[0].unmatched.size()).toBe(1)387 expect(unmatchedResults[0].unmatched.at(0).getMedia()).toEqual("(min-width: 400px)")388 // polyfill2389 expect(matchedResults[0].polyfill).toBe(polyfill2)390 expect(matchedResults[0].matched.size()).toBe(1)391 expect(matchedResults[0].matched.at(0).getMedia()).toEqual("(max-width: 400px)")392 expect(unmatchedResults[1].polyfill).toBe(polyfill2)393 expect(unmatchedResults[1].unmatched.size()).toBe(1)394 expect(unmatchedResults[1].unmatched.at(0).getMedia()).toEqual("(min-width: 200px) and (max-width: 600px)")395 // polyfill3396 expect(unmatchedResults[2].polyfill).toBe(polyfill3)397 expect(unmatchedResults[2].unmatched.size()).toBe(1)398 expect(unmatchedResults[2].unmatched.at(0).getMedia()).toEqual("(min-width: 300px) and (max-width: 500px)")399 })400 })401 it("doesn't send matches on window.resize if the matched media hasn't changed", function() {402 setFrame(425)403 createPolyfills()404 setFrame(475)405 runs(function() {406 expect(matchedCount).toBe(0)407 expect(unmatchedCount).toBe(0)408 })409 })410 it("can destroy itself and remove any attached event listeners", function() {411 setFrame(450)412 createPolyfills()413 runs(function() {414 polyfill1.destroy()415 polyfill2.destroy()416 polyfill3.destroy()417 })418 setFrame(100)419 runs(function() {420 expect(matchedCount).toBe(0)421 expect(unmatchedCount).toBe(0)422 })423 })424 })...

Full Screen

Full Screen

SP_2_Character_Select.js

Source:SP_2_Character_Select.js Github

copy

Full Screen

...84 game.input.mouse.releasePointerLock();85 switch (this.index)86 {87 case 0:88 this.tomSelect.setFrame(0);89 this.harrySelect.setFrame(0);90 this.zoeySelect.setFrame(0);91 break;92 case 1:93 this.tomSelect.setFrame(1);94 this.harrySelect.setFrame(0);95 this.zoeySelect.setFrame(0);96 break;97 case 2:98 this.tomSelect.setFrame(0);99 this.harrySelect.setFrame(0);100 this.zoeySelect.setFrame(1);101 break;102 case 3:103 this.tomSelect.setFrame(0);104 this.harrySelect.setFrame(1);105 this.zoeySelect.setFrame(0);106 break;107 default:108 this.tomSelect.setFrame(0);109 this.harrySelect.setFrame(0);110 this.zoeySelect.setFrame(0);111 }112 if (this.phase>1)113 {114 switch (this.player1Chosen)115 {116 case 0:117 this.tomSelect.setFrame(2);118 break;119 case 1:120 this.tomSelect.setFrame(2);121 break;122 case 2:123 this.zoeySelect.setFrame(2);124 break;125 case 3:126 this.harrySelect.setFrame(2);127 break;128 default:129 this.tomSelect.setFrame(2);130 }131 }132 if (Phaser.Input.Keyboard.JustDown(this.pause))133 {134 this.scene.start("mainMenu");135 }136 if ((Phaser.Input.Keyboard.JustDown(this.playerInput[0].right)) || (Phaser.Input.Keyboard.JustDown(this.playerInput[1].right)))137 {138 if (this.index<3)139 {140 this.currentPos = this.index;141 this.index++;142 }143 else...

Full Screen

Full Screen

index.test.js

Source:index.test.js Github

copy

Full Screen

...9describe("SceneBuilder", () => {10 it("on setFrame, modified topics rendered", () => {11 const builder = new SceneBuilder();12 builder.setTopics([{ name: "a", datatype: "A" }]);13 builder.setFrame({ a: [] });14 expect(builder.topicsToRender).toContain("a");15 });16 it("on setFrame, only specified topics rendered", () => {17 const builder = new SceneBuilder();18 builder.setTopics([{ name: "a", datatype: "A" }]);19 builder.setFrame({ b: [] });20 expect(builder.topicsToRender.size).toBe(0);21 });22 it("on setFrame, same instance, nothing rendered", () => {23 const builder = new SceneBuilder();24 builder.setTopics([{ name: "a", datatype: "A" }]);25 const frame = { a: [] };26 builder.setFrame(frame);27 // check that we're set up properly with one topic rendered28 expect(builder.topicsToRender.size).toBe(1);29 builder.render();30 builder.setFrame(frame);31 expect(builder.topicsToRender.size).toBe(0);32 });33 it("on setFrame, same value different instance, topics rendered", () => {34 const builder = new SceneBuilder();35 builder.setTopics([{ name: "a", datatype: "A" }]);36 const frame1 = { a: [] };37 const frame2 = { a: [] };38 builder.setFrame(frame1);39 builder.render();40 builder.setFrame(frame2);41 expect(builder.topicsToRender.size).toBe(1);42 });43 it("on setFrame, latest value saved", () => {44 const builder = new SceneBuilder();45 builder.setTopics([{ name: "a", datatype: "A" }]);46 const messages1 = [];47 const messages2 = [];48 builder.setFrame({ a: messages1 });49 builder.setFrame({ a: messages2 });50 expect(builder.lastSeenMessages.a).not.toBe(messages1);51 expect(builder.lastSeenMessages.a).toBe(messages2);52 });53 it("on setFrame, messages are saved", () => {54 const builder = new SceneBuilder();55 const messagesValue = [];56 builder.setTopics([{ name: "a", datatype: "A" }]);57 builder.setFrame({ a: messagesValue });58 expect(builder.lastSeenMessages.a).toBe(messagesValue);59 });60 it("on setFrame, old messages not clobbered", () => {61 const builder = new SceneBuilder();62 const messagesValue = [];63 builder.setTopics([{ name: "a", datatype: "A" }, { name: "b", datatype: "B" }]);64 builder.setFrame({ a: messagesValue });65 builder.setFrame({ b: messagesValue });66 // a survives even though it's only included in the first setFrame67 expect(builder.lastSeenMessages.a).toBe(messagesValue);68 });69 it("on setFrame, unrendered messages saved", () => {70 const builder = new SceneBuilder();71 const messagesValue = [];72 builder.setTopics([{ name: "a", datatype: "A" }]);73 builder.setFrame({ b: messagesValue });74 expect("b" in builder.lastSeenMessages).toBe(true);75 });76 it("on render, topics to render cleared", () => {77 const builder = new SceneBuilder();78 builder.setTopics([{ name: "a", datatype: "A" }]);79 builder.setFrame({ a: [] });80 // to make sure we're set up right, check that one topic should be rendered81 expect(builder.topicsToRender.size).toBe(1);82 builder.render();83 expect(builder.topicsToRender.size).toBe(0);84 });...

Full Screen

Full Screen

site.js

Source:site.js Github

copy

Full Screen

...14 document.body.classList.remove('hg-frame--11');15 document.body.classList.remove('hg-frame--12');16 document.body.classList.remove('hg-frame--13');17 }18 function setFrame(frameClass) {19 clearFrames();20 document.body.classList.add(frameClass);21 }22 document.getElementsByClassName("hg-col--frame-1")[0].addEventListener("mouseenter", e => {23 setFrame('hg-frame--1');24 });25 document.getElementsByClassName("hg-col--frame-2")[0].addEventListener("mouseenter", e => {26 setFrame('hg-frame--2');27 });28 document.getElementsByClassName("hg-col--frame-3")[0].addEventListener("mouseenter", e => {29 setFrame('hg-frame--3');30 });31 document.getElementsByClassName("hg-col--frame-4")[0].addEventListener("mouseenter", e => {32 setFrame('hg-frame--4');33 });34 document.getElementsByClassName("hg-col--frame-5")[0].addEventListener("mouseenter", e => {35 setFrame('hg-frame--5');36 });37 document.getElementsByClassName("hg-col--frame-6")[0].addEventListener("mouseenter", e => {38 setFrame('hg-frame--6');39 });40 document.getElementsByClassName("hg-col--frame-7")[0].addEventListener("mouseenter", e => {41 setFrame('hg-frame--7');42 });43 document.getElementsByClassName("hg-col--frame-8")[0].addEventListener("mouseenter", e => {44 setFrame('hg-frame--8');45 });46 document.getElementsByClassName("hg-col--frame-9")[0].addEventListener("mouseenter", e => {47 setFrame('hg-frame--9');48 });49 document.getElementsByClassName("hg-col--frame-10")[0].addEventListener("mouseenter", e => {50 setFrame('hg-frame--10');51 });52 document.getElementsByClassName("hg-col--frame-11")[0].addEventListener("mouseenter", e => {53 setFrame('hg-frame--11');54 });55 document.getElementsByClassName("hg-col--frame-12")[0].addEventListener("mouseenter", e => {56 setFrame('hg-frame--12');57 });58 document.getElementsByClassName("hg-col--frame-13")[0].addEventListener("mouseenter", e => {59 setFrame('hg-frame--13');60 });...

Full Screen

Full Screen

JIT_localsAtNativeFrame2.js

Source:JIT_localsAtNativeFrame2.js Github

copy

Full Screen

...10 for (var i = 0; i < 100; i++) {11 a.push(i * 10.2);12 }1314 var sub = -10; /**bp:stack();locals();setFrame(1);locals();setFrame(2);locals();setFrame(3);locals();setFrame(4);locals();setFrame(5);locals();**/15 for (var i = 0; i < 100; i++) {16 a[i] -= sub;17 }18 return a.length;19}2021function F3(r) {22 return 2 * 3.14 * r;23}2425function F5() {26 var x = 20; 27 var y = {y1:1}; 28 var t1 = Math.abs(22.2);29 function F5_1(a) {30 eval('var z = x * y.y1;');31 var f6 = function () {32 var b1 = 10;33 var obj1 = {a1:2};34 obj4 = F3(obj1.a1);35 return b1 + F2();36 }37 f6();38 }39 F5_1(t1);40 return y;41}4243function F6(a,b) {44 (function () {45 var j = "Anonymous function2";46 F5();47 return j; /**bp:stack();locals();setFrame(1);locals();setFrame(2);locals();setFrame(3);locals();**/48 })();49}5051function F7(a1)52{53 var j = 10;54 var k = 20 * 1.34;55 var m = 20 + a1;56 function f2(b21, b22)57 {58 var j2 = arguments.length;59 var k2 = 10;60 function f3(c31,c32)61 {62 var a = 10;63 a++; /**bp:stack();locals();setFrame(1);locals();setFrame(2);locals();setFrame(3);locals();**/64 a++; 65 return c31+c32+a; 66 }67 68 function f32()69 {70 j;71 }72 f3();73 }74 75 f2(k);76}77 ...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1driver.executeScript("mobile: scroll", {"direction": "down"});2driver.executeScript("mobile: scroll", {"direction": "up"});3driver.executeScript("mobile: scroll", {"direction": "right"});4driver.executeScript("mobile: scroll", {"direction": "left"});5driver.executeScript("mobile: scroll", {"direction": "down", "element": "elementID"});6driver.executeScript("mobile: scroll", {"direction": "up", "element": "elementID"});7driver.executeScript("mobile: scroll", {"direction": "right", "element": "elementID"});8driver.executeScript("mobile: scroll", {"direction": "left", "element": "elementID"});9driver.executeScript("mobile: scroll", {"direction": "down", "element": "elementID", "name": "name"});10driver.executeScript("mobile: scroll", {"direction": "up", "element": "elementID", "name": "name"});11driver.executeScript("mobile: scroll", {"direction": "right", "element": "elementID", "name": "name"});12driver.executeScript("mobile: scroll", {"direction": "left", "element": "elementID", "name": "name"});13driver.executeScript("mobile: swipe", {"direction": "down"});14driver.executeScript("mobile: swipe", {"direction": "up"});15driver.executeScript("mobile: swipe", {"direction": "right"});16driver.executeScript("mobile: swipe", {"direction": "left"});17driver.executeScript("mobile: swipe", {"direction": "down", "element": "elementID"});18driver.executeScript("mobile: swipe", {"direction": "up", "element": "elementID"});19driver.executeScript("mobile: swipe", {"direction": "right", "element": "elementID"});20driver.executeScript("mobile: swipe", {"direction": "left", "element": "elementID"});21driver.executeScript("mobile: swipe", {"direction": "down", "element": "elementID", "name": "name"});22driver.executeScript("mobile: swipe", {"direction": "up", "element": "elementID", "name": "name"});23driver.executeScript("mobile: swipe", {"direction": "right", "element": "elementID", "name": "name"});24driver.executeScript("mobile: swipe", {"direction": "

Full Screen

Using AI Code Generation

copy

Full Screen

1var wd = require('wd');2var assert = require('assert');3var desired = {4};5var driver = wd.promiseChainRemote('localhost', 4723);6driver.init(desired).then(function() {7}).then(function() {8 return driver.setFrame('iframe1');9}).then(function() {10 return driver.elementById('i_am_an_id');11}).then(function(el) {12 return el.text();13}).then(function(text) {14 assert.ok(text === 'I am a div');15}).fin(function() { return driver.quit(); })16.done();17var wd = require('wd');18var assert = require('assert');19var desired = {20};21var driver = wd.promiseChainRemote('localhost', 4723);22driver.init(desired).then(function() {23}).then(function() {24 return driver.frame('iframe1');25}).then(function() {26 return driver.elementById('i_am_an_id');27}).then(function(el) {28 return el.text();29}).then(function(text) {30 assert.ok(text === 'I am a div');31}).fin(function() { return driver.quit(); })32.done();33var wd = require('wd');34var assert = require('assert');35var desired = {36};37var driver = wd.promiseChainRemote('localhost', 4723);38driver.init(desired).then(function() {39}).then(function() {40 return driver.frame('iframe1');41}).then(function() {42 return driver.elementById('i_am_an_id');43}).then(function(el) {44 return el.text();45}).then(function(text) {46 assert.ok(text === 'I am a div');47}).fin(function() { return driver.quit(); })48.done();49var wd = require('wd');50var assert = require('assert');51var desired = {52};

Full Screen

Using AI Code Generation

copy

Full Screen

1driver.setFrame("frame1");2driver.switchToFrame("frame1");3driver.switchToDefaultContent();4driver.switchToParentFrame();5driver.switchTo().frame("frame1");6driver.switchTo().defaultContent();7driver.switchTo().parentFrame();8driver.switchTo().window("window1");9driver.switchTo().defaultContent();10driver.switchTo().alert();11driver.switchTo().activeElement();12driver.switchTo().window("window1");13driver.switchTo().defaultContent();14driver.switchTo().alert();15driver.switchTo().activeElement();16driver.switchTo().window("window1");17driver.switchTo().defaultContent();18driver.switchTo().alert();19driver.switchTo().activeElement();20driver.switchTo().window("window1");21driver.switchTo().defaultContent();22driver.switchTo().alert();23driver.switchTo().activeElement();24driver.switchTo().window("window1");25driver.switchTo().defaultContent

Full Screen

Using AI Code Generation

copy

Full Screen

1var wd = require('wd');2var assert = require('assert');3var _ = require('underscore');4var path = require('path');5var fs = require('fs');6var base64Img = require('base64-img');7var im = require('imagemagick');8var request = require('request');9var gm = require('gm');10var q = require('q');11var desired = {12};13var driver = wd.promiseChainRemote("

Full Screen

Using AI Code Generation

copy

Full Screen

1describe('Test Appium', function() {2 it('should get the frame', function () {3 .frame('frame1')4 .frame('frame2')5 .frame('frame3')6 .frame('frame4')7 .frame('frame5')8 .frame('frame6')9 .frame('frame7')10 .frame('frame8')11 .frame('frame9')12 .frame('frame10')13 .frame('frame11')14 .frame('frame12')15 .frame('frame13')16 .frame('frame14')17 .frame('frame15')18 .frame('frame16')19 .frame('frame17')20 .frame('frame18')21 .frame('frame19')22 .frame('frame20')23 .frame('frame21')24 .frame('frame22')25 .frame('frame23')26 .frame('frame24')27 .frame('frame25')28 .frame('frame26')29 .frame('frame27')30 .frame('frame28')31 .frame('frame29')32 .frame('frame30')33 .frame('frame31')34 .frame('frame32')35 .frame('frame33')36 .frame('frame34')37 .frame('frame35')38 .frame('frame36')39 .frame('frame37')40 .frame('frame38')41 .frame('frame39')42 .frame('frame40')43 .frame('frame41')44 .frame('frame42')45 .frame('frame43')46 .frame('frame44')47 .frame('frame45')48 .frame('frame46')49 .frame('frame47')50 .frame('frame48')51 .frame('frame49')52 .frame('frame50')53 .frame('frame51')54 .frame('frame52')55 .frame('frame53')56 .frame('frame54')57 .frame('frame55')58 .frame('frame56')59 .frame('frame57')60 .frame('frame58')61 .frame('frame59')62 .frame('frame60')63 .frame('frame61')64 .frame('frame62')65 .frame('frame63')66 .frame('frame64')67 .frame('frame65')68 .frame('frame66')69 .frame('frame67')70 .frame('frame

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run Appium Base Driver automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful