diff --git a/docs/tutorial.md b/docs/tutorial.md index 7a9946fc0..e87758913 100644 --- a/docs/tutorial.md +++ b/docs/tutorial.md @@ -144,11 +144,18 @@ describe('Protractor Demo App', function() { // Fill this in. expect(latestResult.getText()).toEqual('10'); }); + + it('should read the value from an input', function() { + firstNumber.sendKeys(1); + expect(firstNumber.getAttribute('value')).toEqual('1'); + }); }); ``` Here, we've pulled the navigation out into a `beforeEach` function which is run before every `it` block. We've also stored the ElementFinders for the first and second input in nice variables that can be reused. Fill out the second test using those variables, and run the tests again to ensure they pass. +In the last assertion we read the value from the input field with `firstNumber.getAttribute('value')` and compare it with the value we have set before. + Step 3 - changing the configuration -----------------------------------