Solve the Wordle game using Cypress test
Note: the game has recently changed its implementation, rendering many specs in need of major changes. I have kept only the hint
spec up-to-date, skipping the rest of the tests.
- solve.js shows a real recursive solution to the Wordle game, watch the video "Solve Wordle Game For Real Using Cypress".
- solve-hard-mode.js shows how to solve Wordle in Hard mode by optimizing our word picks, watch the video "Solve Wordle In Hard Mode".
- spec.js takes a shortcut and looks up the solution in the game state object the application saves in the local storage. Watch the video "Solve Wordle Game Using Cypress".
- control-the-date.js overwrites the current date using cy.clock command and plays the Wordle from other dates. Watch the video "Play Wordle From Any Date Using cy.clock".
- play-every-day.js sets synthetic Date in each test to accumulate a long winning streak playing every word from Jan 1st to Jan 17th 2022. Find the recording here.
- colors.js plays the game using color accessible mode using the dark theme. Saves the screenshot of the solution in the "cypress/screenshots" folder.
- wordlist-data-session.js uses cypress-data-session plugin to download and keep the word list array cached in memory. Watch the video "Use cypress-data-session To Store The Word List".
- email-hint.js hides all letters in the solution but one and emails the screenshot of the solved puzzle daily to myself. Watch the video "Generate A Daily Wordle Hint Email With Screenshot".
- start.js lets the user provide the starting word. You can trigger this spec from the GitHub Actions UI using the workflow start.yml.
- vue-wordle/spec.js plays a version of Wordle implemented in yyx990803/vue-wordle interacting via page objects.
- a-greener-wordle/spec.js solves the "Greener Wordle" version hosted at https://agreenerworldle.org/.
You can find several videos explaining how to play and solve Wordle using Cypress in my playlist Cypress Wordle.
Author: Gleb Bahmutov <[email protected]> © 2022
License: MIT - do anything with the code, but don't blame me if it does not work.
Support: if you find any problems with this module, email / tweet / open issue on Github
Copyright (c) 2022 Gleb Bahmutov <[email protected]>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.