I'm using test framework protractor to test an angularjs app. I've been doing this for sometime now and one of the question that I've not been able to answer is :
Suppose I want to modify a the value a data on my page. Clicking on the eleme brings up a form for the modification and clicking on save registers the new value in the database. So is there a difference between option 1 and option 2 below ?
option 1
element(by.id("id1"))
.click()
.then(function() {
element(by.id("input"))
.clear()
.sendKeys("new value");
element(by.id("saveButton"))
.click()
.then(function() {
expect(element(by.id("id1")).getText()).toEqual("new value");
});
});
option 2
element(by.id("id1"))
.click();
element(by.id("input"))
.clear()
.sendKeys("new value");
element(by.id("saveButton"))
.click();
expect(element(by.id("id1")).getText()).toEqual("new value");