# Cypress

2 min read, 317 words cypresslibraryjavascripttesting

Every time I debug ci, the less I understand how we possibly can land and operate rovers on other planets.

Probably they dont use javascsript.

~ Anonymous
  • Increabibly Visual tool
  • Time Travel features, hover on action to get a snapshot of app state

# Selenium

Statelless HTTP api

  • Selenium came in 2004, webdriver
  • back in the day, AJAX wasent even a thing
  • everything was synchronous
  • on every submit, there was a page refresh

devtools

When chrome driver is automation browser, you cannot use devtools

Its like shooting a cracker in the pitch black night sky, where we see somethings for a flash moment and then everything goes back to dark.

# Cypress

  • chai, mocha like api

  • with jquery like slector api

  • Everything returns Promises under the hood

  • Command chaning

  • Can test CSS Animations

  • Create a global user for application before startup win.user = { ... }

  • set some localStorage value like auth-token

  • Force server to return 500 status on POSt request

cy.server
  .route({method: "POST", url: "/blog", status: 500, response: ""})
  .as("postBlog)
  • Currently built on top of electron (opens new window)
  • run in headless mode on CI
  • 100s of pages of documentation
  • Mobile web - yes
  • Native mobile - No

# Testing tool Challenges

  • Cross browser testing
  • Animation/ CSS testing
  • More insights into failing tests
  • Quickly debuggable
  • Test Responsive desings
  • Test async functionalities

# Repos to check

Subscribe to our Newsletter

If you like my work and think it was helpful kindly support my work


Buy Me A Coffee