atecarlos / protractor-http-mock

A library designed to work alongside Protractor for setting up mocks for your HTTP ajax requests.
MIT License
173 stars 70 forks source link

Browser.waitForAngular is not waiting to http request with delay #115

Closed javimaravillas closed 7 years ago

javimaravillas commented 7 years ago

Hi, I'm doing something similar to:

` button.click(); //submit http request that is mocked

        browser.waitForAngular();

        expect(message.getAttribute('class')).toMatch("alert-success"); // this class is in the dom when the http request is finished

response: { data: {

        },
        status: 200,
        delay: 2000
    }`

When I setup a delay, it won't work and the protractor test finish without waiting for the http request of the mock to be solved.

If I remove the delay, everything works as expected.

atecarlos commented 7 years ago

Hi @javimaravillas . Sorry for taking so long to reply. Are you still having this issue?

From the perspective of the plugin, there is nothing "holding" the test when you use the delay feature. This would have to be something that you handle within your test itself.

javimaravillas commented 7 years ago

Hey there, Yes it was still happening Regards,