I've created automation tests to demonstrate how easy it is to simulate multiple players playing in real-time with the Playwright framework.
- ✓ game.spec.js:4:3 › Tic Tac Toe › Cross should win (2s)
- ✓ game.spec.js:27:3 › Tic Tac Toe › Circle should win (2s)
- ✓ game.spec.js:51:3 › Tic Tac Toe › The game should be drawn (1s)
Cross player |
Circle player |
- Install Node.JS.
- Clone the repository or download it.
- Browse the project repository on your command prompt or terminal.
- Run
npm install
to install dependencies defined in package.json. - Run
npx playwright test
to execute tests - Or run
npx playwright test --headed
to execute tests with open browsers
I tested here the Tic-Tac-Toe Game developed using Node.js, Express.js and Socket.io by Pranjali Bajpai and all credits go to her.