Now that the setup and approach have been decided, we can start our first test. From a testing point of view, as we will be using a top-down approach, we will write our Protractor tests first and then build the application. We will follow the same TDD life cycle we have already reviewed: test first, make it run, and make it better.
The scenario given is already in a well-specified format and fits our Protractor testing template:
describe('', () => { describe('', () => { beforeEach(() => { }); it('', () => { }); }); });
Placing the scenario in the template, we get the following code:
describe('Given I am posting a new comment', () => { describe('When I push the submit button', () => { beforeEach(() => { // ... }); it('Should then add the comment', () => { ...