Creando un Plan de Testing y una suite automatizada con Playwright y ChatGPT
«Basándonos en una aplicación bancaria, usaremos ChatGPT para crear casos de prueba, definiendo roles y proporcionando el contexto necesario a la IA para que los casos de prueba sean relevantes.
También construiremos una suite de automatización en Playwright con la ayuda de ChatGPT.»
Maria Aguilera
Únete a las actividades que realizaremos

Summary of «Creating a Testing Plan and Automated Suite with Playwright and ChatGPT»
María Aguilera presents a talk about using ChatGPT and Playwright for creating and automating test cases. She uses a fictional bank website called XYZ Bank as an example.
The main points are:
- Introduction: ChatGPT is introduced as a generative AI capable of creating content, including tests, and Playwright as a framework for Test Automation. The XYZ Bank website will be used as the system under test.
- Initial test plan with ChatGPT: ChatGPT is provided with a detailed description of the banking application, including user roles (customer and manager) and allowed actions for each role. ChatGPT generates a test plan with functional test cases and suggestions for non-functional tests (security, usability, Performance, integration).
- Refinement of test cases: The information provided to ChatGPT about the customer login is corrected (no password required, only name selection from a dropdown list). ChatGPT updates the test cases accordingly.
- Automation with Playwright and ChatGPT: ChatGPT is asked for instructions to start a Playwright project on Windows. The provided steps are followed: Node.js installation, project creation, Playwright installation, and creation of a test script.
- Debugging with ChatGPT’s help: When running the first test script, an error is encountered («Cannot find module ‘playwright/test'»). ChatGPT is consulted and provides the solution: installing the playwright/test package.
- Correcting the selector with ChatGPT’s help: A new error arises related to an incorrect selector for the «Customer Login» button. The browser’s developer tools are used, and ChatGPT is asked for the correct selector. ChatGPT provides several options.
- Completing the test with ChatGPT: ChatGPT is asked to complete the customer login test, including selecting the user by name (instead of ID). ChatGPT provides the complete code and a detailed explanation. It is shown how to run the test with the –headed parameter to see the execution in the browser and with test.slow() to slow down the execution and observe the steps.
Conclusion
The usefulness of ChatGPT as a support tool for test automation is highlighted, especially for people with little programming experience. The importance of the tester’s critical thinking to refine and correct the AI’s responses is emphasized. It is shown how ChatGPT can help not only generate code but also debug errors and understand different ways of approaching automation.
Únete a las actividades que realizaremos

Resumen de «Creando un Plan de Testing y una suite automatizada con Playwright y ChatGPT»
María Aguilera presenta una charla sobre el uso de ChatGPT y Playwright para la creación y automatización de casos de prueba. Utiliza una página web de un banco ficticio llamado XYZ Bank como ejemplo.
Los puntos principales son:
- Introducción: Se presenta a ChatGPT como una IA generativa capaz de crear contenido, incluyendo tests, y Playwright como un framework para automatización de pruebas. Se utilizará la web XYZ Bank como sistema bajo prueba.
- Plan de pruebas inicial con ChatGPT: Se proporciona a ChatGPT una descripción detallada de la aplicación bancaria, incluyendo roles de usuario (cliente y manager) y acciones permitidas para cada rol. ChatGPT genera un plan de pruebas con casos de prueba funcionales y sugerencias para pruebas no funcionales (seguridad, usabilidad, rendimiento, integración).
- Refinamiento de los casos de prueba: Se corrige la información proporcionada a ChatGPT sobre el login de cliente (no requiere contraseña, solo selección de nombre de una lista desplegable). ChatGPT actualiza los casos de prueba en consecuencia.
- Automatización con Playwright y ChatGPT: Se pide a ChatGPT instrucciones para iniciar un proyecto con Playwright en Windows. Se siguen los pasos proporcionados: instalación de Node.js, creación del proyecto, instalación de Playwright y creación de un script de prueba.
- Depuración con ayuda de ChatGPT: Al ejecutar el primer script de prueba, se encuentra un error («Cannot find module ‘playwright/test'»). Se consulta a ChatGPT, que proporciona la solución: instalar el paquete playwright/test.
- Corrección del selector con ayuda de ChatGPT: Surge un nuevo error relacionado con un selector incorrecto para el botón «Customer Login». Se utiliza las herramientas de desarrollador del navegador y se solicita a ChatGPT el selector correcto. ChatGPT proporciona varias opciones.
- Completando el test con ChatGPT: Se pide a ChatGPT que complete el test de login de cliente, incluyendo la selección del usuario por su nombre (en lugar de ID). ChatGPT proporciona el código completo y una explicación detallada del mismo. Se muestra cómo ejecutar el test con el parámetro –headed para ver la ejecución en el navegador y con test.slow() para ralentizar la ejecución y observar los pasos.
Conclusión
Se destaca la utilidad de ChatGPT como herramienta de apoyo para la automatización de pruebas, especialmente para personas con poca experiencia en programación. Se enfatiza la importancia del pensamiento crítico del tester para refinar y corregir las respuestas de la IA. Se muestra cómo ChatGPT puede ayudar no solo a generar código, sino también a depurar errores y a entender diferentes formas de abordar la automatización.

Maria Aguilera
Software Testing Engineer | Agile Tester | SDET | Creator of the Mentoring Program at Under Test | Employability Mentor