This repository tests the abtility of chatGPT to write E2E-Tests with cypress.
The aim was to find out how accurate chatGPT is when writing E2E tests. For this purpose, a todo app created with HTML, JavaScript and CSS is available as a test application.
The task was to add a new todo and to check whether this todo has been added to the todo list. In addition, it should be checked that the initial empty state is removed as soon as a todo has been added.
First, the developer wrote the Cypress test to the best of his ability.
Then chatGPT was confronted with the following task:
"Write a Cypress test that adds a todo on the https://dominique-boerner.github.io/chatgpt-cypress-test/example/ page and checks if this todo is displayed in a list."
The Cypress test generated by chatGPT was logically the better test. The developer forgot to check the length of the list. So it could happen that todos are added twice (bug), but the Cypress test is green.
ChatGPT, on the other hand, did this check.
The source code of chatGPT could be taken over directly. However, minor adjustments have to be made:
- the url should be replaced with localhost:8080
- the selected elements via cy.get() should be replaced with constants