Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't debug E2E tests using node 8.10 #676

Closed
adiherzog opened this issue Apr 27, 2018 · 7 comments
Closed

Can't debug E2E tests using node 8.10 #676

adiherzog opened this issue Apr 27, 2018 · 7 comments
Assignees
Labels
1 - Ready Huboard Swimlane Ready Prio-1-Blocker needs to be done for next release Prio-2-Important accepted as an important feature/issue that we should address in next releases topic:infrastructure type:Bug Bug

Comments

@adiherzog
Copy link
Member

adiherzog commented Apr 27, 2018

When using the browser.pause() statement to debug a protractor test using node 8.10, I get this error:

module.js:549
    throw err;
    ^

Error: Cannot find module '_debugger'
    at Function.Module._resolveFilename (module.js:547:15)
    at Function.Module._load (module.js:474:25)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (D:\Code\scenarioo\scenarioo-client\node_modules\protractor\built\debugger\debuggerCommons.js:1:82)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)

The reason for this is that protractor does not support this kind of debugging anymore in node 8.x. See also: angular/protractor#4307

On the build server we still have node 6.11.5, so it's not a problem there.

I will locally downgrade node to the same version for now, but we should soon upgrade to the latest LTS version (8.x).

Acceptance Criteria:

@adiherzog adiherzog added type:Bug Bug infrastructure 1 - Ready Huboard Swimlane Ready Prio-1-Blocker needs to be done for next release labels Apr 27, 2018
@adiherzog adiherzog added this to the 4.0 - Diff Viewer Plus milestone Apr 27, 2018
@bruderol bruderol modified the milestones: 4.0 - Diff Viewer Plus, 4.X - Next Release May 8, 2018
@bruderol
Copy link
Member

bruderol commented May 8, 2018

I put it to next release - not realy relevant for this release

@adiherzog
Copy link
Member Author

adiherzog commented May 8, 2018

One reason we want to update to node 8.x is that in node 6.x the package-lock.json file is not written yet. Just discussed it with @bruderol and we decided to upgrade to node 8.11.1 LTS.

This means we will disable the Control Flow and start using async / await for making debugging possible.

See:

@bruderol
Copy link
Member

bruderol commented May 8, 2018

Thanks for the links - I think the removal of the control flow is bad - While I like the new possibilities of await of course, I think the new way of writing protractor tests with awaits is very very VERY error prone!!! because: if you forget one await it will not be guaranteed in what order the commands are executed and you will get unstable tests.

this situation is unacceptable to me and we will have to find a way how we can mitigate that problem or whether we should maybe just use a real synchronous test api then - because: what is all this asynch API worth anyway if we then have to write an await before each API call, that is just bad!!! I am disappointed of protractor they do not provide a better answer to that, as far as I can see - or did I miss something???

@adiherzog
Copy link
Member Author

@bruderol The removal of the control flow is done in selenium-js and protractor just has to follow (see SeleniumHQ/selenium#2969). The control flow always was kind of a hack in my opinion as it made code look synchronous while in reality it was asynchronous. I much prefer a solution with regular promises that make the asynchronity visible.

The problem with missing awaits can be mitigated by enabling the no-floating-promises TSLint rule (https://palantir.github.io/tslint/rules/no-floating-promises/). Otherwise it's really quite dangerous.

Of course, a real synchronous API would be even better. http://webdriver.io/ promises that. I once did a small PoC with it and it actually seems to behave synchronously. Switching the test framework would be quite some work though.

@adiherzog adiherzog added the Prio-2-Important accepted as an important feature/issue that we should address in next releases label May 20, 2018
@bruderol
Copy link
Member

I wouldnt call it a hack. Just becasue something has some asynch complexity it does not necessarily mean it is a hack. Now without the guarantee of order anymore- I think it has become even more hacky.

@adiherzog adiherzog self-assigned this May 28, 2018
adiherzog added a commit that referenced this issue May 30, 2018
adiherzog added a commit that referenced this issue May 30, 2018
adiherzog added a commit that referenced this issue May 30, 2018
adiherzog added a commit that referenced this issue May 30, 2018
…rioo

This is currently still necessary because scenarioo-js uses the controlFlow
to save steps. Disabling the promise manager results in warning log messages
and missing step XMLs.
adiherzog added a commit that referenced this issue May 30, 2018
@bruderol
Copy link
Member

@adiherzog Is this still an issue or can we close??

@adiherzog
Copy link
Member Author

I just updated the documentation and will close the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1 - Ready Huboard Swimlane Ready Prio-1-Blocker needs to be done for next release Prio-2-Important accepted as an important feature/issue that we should address in next releases topic:infrastructure type:Bug Bug
Projects
None yet
Development

No branches or pull requests

3 participants