juliemr / webdriverjs-retry

Retry lib for webdriverJS code
MIT License
27 stars 7 forks source link

Retry.run doesn't sync with Protractor's control flow #5

Open eolognt opened 9 years ago

eolognt commented 9 years ago

Using this plugin with Protractor. Have these lines in my spec:

view.chat.sendMessage(1);
retry.run(function () {
    view.chat.sendMessage(2);
});
view.chat.sendMessage(3);

view.chat.sendMessage looks like this:

function () {
    element(by.model('message')).sendKeys(msg);
    return element(by.buttonText('Send')).click();
}

I expected this output in my chat:

1
2
3

but got this:

2
1
3

Shouldn't actions in the function passed onto retry.run be added to the control flow and be executed in the order I expected?