Making both parts of expect resolve promises
问题 The Problem: In Protractor, expect() is patched to implicitly understand promises which enables a shorthand assertion style . E.g.: expect(elm.getText()).toEqual("expected text"); elm.getText() here does not need to be explicitly resolved with then() and would be implicitly resolved by Protractor before the expectation is checked. But, what if the "to equal" part is also a promise. For instance, a text from an another element. In this case we have to resolve the second part explicitly: elm2