You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 29, 2024. It is now read-only.
@juliemr, I'm running the latest 2.0 with the fix for #1907 and #1903 mentioned by @hankduan. I have the following piece of logic to make sure an element is not visible or does not exist:
var cssSelector = '.my-class';
browser.wait(ExpectedConditions.or(
ExpectedConditions.stalenessOf($(cssSelector)),
ExpectedConditions.invisibilityOf($(cssSelector))),
5000);
I intermittently get a NoSuchElementError: No element found using locator: By.cssSelector('.my-class')
It seems like the or is not short circuiting if the first condition is true since the first condition should check if the elements are even there. Is the promised of each condition being resolved before moving on to the same condition? Am I missing how multi condition should be used?
The text was updated successfully, but these errors were encountered:
As mentioned in the referencing issue, can you provide a reproducible case? I just made a sample test, but cannot reproduce this.
spec:
varEC=protractor.ExpectedConditions;it('should get each',function(){browser.get('http://localhost:8081');vardisappearingContent=$('#content');vartoggleButton=$('#toggleButton');expect(disappearingContent.isPresent()).toBeTruthy();toggleButton.click();// disappears after 1 second.browser.wait(EC.or(EC.stalenessOf(disappearingContent),EC.invisibilityOf(disappearingContent)),5000);expect(disappearingContent.isPresent()).toBeFalsy();});
app:
<div><label>Toggle content after 1 seconds:
<inputtype="checkbox" id="toggleButton" ng-model="shouldAppear" ng-init="shouldAppear=true" /></label><br/><divng-if="shouldAppear" id="content" class="fade">
This is removed on click.
</div></div><style>
.fade.ng-enter {
transition:1s linear all;
opacity:0;
}
.fade.ng-enter.ng-enter-active {
opacity:1;
}
.fade.ng-leave {
transition:1s linear all;
opacity:1;
}
.fade.ng-leave.ng-leave-active {
opacity:0;
}
</style>
@juliemr, I'm running the latest 2.0 with the fix for #1907 and #1903 mentioned by @hankduan. I have the following piece of logic to make sure an element is not visible or does not exist:
I intermittently get a
NoSuchElementError: No element found using locator: By.cssSelector('.my-class')
It seems like the or is not short circuiting if the first condition is true since the first condition should check if the elements are even there. Is the promised of each condition being resolved before moving on to the same condition? Am I missing how multi condition should be used?
The text was updated successfully, but these errors were encountered: