Jump to content

Nightwatch extension makes e2e testing Phaser games, possible!


hayesmaker
 Share

Recommended Posts

I'd just like to let other Phaser game devs know, that using Nightwatch and my new Nightwatch extension, you can now end to end test your phaser games.

It's early days for this Nightwatch extension, but you can test your states and that your game loads...  And calling

components in your game from the tests is going to be added in the next day or two.

 

I've been trying to work out how to get a decent e2e test suite into Canvas based games developed for the web, and think

this pretty much nails it.

 

If you like it, please feel free to try it.

 

https://www.npmjs.com/package/phase-2-e

Link to comment
Share on other sites

Testing might be useful in some cases, but for most games it will be very hard to do "end-to-end testing". End to end I guess means that you write the tests and it testes your entire game from start to finish, which for most games would actually mean implementing some sort of AI to play your game. So, other from simple test cases the can assert the loading of some files you will need to provide some examples like: "test that after the game is loaded and we click on the X button we see the Y sprite"

Link to comment
Share on other sites

You're half right. UI heavy games with many states, and complex boot ups are very good candidates for end-to-end tests.  But e2e doesn't mean end to end in the sense that the tests must act your entire game from start to finish.  Like with any front end testing, you'll get the most benefit from them if you focus on the most complex, error prone areas of your application.

 

And if you wanted to test some gameplay areas, then the thrust-engine example in the github shows that e2e testing of more arcade style games is entirely possible.

 

And DonFrag, if this is of no benefit to you, feel free to not use it :D

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...