public clickOnElementWithSelectionMethod(elementKey, selectionMethod, selectionValue) {
let elementToClick = this.getWebElement(elementKey, selectionMethod, selectionValue);
return assert.eventually.equal(
elementToClick.click().then(() => {
return true;
}, (error: any) => {
throw new Error(error.message);
}), true, 'Element "' + elementKey + '" click failed'
);
}
I'm passing protractor's Click() API call as the promise, here.
Even when im passing a wrong selectionValue
, it shows as the test is passed, but fails the next test.