I am still studying Protractor, so I'm not sure if this is a simple answer that I am not getting, but I'm just trying to make the browser wait while the attribute that I am retrieving is right.
I am testing the pizza option for this site .
Full code:
browser.get('https://material.angularjs.org/latest/#/demo/material.components.select');
var topping = element(by.model('topping'));
topping.click();
browser.wait(function() {
return topping.getAttribute('aria-expanded').then(function(value) {
return value == 'true';
});
}, 5000);
var toppingOptions = element.all(by.css('[role="option"]'));
toppingOptions.get(5).click();
expect(topping.getText()).toBe('Onion');
This gives me an error:
The element does not click at the point (436, 693). Another item will get a click:<md-backdrop class="md-select-backdrop md-click-catcher md-default-theme"></md-backdrop>
One more note: if I put browser.sleep(1000);after topping.click()and before browser.wait(), then the test will pass. Therefore, I know that the rest of the test is not unsuccessful. For some reason, the call to wait does not work.
, - , , , , topping, ComboBox . - "", .