Skip to content
This repository has been archived by the owner on Aug 14, 2024. It is now read-only.

Http Backend Missing #25

Open
ghost opened this issue Mar 2, 2016 · 4 comments
Open

Http Backend Missing #25

ghost opened this issue Mar 2, 2016 · 4 comments
Labels

Comments

@ghost
Copy link

ghost commented Mar 2, 2016

I'm seeing an error $httpBackend.when is not a function when I try and use this library.

@ghost ghost changed the title Http Backend Http Backend Missing Mar 2, 2016
@kbaltrinic
Copy link
Owner

Can you provide a code example (git repo or similar), full stack tract of the error and other details (versions of angular, protractor, browser, etc.)?

@munk
Copy link

munk commented Aug 22, 2016

I'm seeing a similar problem @kbaltrinic

My repo is here: https://github.com/munk/backend-proxy

It's running against Firefox 24 ESR, node v6.4.0, protractor 4.0.3, angular 1.5.8. I'm updating firefox to the latest esr to verify I can reproduce it there.

edit: confirmed this happens with Firefox 45.3.0 also.

The stack trace is as follows:

❯ protractor protractor.conf.js                                                                                                                                                       ⏎
[12:21:34] I/local - Starting selenium standalone server...
[12:21:34] I/launcher - Running 1 instances of WebDriver
[12:21:35] I/local - Selenium standalone server started at http://10.100.102.111:50065/wd/hub
Started
F

Failures:
1) the test... passes
  Message:
    Failed: $httpBackend.when is not a function
    Build info: version: '2.53.1', revision: 'a36b8b1', time: '2016-06-30 17:37:03'
    System info: host: 'devmachine', ip: '10.100.102.111', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.11.5', java.version: '1.8.0_25'
    Driver info: driver.version: unknown
  Stack:
    WebDriverError: $httpBackend.when is not a function
    Build info: version: '2.53.1', revision: 'a36b8b1', time: '2016-06-30 17:37:03'
    System info: host: 'devmachine', ip: '10.100.102.111', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.11.5', java.version: '1.8.0_25'
    Driver info: driver.version: unknown
        at WebDriverError (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/error.js:27:5)
        at Object.checkLegacyResponse (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/error.js:639:15)
        at parseHttpResponse (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/http/index.js:538:13)
        at client_.send.then.response (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/http/index.js:472:11)
  1 var HttpBackend = require('http-backend-proxy');
        at ManagedPromise.invokeCallback_ (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:1379:14)
        at TaskQueue.execute_ (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:2913:14)
        at TaskQueue.executeNext_ (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:2896:21)
        at asyncRun (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:2820:25)
        at /usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:639:7
        at process._tickCallback (internal/process/next_tick.js:103:7)
    From: Task: WebDriver.executeScript()
        at WebDriver.schedule (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver.js:377:17)
        at WebDriver.executeScript (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver.js:526:16)
        at ProtractorBrowser.to.(anonymous function) [as executeScript] (/usr/local/lib/node_modules/protractor/built/browser.js:61:29)
        at executeOrBuffer (/Users/john.downs/src/backend-proxy/node_modules/http-backend-proxy/test/lib/http-backend-proxy.js:65:22)
        at Object.respond (/Users/john.downs/src/backend-proxy/node_modules/http-backend-proxy/test/lib/http-backend-proxy.js:46:18)
        at Object.<anonymous> (/Users/john.downs/src/backend-proxy/app.spec.js:11:98)
        at /usr/local/lib/node_modules/protractor/node_modules/jasminewd2/index.js:96:23
        at new ManagedPromise (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:1082:7)
        at controlFlowExecute (/usr/local/lib/node_modules/protractor/node_modules/jasminewd2/index.js:82:18)
        at TaskQueue.execute_ (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:2913:14)
    From: Task: Run it("passes") in control flow
        at Object.<anonymous> (/usr/local/lib/node_modules/protractor/node_modules/jasminewd2/index.js:81:14)
        at /usr/local/lib/node_modules/protractor/node_modules/jasminewd2/index.js:18:5
        at ManagedPromise.invokeCallback_ (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:1379:14)
        at TaskQueue.execute_ (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:2913:14)
        at TaskQueue.executeNext_ (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:2896:21)
        at asyncRun (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:2775:27)
    From asynchronous test:
    Error
        at Suite.<anonymous> (/Users/john.downs/src/backend-proxy/app.spec.js:10:5)
        at Object.<anonymous> (/Users/john.downs/src/backend-proxy/app.spec.js:4:1)
        at Module._compile (module.js:556:32)
        at Object.Module._extensions..js (module.js:565:10)
        at Module.load (module.js:473:32)
        at tryModuleLoad (module.js:432:12)

1 spec, 1 failure
Finished in 2.413 seconds
[12:21:39] I/local - Shutting down selenium standalone server.
[12:21:39] I/launcher - 0 instance(s) of WebDriver still running
[12:21:39] I/launcher - firefox #01 failed 1 test(s)
[12:21:39] I/launcher - overall: 1 failed spec(s)
[12:21:39] E/launcher - Process exited with error code 1

@munk
Copy link

munk commented Aug 26, 2016

I think I've solved this for my case. angular-mocks.js wasn't available to the browser.

In your example, you inject ngMockE2E in app.js. This step might be missed if someone puts together a barebones example, so it could be worthwhile to call out in the readme.

@kbaltrinic
Copy link
Owner

@munk Thanks for the update. Will consider your recommendation for the next time I am in this code base.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants