Using Selenium for AngularJS Web Applications

I found out that Selenium is the father of user interface testing.

Now my question is why then the Angular team developed Protractor. Can't the same job (what Protractor does) get done using Selenium for AngularJS web applications?

In addition, people also talk about Nightwatch.js. So why are there so many E2E libraries / frameworks like Protracor or Nightwatch.

+5
source share
2 answers

The protractor combines powerful tools and technologies such as NodeJS, Selenium, webDriver, jasmine, cucumber and mocha. It has many settings from Selenium to easily create tests for AngularJS applications. Speeds up its testing, as it avoids the need to โ€œsleepโ€ and โ€œwaitโ€ a lot in your tests, as this optimizes sleep time and expectations. Allows you to organize tests based on Jasmine, which allows you to write both single and functional tests on Jasmine. It works on real browsers and mute browsers ...

You can find all this information here => http://www.thoughtworks.com/insights/blog/testing-angularjs-apps-protractor .

+9
source

The protractor.waitForAngular() also suggests that you wait for area changes using protractor.waitForAngular() , which, I think, may or may not be implemented using Selenium. You still have to beat around your head to simulate the same function using selenium.

My opinion

If you just want to do user interface testing and are not interested in listening for scope changes or any specific angular events, you can continue selenium. But this is a HUGE advantage of using Protractor for e2e tests for Angular.

+2
source

Source: https://habr.com/ru/post/1203369/


All Articles