Skip to content

Latest commit

 

History

History
181 lines (134 loc) · 7.88 KB

README.md

File metadata and controls

181 lines (134 loc) · 7.88 KB

phase-2-e

Custom Nightwatch extenstion for end to end testing CANVAS based HTML5 games written with Phaser.
Backed by Nightwatch and Selenium.

Add automation with TravisCI and Browserstack

Until now, e2e tests have mostly been the domain of RIA developers, websites and enterprise level applications, Absolutely no one is e2e testing Canvas based HTML5 games, beyond some rudimentary screenshot checking. Phase-2-e aims to change this state of affairs.

Nightwatch is probably the simplest, most flexible and powerful HTML e2e framework currently available... And it's pre-packed with many DOM specific commands and assertions which you can use in your HTML websites and applications. But how do you use a DOM specific API to test in CANVAS components and game scenarios? Well the answer is you can't, so these Phaser specific custom commands and assertions for Nightwatch have been written to help you join the cutting edge of Phaser game developers who are starting to realise the potential of e2e testing in games.

If you're currently using Phaser to write your HTML5 games, then you're in luck, you can use this set of Nightwatch custom assertion and commands, designed specifically for use with testing Phaser E2E!.

Getting the most out of E2E

You'll currently get the most benefit from these e2e tests IF:

  • Your game menus or gameplay is UI heavy - these are perfect areas for e2e testing.
  • Your UI elements (buttons etc) follow a common interface to be used by our custom commands. (If they don't you may create your own commands which can work with your UI components)
  • Your game is using Phaser.StateManager to manage the various states of your game.
  • Your game has complicated booting consisting of loading configs, externalised assets, and/or connections to servers or databases
  • Your game has well written loosley coupled modules
  • You're building your game with modules. (see Drawbacks).
  • You merely want to smoke test that your app starts, and want the ability to automate this on many platforms and browsers.

Drawbacks and how to overcome them.