Hacker News new | ask | show | jobs
by MetaWhirledPeas 1321 days ago
I haven't used Playwright, but I can tell just by reading about it that the code has more boilerplate and doesn't read as nicely. Example of a Cypress test (pardon the freehand typing here):

  describe(('the google home page') => {
    it(('allows you to search for banana pictures') => {
      cy.visit('https://google.com')
      cy.get('[aria-label="Search"]').type('banana{enter}')
      cy.contains('Images').click()
      cy.get('[alt="Image result for banana"]').should('be.visible')
    })
  })
Nothing too weird, and a lot of the library functions you'd need are available globally without any importing. It even has jQuery and Lodash.