5

I am trying to automate an angular 4 application.(protractor, cucumber, typescript). Stuck at mocking the HTTP requests.

Found Couple of approaches:

1) httpBackend 2) http-backend-proxy

But all of them talks about AngularJs application. And as per my understanding, they have achieved using ngMockE2E which I could not found in angular2+ api doc.

I also tried to follow this, no luck.

Can anyone help me where I can refer in order to mock HTTP calls(GET, POST, PUT etc) in my protractor project.

Thanks in advance.

@Ram Pasala, @vict: Do you have any comments!

Vinni
  • 529
  • 1
  • 7
  • 18
  • [browser.addMockModule()](https://stackoverflow.com/questions/36354233/protractor-mocking-backend-with-angular2-on-api-request) is not supported for AngularV2+ – Vinni Aug 31 '17 at 00:08
  • Have you tried using the ng-apimock plugin that comes with protractor? – Sankalan Parajuli Apr 15 '20 at 07:47

0 Answers0