protractor icon indicating copy to clipboard operation
protractor copied to clipboard

runWaitForAngularScript returns true when testing an Agular2 app

Open calendir opened this issue 10 years ago • 5 comments

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.

calendir avatar Jul 13 '16 11:07 calendir

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

sjelin avatar Jul 14 '16 01:07 sjelin

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 avatar Jul 22 '16 08:07 calendir

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

calendir avatar Aug 05 '16 11:08 calendir

This has been addressed in 4.0.3 - closing this issue.

Please try this again.

cnishina avatar Aug 23 '16 21:08 cnishina

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:

calendir avatar Aug 25 '16 10:08 calendir