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

Async/await and browser.pause not working - workaround ? #4184

Closed
xnnkmd opened this issue Mar 27, 2017 · 6 comments
Closed

Async/await and browser.pause not working - workaround ? #4184

xnnkmd opened this issue Mar 27, 2017 · 6 comments

Comments

@xnnkmd
Copy link

xnnkmd commented Mar 27, 2017

I am using Async/await with SELENIUM_PROMISE_MANAGER set to false as noted by this great example by @sjelin

It seems to work except that browser.pause and browser.debugger fails to work (shows pause/debugger info on the screen but test terminates without pausing). Is that a known problem and/or is there a workaround ?

@murlinw
Copy link

murlinw commented Mar 27, 2017

I am having similar problems with browser.pause() not working with version 5.1.1. A workaround I'm doing is just using browser.sleep() with a very long timeout.

@xnnkmd
Copy link
Author

xnnkmd commented Mar 29, 2017

I think this is a quite pressing problem. As noted on gitter today: "the strange situation with protractor is that you can either write easy code (with async/await) that is hard to debug or dificult code (with promises/callbacks) that is easy to debug." (because of this issue)

@tiagomsmagalhaes
Copy link

I updated today to 5.1.1 and have problems with browser.pause()

@xnnkmd
Copy link
Author

xnnkmd commented Mar 31, 2017

@tiagomsmagalhaes Are you using async/await in your code with "SELENIUM_PROMISE_MANAGER: false" as noted in the documentation? What version of node are you using ?

@tiagomsmagalhaes
Copy link

@xnnkmd nope. node version is 6.10.1. I'm working with AngularJS so I suppose i don't need that (??)

@heathkit
Copy link
Contributor

SELENIUM_PROMISE_MANAGER=false disables Selenium's control flow, which will break browser.pause(). However, the big advantage of not using managed promises is the ability to debug your tests with regular NodeJS tools.

I updated the async/await example example to show how you might write tests in TypeScript and debug them with Chrome's devtools. Note that you'll need Node v7 for sourcemaps to work.

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

No branches or pull requests

4 participants