stomp-js / ng6-stompjs-demo

4 stars 4 forks source link

e2e script timeout during Protractor.waitForAngular() #2

Closed magjac closed 5 years ago

magjac commented 5 years ago

I get the error message below when running the e2e-tests. I think this article gives some insight into what to do. At least I used it when solving a similar problem recently.

~/git/ng6-stompjs-demo$ node_modules/.bin/ng e2e
** Angular Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/ **

Date: 2018-12-18T12:16:20.692Z
Hash: 1d6e0b42abf7e153d4aa
Time: 5552ms
chunk {main} main.js, main.js.map (main) 23 kB [initial] [rendered]
chunk {polyfills} polyfills.js, polyfills.js.map (polyfills) 228 kB [initial] [rendered]
chunk {runtime} runtime.js, runtime.js.map (runtime) 6.22 kB [entry] [rendered]
chunk {styles} styles.js, styles.js.map (styles) 1.08 MB [initial] [rendered]
chunk {vendor} vendor.js, vendor.js.map (vendor) 3.5 MB [initial] [rendered]
ℹ 「wdm」: Compiled successfully.
[13:16:21] I/update - chromedriver: file exists /home/magjac/git/ng6-stompjs-demo/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_2.45.zip
[13:16:21] I/update - chromedriver: unzipping chromedriver_2.45.zip
[13:16:21] I/update - chromedriver: setting permissions to 0755 for /home/magjac/git/ng6-stompjs-demo/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_2.45
[13:16:21] I/update - chromedriver: chromedriver_2.45 up to date
[13:16:21] I/launcher - Running 1 instances of WebDriver
[13:16:21] I/direct - Using ChromeDriver directly...
Jasmine started

  workspace-project App
    ✗ should display welcome message
      - Failed: script timeout: result was not received in 11 seconds
        (Session info: chrome=70.0.3538.67)
        (Driver info: chromedriver=2.45.615279 (12b89733300bd268cff3b78fc76cb8f3a7cc44e5),platform=Linux 4.15.0-42-generic x86_64)
        (Session info: chrome=70.0.3538.67)
        (Driver info: chromedriver=2.45.615279 (12b89733300bd268cff3b78fc76cb8f3a7cc44e5),platform=Linux 4.15.0-42-generic x86_64)
          at Object.checkLegacyResponse (/home/magjac/git/ng6-stompjs-demo/node_modules/selenium-webdriver/lib/error.js:546:15)
          at parseHttpResponse (/home/magjac/git/ng6-stompjs-demo/node_modules/selenium-webdriver/lib/http.js:509:13)
          at doSend.then.response (/home/magjac/git/ng6-stompjs-demo/node_modules/selenium-webdriver/lib/http.js:441:30)
          at <anonymous>
          at process._tickCallback (internal/process/next_tick.js:189:7)
      From: Task: Protractor.waitForAngular() - Locator: By(css selector, app-root h1)
          at Driver.schedule (/home/magjac/git/ng6-stompjs-demo/node_modules/selenium-webdriver/lib/webdriver.js:807:17)
          at ProtractorBrowser.executeAsyncScript_ (/home/magjac/git/ng6-stompjs-demo/node_modules/protractor/built/browser.js:425:28)
          at angularAppRoot.then (/home/magjac/git/ng6-stompjs-demo/node_modules/protractor/built/browser.js:456:33)
          at ManagedPromise.invokeCallback_ (/home/magjac/git/ng6-stompjs-demo/node_modules/selenium-webdriver/lib/promise.js:1376:14)
          at TaskQueue.execute_ (/home/magjac/git/ng6-stompjs-demo/node_modules/selenium-webdriver/lib/promise.js:3084:14)
          at TaskQueue.executeNext_ (/home/magjac/git/ng6-stompjs-demo/node_modules/selenium-webdriver/lib/promise.js:3067:27)
          at asyncRun (/home/magjac/git/ng6-stompjs-demo/node_modules/selenium-webdriver/lib/promise.js:2927:27)
          at /home/magjac/git/ng6-stompjs-demo/node_modules/selenium-webdriver/lib/promise.js:668:7
          at <anonymous>
          at process._tickCallback (internal/process/next_tick.js:189:7)Error
          at ElementArrayFinder.applyAction_ (/home/magjac/git/ng6-stompjs-demo/node_modules/protractor/built/element.js:459:27)
          at ElementArrayFinder.(anonymous function).args [as getText] (/home/magjac/git/ng6-stompjs-demo/node_modules/protractor/built/element.js:91:29)
          at ElementFinder.(anonymous function).args [as getText] (/home/magjac/git/ng6-stompjs-demo/node_modules/protractor/built/element.js:831:22)
          at AppPage.getParagraphText (/home/magjac/git/ng6-stompjs-demo/e2e/src/app.po.ts:9:43)
          at UserContext.<anonymous> (/home/magjac/git/ng6-stompjs-demo/e2e/src/app.e2e-spec.ts:12:17)
          at /home/magjac/git/ng6-stompjs-demo/node_modules/jasminewd2/index.js:112:25
          at new ManagedPromise (/home/magjac/git/ng6-stompjs-demo/node_modules/selenium-webdriver/lib/promise.js:1077:7)
          at ControlFlow.promise (/home/magjac/git/ng6-stompjs-demo/node_modules/selenium-webdriver/lib/promise.js:2505:12)
          at schedulerExecute (/home/magjac/git/ng6-stompjs-demo/node_modules/jasminewd2/index.js:95:18)
          at TaskQueue.execute_ (/home/magjac/git/ng6-stompjs-demo/node_modules/selenium-webdriver/lib/promise.js:3084:14)
      From: Task: Run it("should display welcome message") in control flow
          at UserContext.<anonymous> (/home/magjac/git/ng6-stompjs-demo/node_modules/jasminewd2/index.js:94:19)
          at /home/magjac/git/ng6-stompjs-demo/node_modules/jasminewd2/index.js:64:48
          at ControlFlow.emit (/home/magjac/git/ng6-stompjs-demo/node_modules/selenium-webdriver/lib/events.js:62:21)
          at ControlFlow.shutdown_ (/home/magjac/git/ng6-stompjs-demo/node_modules/selenium-webdriver/lib/promise.js:2674:10)
          at shutdownTask_.MicroTask (/home/magjac/git/ng6-stompjs-demo/node_modules/selenium-webdriver/lib/promise.js:2599:53)
      From asynchronous test: 
      Error
          at Suite.<anonymous> (/home/magjac/git/ng6-stompjs-demo/e2e/src/app.e2e-spec.ts:10:3)
          at Object.<anonymous> (/home/magjac/git/ng6-stompjs-demo/e2e/src/app.e2e-spec.ts:3:1)
          at Module._compile (module.js:653:30)
          at Module.m._compile (/home/magjac/git/ng6-stompjs-demo/node_modules/ts-node/src/index.ts:400:23)
          at Module._extensions..js (module.js:664:10)
          at Object.require.extensions.(anonymous function) [as .ts] (/home/magjac/git/ng6-stompjs-demo/node_modules/ts-node/src/index.ts:403:12)

**************************************************
*                    Failures                    *
**************************************************

1) workspace-project App should display welcome message
  - Failed: script timeout: result was not received in 11 seconds
    (Session info: chrome=70.0.3538.67)
    (Driver info: chromedriver=2.45.615279 (12b89733300bd268cff3b78fc76cb8f3a7cc44e5),platform=Linux 4.15.0-42-generic x86_64)

Executed 1 of 1 spec (1 FAILED) in 12 secs.
[13:16:34] I/launcher - 0 instance(s) of WebDriver still running
[13:16:34] I/launcher - chrome #01 failed 1 test(s)
[13:16:34] I/launcher - overall: 1 failed spec(s)
[13:16:34] E/launcher - Process exited with error code 1
An unexpected error occured: undefined
~/git/ng6-stompjs-demo$ 
kum-deepak commented 5 years ago

The test cases in this repository (both Karma and e2e) do not do anything. This repository acts a sample code for usage of @stomp/ng2-stompjs.

If you are looking for sample code, please head to the updated version at https://github.com/stomp-js/ng2-stompjs-angular7

If you are looking for the test cases for @stomp/ng2-stompjs, please head to https://github.com/stomp-js/ng2-stompjs and check folder src/specs/

magjac commented 5 years ago

Thanks for the quick reply. I'm trying to use e2e testing with protractor of my application that uses the ng2-stompjs library and I noticed that the e2e tests here gives the same error as my own tests. That's why I filed this issue.

The tests you refer to are not e2e protractor tests. I'll have a look at https://github.com/stomp-js/ng2-stompjs-angular7/tree/master/e2e, though.