Skip to content
This repository was archived by the owner on Jul 29, 2024. It is now read-only.

doc(tutorial): added example for element.getAttribute('value') to read text from an input #4566

Merged
merged 7 commits into from
Oct 31, 2017

Conversation

viktorpergjoka
Copy link
Contributor

doc(tutorial): added example for element.getAttribute('value') to read text from an input

Added in tutorial an example how to read the text of an input field with using element.getAttribute('value').

docs/tutorial.md Outdated
});
```

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 set a value in the input field `firstNumber` and then read it and compare the value. Input fields does not have text, instead they have values. To read a value from an input, we cannot therefore use `firstNumber.getText()`. Instead we can obtain the value with `firstNumber.getAttribute('value')`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The example is great, just a little problem, could you fix the grammar?
Input fields does(do) not have text(s), instead they have values.

@qiyigg
Copy link
Contributor

qiyigg commented Oct 30, 2017

Thanks for adding the new example.
The example looks good to me, just a minor grammar problem and it would be better to squash the comments into one comment and remove irrelevant contents

@viktorpergjoka
Copy link
Contributor Author

Changed. I hope now its fine

@qiyigg qiyigg merged commit 95dd3ca into angular:master Oct 31, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants