- The End-to-end testing is used to verify the correctness of new features, catch bugs and notice regressions when the application grow in size and complexity.
- The End-to-end testing also used to catch the bugs, when the components are integrated which cannot be captured in a unit test.
- The AngularJS have built Protractor, an end to end test runner which simulates user interactions that help us to verify the strength of our application.
- Protractor is an end-to-end test framework for AngularJS application.
- Protractor is a Node.js program.
- Protractor uses WebDriver to control browsers and simulate user actions.
- The jasmine tool used for protractor test syntax.
- As in unit testing, one or more it blocks are describe the requirement of our application that are comprised in a test file.
- The it blocks containing the commands and expectations.
- Command is used to tell Protractor to do something. For example, click on a button or navigate to a page.
- Expectations is used to tells Protractor to assert something about the application’s state. For example, the current URL or the value of the field.
- If any expectation is fail with in it block, then the runner marks the it as “failed” and continues on to the next block.
- The test file has beforeEach blocks that will run before each it blocks for check whether the block passes or fails.
- The test file has afterEach blocks that will run after each it block for check whether the block passes or fails.
- The tests may also have helper functions to avoid duplicating code in the it blocks.
Example of the simple test:
- This test describes the requirements of a ToDo list, specifically, that it should be able to filter the list of items.
Related Searches to angularjs e2e testing tools
protractor testing tool
protractor vs selenium
protractor vs karma
protractor angular 2