angular / protractor

E2E test framework for Angular apps
http://www.protractortest.org
MIT License
8.75k stars 2.31k forks source link

Can non-angular applications be mocked using protractor? #5402

Open abhinaba-ghosh opened 4 years ago

abhinaba-ghosh commented 4 years ago

Hi ,

I am using browser.ignoreSynchronization=true for my non angular application. So, protractor loose track of the http calls in backend. So, while trying any of the mock libraries available for protractor it is not working.

Is there a way to mock non angular applications with protractor?

Fuun347 commented 4 years ago

By what I've read online browser.ignoreSynchronization is deprecated. The recommended way is using browser.waitForAngularEnabled(false)

abhinaba-ghosh commented 4 years ago

@Fuun347

Yup even if you write so, protractor still loose track the http asynchronous calls. In this circumstances, what is the way to setup mocks for my protractor tests?

Fuun347 commented 4 years ago

Not too sure myself as I've never had to work with mocks, but this issue here might have an answer for you https://github.com/angular/protractor/issues/125

singhrajkr commented 4 years ago

Try following in your spec.js file

Try setting false for non-angular app page browser.waitForAngularEnabled(false); Try setting true for angular app page browser.waitForAngularEnabled(true);