As applications grow in size and complexity, it becomes unrealistic to rely on manual testing to verify the correctness of new features, catch bugs and notice regressions. Unit tests are the first line of defense for catching bugs, but sometimes issues come up with integration between components which can’t be captured in a unit test. End-to-end tests are made to find these problems.
What Is Protractor
Protractor uses Jasmine for its test syntax. As in unit testing, a test file is comprised of one or more
it blocks that describe the requirements of your application.
it blocks are made of commands and expectations. Commands tell Protractor to do something with the application such as navigate to a page or click on a button. Expectations tell Protractor to assert something about the application’s state, such as the value of a field or the current URL.
If any expectation within an
it block fails, the runner marks the
it as “failed” and continues on to the next block.
Test files may also have
afterEach blocks, which will be run before or after each
it block regardless of whether the block passes or fails.
In the series of examples and tutorials provided through our blog,we’ll see how we can automate our angular and non angular websites using Protractor. You can find the code related to this in my github repository