Solving Wordle with Python & Selenium - & then running it in GitHub Actions-Michael Mintz #SeConf 22

preview_player
Показать описание
In 2022, the Wordle game took over the world by storm. As curious automation engineers, it is our duty to find an automated solution to solve Wordle for us. I took on that responsibility and created a working Wordle-solver using Python and Selenium. As a bonus, I got that solution to run in GitHub Actions.

In this presentation/demonstration, you'll learn how all the pieces come together to make this happen. You'll learn some Python, some Selenium, some pytest, some SeleniumBase, some things about Shadow-DOM, and getting your scripts to run in GitHub Actions.
--------
The "Why?" Section:
1. Why automate Wordle?
Wordle is a game, and games help up learn. In the case of playing Wordle, we play because it's fun to solve puzzles. In the case of automating Wordle, that's an even bigger puzzle to solve because there are more components involved (algorithms, Python, Selenium, Shadow-DOM, etc).

2. Why run the solution in GitHub Actions afterwards?
GitHub Actions is one of many available CI/CD systems. Given that it's free to use and already part of GitHub, that makes it the most accessible to people looking to try this out for themselves. People could just as easily run their scripts in Jenkins if they already have access to that. The reason why a CI/CD system was included at all in this demonstration is because automating games gives us a fun excuse to learn more about CI/CD in general (Continuous Integration / Continuous Deployment), which is often the final destination of many automated scripts that test engineers write.

3. Why SeleniumBase?
SeleniumBase offers many simplifications and enhancements to the standard Python Selenium bindings. SeleniumBase also also has smart-waiting, reports, dashboards, pytest command-line options for customizing tests, other APIs to simplify Selenium commands, and multiple other enhancements. And best of all, SeleniumBase is free and open source on GitHub, which means it's accessible to all.
--------
This is a follow-up to my popular post on DEV:
(Since those were created, the New York Times acquired Wordle, and there have been a few changes to URLs, etc. The code has already been updated as needed.)

Рекомендации по теме