SlideShare a Scribd company logo
Welcome to presentation wizard
Modern Features in ProtractorJS framework
Oleksandr Khotemskyi 2017
• Async/Await – a hero we deserved
• Deprecation of control flow – what to do next?
• TypeScript – superset of javascript
• Blocking proxy – waitForAngular for everyone
• Webdriver-manager features
• Bonus
QA Fest 2017. Александр Хотемской. Современные возможности в организации ProtractorJS фреймворка
Asynchronous code
• Harder for humans, easier for computer
• Task does not wait for previous task to complete
• Order of tasks should be specified explicitly by callbacks
• Consumes much less resources than splitting to threads
• Asynchronous code allows to work with IO operations
much more efficiently
QA Fest 2017. Александр Хотемской. Современные возможности в организации ProtractorJS фреймворка
Tests are synchronous by their nature
• Each step in UI functional tests should be done in strict
order
• This requires “synchronization” approaches of
asynchronous code:
• Callbacks
• Promises chaining
• Generators
• Fibers, corutines
• Async/Await
• other
Control Flow
• WebdriverJS now uses variation of task queue approach
Control Flow
• Increased complexity – this module is 3300 lines of code
• One of the hardest thing to understand in WebdriverJS
• Hard to debug
QA Fest 2017. Александр Хотемской. Современные возможности в организации ProtractorJS фреймворка
Async/Await
• Native approach to synchronize your asynchronous
code
• Hides internal Promises based implementation
• Introduced as part of ECMAscript 7 specification
QA Fest 2017. Александр Хотемской. Современные возможности в организации ProtractorJS фреймворка
With control flow
Without Control Flow
Handling errors
Iterating
More functional style Iterating
How to enable
• NodeJS >7.8 or use Babel
• For TypeScript – async/await could be compiled to ES3
compatible code
• Set - SELENIUM_PROMISE_MANAGER: false in your
protractor config file
• DO NOT mix control flow and async/await code –
execution flow will be unpredictable
QA Fest 2017. Александр Хотемской. Современные возможности в организации ProtractorJS фреймворка
Control flow is deprecated
• https://github.com/SeleniumHQ/selenium/issues/2969
• Phase 1: allow users to optionally turn off of the
control flow
• Phase 2: (October 2017) users must turn on the control
flow
• Phase 3: (October 2018) removing the control flow
Be ready for deprecation
• Set - SELENIUM_PROMISE_MANAGER: true in your
protractor config file explicitly right now (or env variable
SELENIUM_PROMISE_MANAGER : 1)
• This will give you one year to migrate your code away
from control flow
• More instructions and tips here:
https://github.com/SeleniumHQ/selenium/wiki/WebDri
verJs#moving-to-asyncawait
SELENIUM_PROMISE_MANAGER
QA Fest 2017. Александр Хотемской. Современные возможности в организации ProtractorJS фреймворка
TypeScript lang
• Developed by Microsoft, open
source
• Compiles into JavaScript
• Optional types
• ProtractorJS written with
TypeScript
QA Fest 2017. Александр Хотемской. Современные возможности в организации ProtractorJS фреймворка
QA Fest 2017. Александр Хотемской. Современные возможности в организации ProtractorJS фреймворка
QA Fest 2017. Александр Хотемской. Современные возможности в организации ProtractorJS фреймворка
QA Fest 2017. Александр Хотемской. Современные возможности в организации ProtractorJS фреймворка
Private methods
Some features
• ES6 imports/exports
• async/await
• Mixins, Enums, Interfaces, Abstract Classes
• Iterators/Generators
• Generics
• Property/class/parameter decorators (experimental)
QA Fest 2017. Александр Хотемской. Современные возможности в организации ProtractorJS фреймворка
Blocking Proxy
• Automatically executes waitForAngular before any
selenium action. Blocks actions execution
• Works on network level, not language level
• Can highlight interactions
• Can additionally log requests
• Works with any language
Your tests
Selenium
Server
Browser
Blocking
Proxy
Driver
(2) Selenium action
(1) waitForAngular()
QA Fest 2017. Александр Хотемской. Современные возможности в организации ProtractorJS фреймворка
Webdriver-manager
• Can setup Android SDK and virtual mobile devices
https://github.com/angular/webdriver-
manager/blob/master/docs/mobile.md
• Can install Appium
• Can download and prepare any version of webdriver
and selenium-standalone server
• `clean` and `status` - are useful to check what happens
Useful links
• Modern generator with async/await, TS, and other:
https://github.com/Xotabu4/generator-modern-
protractor
• Some examples from this presentation -
https://github.com/Xotabu4/modern_protractor_demo
• Blocking-proxy - https://github.com/angular/blocking-
proxy
• Webdriver-manager -
https://github.com/angular/webdriver-manager
http://www.xotabu4.github.io
QA Fest 2017. Александр Хотемской. Современные возможности в организации ProtractorJS фреймворка
QA Fest 2017. Александр Хотемской. Современные возможности в организации ProtractorJS фреймворка

More Related Content

PDF
Selenoid: browsers in containers
PDF
Selenoid
PDF
Scalable Selenium cluster: up and running
PDF
Mobile automation: a three act tragedy
PDF
Jenkins & Selenium
PPTX
Selenium Automation at Incapsula
PPTX
Extreme Testing with Selenium - @hugs at Jenkins User Conference 2011
KEY
Testing with Jenkins, Selenium and Continuous Deployment
Selenoid: browsers in containers
Selenoid
Scalable Selenium cluster: up and running
Mobile automation: a three act tragedy
Jenkins & Selenium
Selenium Automation at Incapsula
Extreme Testing with Selenium - @hugs at Jenkins User Conference 2011
Testing with Jenkins, Selenium and Continuous Deployment

What's hot (20)

PPTX
Parallel Testing with Python with Selenium and Sauce Labs
PPTX
Controlling the browser through python and selenium
PPT
Selenium
PPTX
Selenium
PPTX
Run Selenium Tests With Jenkins and BrowseEmAll
PPTX
Smarter ways to do selenium automation @ work, Selenium, automation
PPT
Selenium By Pravin Mishra
PDF
Automation Testing
PPTX
Selenium
PPT
Selenium 2: The Future of Selenium is now!
PDF
Introduction to Selenium Automation
PDF
Victor Dyptan.Using Selenium IDE for automated testing.Drupal Camp Kyiv 2011
PPTX
Selenium-Grid-Extras
PPTX
Selenium presentation
PPT
Selenium (1)
PPTX
Docker and Selenoid - Make Autotests Great Again
PDF
What type of testing is selenium commonly used for?
PPTX
Cross browser testing
PDF
Automated Web Testing With Selenium
PPTX
An Overview of Selenium
Parallel Testing with Python with Selenium and Sauce Labs
Controlling the browser through python and selenium
Selenium
Selenium
Run Selenium Tests With Jenkins and BrowseEmAll
Smarter ways to do selenium automation @ work, Selenium, automation
Selenium By Pravin Mishra
Automation Testing
Selenium
Selenium 2: The Future of Selenium is now!
Introduction to Selenium Automation
Victor Dyptan.Using Selenium IDE for automated testing.Drupal Camp Kyiv 2011
Selenium-Grid-Extras
Selenium presentation
Selenium (1)
Docker and Selenoid - Make Autotests Great Again
What type of testing is selenium commonly used for?
Cross browser testing
Automated Web Testing With Selenium
An Overview of Selenium
Ad

Similar to QA Fest 2017. Александр Хотемской. Современные возможности в организации ProtractorJS фреймворка (20)

PPTX
Protractor survival guide
PPTX
Continuous Integration for OpenVMS with Jenkins
PDF
Versioning for Developers
PPTX
Test automation proposal
PPTX
AngularJS - Architecture decisions in a large project 
PPTX
QA Challenge Accepted 4.0 - Cypress vs. Selenium
PDF
ESIGate dev meeting #4 21-11-2013
PPTX
Ansible benelux meetup - Amsterdam 27-5-2015
PDF
CFWheels - Pragmatic, Beautiful Code
PPTX
Magento 2 Workflows
PPTX
Building a document e-signing workflow with Azure Durable Functions
PDF
How do JavaScript frameworks impact the security of applications?
PPTX
Selenium practical
PDF
Play Framework and Activator
PPTX
Lecture05.pptx
PDF
Building Awesome APIs with Lumen
PPTX
Session 41 - Struts 2 Introduction
PPSX
Struts 2 - Introduction
PPTX
Azure Functions in Action #CodePaLOUsa
PDF
Azure functions
Protractor survival guide
Continuous Integration for OpenVMS with Jenkins
Versioning for Developers
Test automation proposal
AngularJS - Architecture decisions in a large project 
QA Challenge Accepted 4.0 - Cypress vs. Selenium
ESIGate dev meeting #4 21-11-2013
Ansible benelux meetup - Amsterdam 27-5-2015
CFWheels - Pragmatic, Beautiful Code
Magento 2 Workflows
Building a document e-signing workflow with Azure Durable Functions
How do JavaScript frameworks impact the security of applications?
Selenium practical
Play Framework and Activator
Lecture05.pptx
Building Awesome APIs with Lumen
Session 41 - Struts 2 Introduction
Struts 2 - Introduction
Azure Functions in Action #CodePaLOUsa
Azure functions
Ad

More from QAFest (20)

PDF
QA Fest 2019. Сергій Короленко. Топ веб вразливостей за 40 хвилин
PPTX
QA Fest 2019. Анна Чернышова. Self-healing test automation 2.0. The Future
PPTX
QA Fest 2019. Doug Sillars. It's just too Slow: Testing Mobile application pe...
PDF
QA Fest 2019. Катерина Спринсян. Параллельное покрытие автотестами и другие и...
PDF
QA Fest 2019. Никита Галкин. Как зарабатывать больше
PDF
QA Fest 2019. Сергей Пирогов. Why everything is spoiled
PDF
QA Fest 2019. Сергей Новик. Между мотивацией и выгоранием
PPTX
QA Fest 2019. Владимир Никонов. Код Шредингера или зачем и как мы тестируем н...
PPTX
QA Fest 2019. Владимир Трандафилов. GUI automation of WEB application with SV...
PDF
QA Fest 2019. Иван Крутов. Bulletproof Selenium Cluster
PPTX
QA Fest 2019. Николай Мижигурский. Миссия /*не*/выполнима: гуманитарий собесе...
PDF
QA Fest 2019. Володимир Стиран. Чим раніше – тим вигідніше, але ніколи не піз...
PPTX
QA Fest 2019. Дмитрий Прокопук. Mocks and network tricks in UI automation
PDF
QA Fest 2019. Екатерина Дядечко. Тестирование медицинского софта — вызовы и в...
PDF
QA Fest 2019. Катерина Черникова. Tune your P’s: the pop-art of keeping testa...
PDF
QA Fest 2019. Алиса Бойко. Какнезапутаться в коммуникативных сетях IT
PPTX
QA Fest 2019. Святослав Логин. Как найти уязвимости в мобильном приложении
PPTX
QA Fest 2019. Катерина Шепелєва та Інна Оснач. Що українцям потрібно знати пр...
PDF
QA Fest 2019. Антон Серпутько. Нагрузочное тестирование распределенных асинхр...
PPTX
QA Fest 2019. Петр Тарасенко. QA Hackathon - The Cookbook 22
QA Fest 2019. Сергій Короленко. Топ веб вразливостей за 40 хвилин
QA Fest 2019. Анна Чернышова. Self-healing test automation 2.0. The Future
QA Fest 2019. Doug Sillars. It's just too Slow: Testing Mobile application pe...
QA Fest 2019. Катерина Спринсян. Параллельное покрытие автотестами и другие и...
QA Fest 2019. Никита Галкин. Как зарабатывать больше
QA Fest 2019. Сергей Пирогов. Why everything is spoiled
QA Fest 2019. Сергей Новик. Между мотивацией и выгоранием
QA Fest 2019. Владимир Никонов. Код Шредингера или зачем и как мы тестируем н...
QA Fest 2019. Владимир Трандафилов. GUI automation of WEB application with SV...
QA Fest 2019. Иван Крутов. Bulletproof Selenium Cluster
QA Fest 2019. Николай Мижигурский. Миссия /*не*/выполнима: гуманитарий собесе...
QA Fest 2019. Володимир Стиран. Чим раніше – тим вигідніше, але ніколи не піз...
QA Fest 2019. Дмитрий Прокопук. Mocks and network tricks in UI automation
QA Fest 2019. Екатерина Дядечко. Тестирование медицинского софта — вызовы и в...
QA Fest 2019. Катерина Черникова. Tune your P’s: the pop-art of keeping testa...
QA Fest 2019. Алиса Бойко. Какнезапутаться в коммуникативных сетях IT
QA Fest 2019. Святослав Логин. Как найти уязвимости в мобильном приложении
QA Fest 2019. Катерина Шепелєва та Інна Оснач. Що українцям потрібно знати пр...
QA Fest 2019. Антон Серпутько. Нагрузочное тестирование распределенных асинхр...
QA Fest 2019. Петр Тарасенко. QA Hackathon - The Cookbook 22

Recently uploaded (20)

PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PDF
Insiders guide to clinical Medicine.pdf
PDF
Sports Quiz easy sports quiz sports quiz
PDF
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PPTX
Pharma ospi slides which help in ospi learning
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PDF
Computing-Curriculum for Schools in Ghana
PDF
Anesthesia in Laparoscopic Surgery in India
PDF
Complications of Minimal Access Surgery at WLH
PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PDF
O7-L3 Supply Chain Operations - ICLT Program
PPTX
master seminar digital applications in india
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PDF
RMMM.pdf make it easy to upload and study
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PPTX
Microbial diseases, their pathogenesis and prophylaxis
STATICS OF THE RIGID BODIES Hibbelers.pdf
Insiders guide to clinical Medicine.pdf
Sports Quiz easy sports quiz sports quiz
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
Pharma ospi slides which help in ospi learning
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
Computing-Curriculum for Schools in Ghana
Anesthesia in Laparoscopic Surgery in India
Complications of Minimal Access Surgery at WLH
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
102 student loan defaulters named and shamed – Is someone you know on the list?
O7-L3 Supply Chain Operations - ICLT Program
master seminar digital applications in india
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
FourierSeries-QuestionsWithAnswers(Part-A).pdf
RMMM.pdf make it easy to upload and study
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
Microbial diseases, their pathogenesis and prophylaxis

QA Fest 2017. Александр Хотемской. Современные возможности в организации ProtractorJS фреймворка

  • 1. Welcome to presentation wizard Modern Features in ProtractorJS framework Oleksandr Khotemskyi 2017
  • 2. • Async/Await – a hero we deserved • Deprecation of control flow – what to do next? • TypeScript – superset of javascript • Blocking proxy – waitForAngular for everyone • Webdriver-manager features • Bonus
  • 4. Asynchronous code • Harder for humans, easier for computer • Task does not wait for previous task to complete • Order of tasks should be specified explicitly by callbacks • Consumes much less resources than splitting to threads • Asynchronous code allows to work with IO operations much more efficiently
  • 6. Tests are synchronous by their nature • Each step in UI functional tests should be done in strict order • This requires “synchronization” approaches of asynchronous code: • Callbacks • Promises chaining • Generators • Fibers, corutines • Async/Await • other
  • 7. Control Flow • WebdriverJS now uses variation of task queue approach
  • 8. Control Flow • Increased complexity – this module is 3300 lines of code • One of the hardest thing to understand in WebdriverJS • Hard to debug
  • 10. Async/Await • Native approach to synchronize your asynchronous code • Hides internal Promises based implementation • Introduced as part of ECMAscript 7 specification
  • 17. How to enable • NodeJS >7.8 or use Babel • For TypeScript – async/await could be compiled to ES3 compatible code • Set - SELENIUM_PROMISE_MANAGER: false in your protractor config file • DO NOT mix control flow and async/await code – execution flow will be unpredictable
  • 19. Control flow is deprecated • https://github.com/SeleniumHQ/selenium/issues/2969 • Phase 1: allow users to optionally turn off of the control flow • Phase 2: (October 2017) users must turn on the control flow • Phase 3: (October 2018) removing the control flow
  • 20. Be ready for deprecation • Set - SELENIUM_PROMISE_MANAGER: true in your protractor config file explicitly right now (or env variable SELENIUM_PROMISE_MANAGER : 1) • This will give you one year to migrate your code away from control flow • More instructions and tips here: https://github.com/SeleniumHQ/selenium/wiki/WebDri verJs#moving-to-asyncawait SELENIUM_PROMISE_MANAGER
  • 22. TypeScript lang • Developed by Microsoft, open source • Compiles into JavaScript • Optional types • ProtractorJS written with TypeScript
  • 28. Some features • ES6 imports/exports • async/await • Mixins, Enums, Interfaces, Abstract Classes • Iterators/Generators • Generics • Property/class/parameter decorators (experimental)
  • 30. Blocking Proxy • Automatically executes waitForAngular before any selenium action. Blocks actions execution • Works on network level, not language level • Can highlight interactions • Can additionally log requests • Works with any language
  • 33. Webdriver-manager • Can setup Android SDK and virtual mobile devices https://github.com/angular/webdriver- manager/blob/master/docs/mobile.md • Can install Appium • Can download and prepare any version of webdriver and selenium-standalone server • `clean` and `status` - are useful to check what happens
  • 34. Useful links • Modern generator with async/await, TS, and other: https://github.com/Xotabu4/generator-modern- protractor • Some examples from this presentation - https://github.com/Xotabu4/modern_protractor_demo • Blocking-proxy - https://github.com/angular/blocking- proxy • Webdriver-manager - https://github.com/angular/webdriver-manager

Editor's Notes

  • #24: Проверка типов
  • #25: Проверка типов
  • #26: Проверка типов - ANY
  • #27: Автокомплит
  • #33: Автокомплит