1

I have an angular-bootstrap dropdown which works as expected. When I click on the dropdown button in a protractor e2e test, the dropdown does not open. I tried browser.sleep(), browser.waitForAngular(), and browser.wait(function () {return childItem.isDisplayed();}, 1500);. The button will be clicked (css changes), the test runner waits for some time, but the dropdown does not show up. When I try to e.g. getText() from the childItem, I get

ElementNotVisibleError: Element is not currently visible and so may not be interacted with

How can I test angular-bootstrap dropdowns in my e2e tests?

1 Answer 1

2

I made a function that waits for when it is present in the HTML and after that checks if the element is vissible. Hopefully this is a possible fix for your wait problem.

this.waitUntilReady = function (elm) {
        browser.wait(function () {
            return elm.isPresent();
        },10000);
        browser.wait(function () {
            return elm.isDisplayed();
        },10000);
    };

usage:

waitUntillReady(element(by.id('superId')));
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.