Since the Playwright can read browser DOM, it is easy to make a test that solves the memory game with a minimal number of moves in no time.
How to install dependencies:
npm i
How to run the tests:
npx playwright test
How to run the tests with open browser:
npx playwright test --headed
Or you can run a pre-defined script with the command
npm run test
If the test is too fast for you, you can see for yourself by opening generated
success.png
file
I used here the Memory Matching Game in JavaScript developed by Chris Sev and all credits go to him
Enjoy!