paint-brush
5 Cypress E2E Testing Mistakes to Avoidby@webiny
372 reads
372 reads

5 Cypress E2E Testing Mistakes to Avoid

by Webiny Serverless CMS6mJuly 31st, 2021
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

Using id and class for selecting element is problematic because they are primarily for behavior and styling purposes, due to which they are subject to change frequently. Instead of using id or class to target this element for test, use data-testid. Using arbitrary values in the cy.wait command is dangerous because it mimics the behavior of a real user in real-world scenarios. When using a clause like Promise.all with Cypress command, it might not work as you expect because Cypress commands are like Promise, but not real Promise.

Companies Mentioned

Mention Thumbnail
Mention Thumbnail
featured image - 5 Cypress E2E Testing Mistakes to Avoid
Webiny Serverless CMS HackerNoon profile picture
Webiny Serverless CMS

Webiny Serverless CMS

@webiny

#OpenSource #React #NodeJs #GraphQL #Headless #Serverless

L O A D I N G
. . . comments & more!

About Author

Webiny Serverless CMS HackerNoon profile picture
Webiny Serverless CMS@webiny
#OpenSource #React #NodeJs #GraphQL #Headless #Serverless

TOPICS

THIS ARTICLE WAS FEATURED IN...

Permanent on Arweave
Read on Terminal Reader
Read this story in a terminal
 Terminal
Read this story w/o Javascript
Read this story w/o Javascript
 Lite
Also published here
Allella
Learnrepo
Starbugs