ranska Posted December 16, 2014 Share Posted December 16, 2014 Hello,Since my game become complicate logic and i am fed up with replay my littel senario to see the change. I have start to implement karma.js/with jasmine on my project.I don't know if it's the way to do ? Because i came from the rails/angular world it look logical to me. So after lauching the test a chrome instance load and the game go to the first state,but it seem that asset load cause some issue. Did someone experiment a full scenario ( aka loading asset and move sprite, test some game logic).If you success you are a hero for me cause it look hard to do :ninja: Link to comment Share on other sites More sharing options...
eguneys Posted December 16, 2014 Share Posted December 16, 2014 I am interested in adding support for tests in https://github.com/eguneys/generator-phaserjs, but I don't know how to integrate with Phaser, I mean you can unit test your prefabs, or states but how would the integration tests be? Open a issue/PR if you would use it with my generator, then I would work on it. ranska 1 Link to comment Share on other sites More sharing options...
BdR Posted December 17, 2014 Share Posted December 17, 2014 Just curious, what do you mean with "replay a little scenario"? Do you mean for example something like starting a certain level and then walking to a certain spot and grabbing some item? Don't know how you would test something like that other than just running the game and trying it (and maybe temporarily change the code to force a certian scenario). Link to comment Share on other sites More sharing options...
ranska Posted December 17, 2014 Author Share Posted December 17, 2014 @BdR sur ! Exactly this is what you mean.In this caseGiven a reloaded de pageAnd i select option on the game And i launch level 1And i go a particular zone of the tile setAnd i do a specific actionThen i should see my sprite moving in a specific areaAnd other information are updated Of course i have some DEBUG and TEST conf for running my game in a specific configuration (start directly on test levels with specific conf).It's a good start, but testing it manually is still painful and i have no guaranty it work again after adding new features. And i can test son game logic without the full game (unit test)But in some case i really need the full game in order to see what append. And also it's so coooolll to see the game playing alone Currently i plan to try thishttps://github.com/s9tpepper/karma-cucumberjs maybe there is something more interesting ? Did you try it before ?It look like there some hot topic on github Link to comment Share on other sites More sharing options...
ranska Posted December 17, 2014 Author Share Posted December 17, 2014 I am interested in adding support for tests in https://github.com/eguneys/generator-phaserjs, but I don't know how to integrate with Phaser, I mean you can unit test your prefabs, or states but how would the integration tests be? Open a issue/PR if you would use it with my generator, then I would work on it.@eguneysGenerators ! There is a long time i want to learn create and use it.Currently i use http://middlemanapp.com/it's a ruby static website builder, with sprocket who work differently from requireJS but for similar purpose. I am really open to discus about it and how it can be use in combination with testing a game. Link to comment Share on other sites More sharing options...
kctang Posted February 11, 2015 Share Posted February 11, 2015 Hi guys, I am also trying to do something similar - trying to introduce some unit/functional testing to Phaser based game development so i know when i break things without manual testing. I managed to setup Karma to run a Jasmine test on Chrome where it creates a "new Phaser.Game()" successfully and asserts that create/update methods are called. The test has a State object does very simple create(), update() methods. Seems to be working so far (highly experimental). However, I realized that the test will ONLY work when the browser window is in the foreground/active! Otherwise, the state's create/update methods are not called. This kind of defeats the purpose of running tests in the "background". My guess is, Phaser's game creation object will look for browser window focus/foreground state or something before initializing the game. However, since my knowledge on Phaser is quite shallow... i do not know how to overcome this. Is there anyway I can easily get over this issue? Link to comment Share on other sites More sharing options...
ranska Posted May 10, 2015 Author Share Posted May 10, 2015 Hi,after few month i finally found free time,and starting to extract my test engin, from my last gamehttps://github.com/ranska/kaizer @kctangI am really intersted about what you say on karma and chrome (i am trying to do the same thing)the final goal to me is to run test on CI like travis ! @kctangYou can probably override the functionality who stop the game when it is in background... Link to comment Share on other sites More sharing options...
Recommended Posts