AI Portfolio Lab Tools Games Blog Feedback
All Posts

26 Tests for a Game You Explain in 30 Seconds

Impostr started as a simple pass-the-phone party game. Adding online mode turned it into a distributed state machine with 26 automated tests.

2 min read
gamestestingplaywrightmultiplayerweb-development

Pass-the-phone party games have a dirty secret: they’re simple because the phone is stateless between players. You pass it, the next person taps in, the state resets. Nobody’s device is talking to anyone else’s. The coordination is the humans at the table, not the code.

I built Impostr on that principle. Everyone gets a word. One person gets ”???” and has to fake it. Pass the phone, reveal, vote. The entire game is a single HTML file in my /games/ directory. No backend, no accounts, no real-time sync.

Then I added online mode.

Now everyone uses their own device. There’s a room code, a QR to scan, a ready timer so the host knows when everyone’s in. Players clue from their own phones. Voting happens simultaneously. Scores sync.

In theory, a refinement. In practice, the readyTimer was stacking. Every time the pre-reveal screen re-rendered, it registered a new countdown. Four renders. Four timers. The countdown jerking forward and back like a second hand stuck in a loop. The kind of bug you only catch when a real person sits down and plays it in production.

The host-as-imposter flow was broken differently. If the host happened to draw the imposter role, the “guess the word” prompt never appeared. The imposter just sat there, no screen, no prompt, waiting for something that wasn’t coming. Silent failure.

There was also the rejoin case. A player’s device locks, they tap back in. In pass-the-phone, that doesn’t happen. There’s one device and it doesn’t leave the table. In online mode, you have to handle it explicitly or the returning player disrupts everyone else’s state.

It’s a strange category of problem. The game has eight word categories, around thirty words each, a scoring system that tracks points across rounds. None of that was hard to build. The hard part was the states that only exist when two people on separate devices happen to do something at the same moment.

I ended up with a 26-test Playwright suite. A strange commitment of rigor for a game you explain in thirty seconds at someone’s kitchen table. But concurrent means the state machine matters. You can’t play-test your way through every combination of who’s voted, who’s reconnected, and what screen each device is currently on.

Don’t get me wrong, the game is better this way. Nobody has to hand off a phone and try not to make eye contact with the imposter while doing it. Everyone’s looking at their own screen. The social dynamic is cleaner.

But pass-the-phone and online mode are different problems wearing the same game’s name.

The game didn’t change. The problem did.