-
Notifications
You must be signed in to change notification settings - Fork 6.7k
Modal is incompatible with Protractor #2289
base: master
Are you sure you want to change the base?
Modal is incompatible with Protractor #2289
Conversation
Protractor uses Angular's $browser.notifyWhenNoOutstandingRequests (https://github.com/angular/protractor/blob/f23565d5db4fbb102cfec8311ce9dfaee52e9113/lib/clientsidescripts.js#L28) to determine when it's okay to continue sending commands via webdriver. Right now, when Protractor does an action that results in a modal being shown, notifyWhenNoOutstandingRequests gets called immediately, often before the modal is done displaying, resulting in flakey specs. This commit contains a failing test simulating this behavior.
This might be related to ui-bootstrap not relying on ngAnimate right now. |
Can you take a look at this again @chrisirhc? |
This appears to still be an issue, likely because $modal is not completely relying on ngAnimate currently for opening the modal. |
Are there any workarounds for this? |
@bjaanes not to my knowledge. You may try reaching out to the StackOverflow community to cast a wider net. If you go that route, in order for people to want to help you, I would strongly encourage you to show you've done research and know exactly why the problem exists as well as creating a minimally working plunker that demonstrates the issue. |
@icfantv the test makes it obvious what the problem is - we just need to figure out what is going on that is causing it to fail. Incidentally, I did take another look at this in the past few days, but still am not sure what is causing the problem. This is up for grabs for anyone to fix. |
Ok, apologies. |
Have a look at the implementation of self.notifyWhenNoOutstandingRequests = function(callback) {
if (outstandingRequestCount === 0) {
callback();
} else {
outstandingRequestCallbacks.push(callback);
}
}; If you call this function before starting an async operation (with $timeout or $http), the callback will be just executed immediately. Especially in unit tests where we have the mock notifyWhenNoOutstandingRequests: function(fn) {
fn();
} I haven't investigated the Protractor's side of this issue. Just saying that the test is invalid. |
@chrisirhc did this issue have been resolved? |
Protractor uses Angular's
$browser.notifyWhenNoOutstandingRequests
to determine when it's okay to continue sending commands via webdriver.Right now, when Protractor does an action that results in a modal being shown,
notifyWhenNoOutstandingRequests
gets called immediately, often before the modal is done displaying, resulting in flakey specs.This commit contains a failing test simulating this behavior.