Skip to content

dominique-boerner/chatgpt-cypress-test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

chatgpt-cypress-test

This repository tests the abtility of chatGPT to write E2E-Tests with cypress.

Goal of this test

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.

Task

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.

Execution

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."

Result

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

About

This repository tests the abtility of chatGPT to write E2E-Tests with cypress.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published