angular / protractor

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

runWaitForAngularScript returns true when testing an Agular2 app #3363

Closed calendir closed 8 years ago

calendir commented 8 years ago

I'm having a similar issue to angular#7821 when testing an app build with Angular 2.0.0-rc.3, using either Protractor 3.3.0 or 4.0.0.

TypeError: Cannot assign to read only property 'stack' of Error while waiting for Protractor to sync with the page: true
         at node_modules/protractor/built/element.js:377:21
         at Promise.invokeCallback_ (node_modules/selenium-webdriver/lib/promise.js:1329:14)
         at TaskQueue.execute_ (node_modules/selenium-webdriver/lib/promise.js:2790:14)
         at TaskQueue.executeNext_ (node_modules/selenium-webdriver/lib/promise.js:2773:21)
         at node_modules/selenium-webdriver/lib/promise.js:2652:27
         at node_modules/selenium-webdriver/lib/promise.js:639:7
         at process._tickCallback (internal/process/next_tick.js:103:7)

There seem to be two issues:

  1. ElementArrayFinder.applyAction_ can't properly join a stack string and and actual stack (similar to #3224), but I assume that was simply never meant to occur.
  2. runWaitForAngularScript returns true instead of nada for some reason (I've specified rootElement in my config file, so it goes the classic waitForAngular route).

Any help would be greatly appreciated.

sjelin commented 8 years ago

Currently protractor is swallowing the error. Could you wait for https://github.com/angular/protractor/pull/3372 and then try again?

calendir commented 8 years ago

The message got much more informative after I applied the patch manually :wink: It remained the same after updating to 4.0.2 as well.

Error
         at ElementArrayFinder.applyAction_ (node_modules/protractor/built/element.js:395:27)
         at ElementArrayFinder._this.(anonymous function) [as click] (node_modules/protractor/built/element.js:97:30)
         at ElementFinder._this.(anonymous function) [as click] (node_modules/protractor/built/element.js:728:22)
         at NodeListPage.clickNodeByName (steps/pages/foc/NodeListPage.js:18:41)
         at [object Object].<anonymous> (steps/focSteps.js:14:39)
         at _combinedTickCallback (internal/process/next_tick.js:67:7)
         at process._tickCallback (internal/process/next_tick.js:98:9)
calendir commented 8 years ago

Any news on this? It's sort of a blocker for me, actually.

cnishina commented 8 years ago

This has been addressed in 4.0.3 - closing this issue.

Please try this again.

calendir commented 8 years ago

I don't see how it could possibly have been fixed between 4.0.2 and 4.0.3, and I assure you it still persists on 4.0.3, unfortunately :disappointed: