The Angular CLI also provides end-to-end testing for applications out of the box and uses Protractor to do so. e2e testing is used to test the application by running the application in a browser and testing whether everything works as expected end-to-end. Protractor uses Selenium behind the scenes to run the application and does testing by using JavaScript.
Let's run the e2e test case for the application using the Angular CLI command:
> ng e2e
This should open the browser and navigate to the home page. It should fail:
**************************************************
* Failures *
************************************************
1) workspace-project App should display welcome message
- Failed: No element found using locator: By(css selector, app-root h1)
Executed 1 of 1 spec (1 FAILED) in 2 secs.
[23:35:36] I/launcher - 0 instance(s) of WebDriver still running...