DEV Community

Discussion on: 5 reasons you should not use Protractor in 2020

Collapse
 
moinuddin14 profile image
Khaja Moinuddin Mohammed

Definite alternatives to Protractor are

  1. Puppeteer
  2. Cypress
  3. WebDriverIO
  4. Playwright (Still in beta)

All the above other than WebDriverIO are not based on Selenium which is a good thing.

Collapse
 
moinuddin14 profile image
Khaja Moinuddin Mohammed

BTW, to answer some pointers raised in the article against Cypress

iframes: This article explains how to work with iframes cypress.io/blog/2020/02/12/working...

file uploads: How to work with file upload with Cypress github.com/cypress-io/cypress-exam...

native events: Yes this is a big issue which they are actively working on github.com/cypress-io/cypress/issu...

any other browser except Chrome: They have recently started supporting firefox docs.cypress.io/guides/guides/laun...

xpath: Cypress has this beautiful concept called plugins and with that it's possible to extend the capabilities of cypress, one such example is using external node module for working with xpath, I personally used this and it works well npmjs.com/package/cypress-xpath

multiple windows and tabs: It's true that Cypress doesn't support multi tab and multi window but they have given reasons for not supporting that, which to me makes sense. We shouldn't be testing the browser features instead the application feature. Also, multi tab and multi browser scenarios are quite brittle. These are one of those flaky tests that has plauged the testing community for so long. Time to take these tests out of the test suite.

testing sites you don't control: Honestly, didn't get this point

page objects: As Page Objects is only a concept and not language/framework specific, ideally we should be able to use with almost any testing tool/framework. But then there are alternatives to Page Objects like SerenityJs's Screenplay Pattern, again PO Pattern makes things more complex. Cypress has a better way to handle with Custom cypress.io/blog/2019/01/03/stop-us...

Also, Cypress is ever evolving and they are going places to reach audience and gather feedback. Looks to me they are truly on their mission to provide a better alternative to Selenium.