Migrate Protractor E2E tests to async / await
I'm really tired of long chains of .then() in Protractor E2E tests, especially when loops and checking conditions in loops are needed. Decided I need some motivation so took a look to the future: tried to migrate a small set of tests writing in async / await style. Installed latest Node.js (7.9.0) and Protractor (5.1.1). Here comes the first surprise. "Nothing works" after disabling Selenium promise manager in Protractor config. That's why: https://github.com/angular/protractor/issues/4186 Fortunately, the issue is fixed a few days ago here: https://github.com/angular/jasminewd/pull/87 Apply this fix to my local version of jasminewd and try again. "Everything works!" Well, at least browser opens the page. Lessons learned while rewriting code: Async / await is good! The code becomes much more readable and much more easier to maintain. Try / catch in async / await structures allow better error message handling, which is so important for E2E t...

Comments
Post a Comment