My test is experiencing intermittent failures and I am hoping to make it pass consistently. The test involves a page displaying an open layers map with numbered bubbles. Upon opening the page, we filter by status and expect a specific number to be displayed in one of the bubbles.
The encountered error is: NoSuchElementError: no such element.
The error message does not specify which element is missing. Upon reviewing the screenshot, I noticed that the filter checkbox was not clicked or visible in the screenshot (it appears when the test passes).
Below is the code snippet for the test:
beforeEach(function() {
ptor = protractor.getInstance();
ptor.ignoreSynchronization = true;
});
function waitForMap(){
ptor.wait(function () {
return element(by.css('label[for="checkbox-status-all"]')).isPresent();
}, 5000);
}
it('should click checkbox and expect 30 to be shown in bubble', function () {
browser.get(ptor.params.testurl).then(function () {
waitForMap();
element(by.css('label[for="checkbox-status-b0"]')).click();
var bedscount = ptor.findElement(protractor.By.id('marker_10'));
expect(bedscount.getInnerHtml()).toEqual('<span>30</span>');
});
});