Journey from Callback to Promises to Async/Await

In this world of asynchronicity, where it is easy to build applications using single page application frameworks, people struggle at the writing functional tests for such applications.

Understanding this asynchronous nature of newer tools and frameworks needs efforts. In this talk we will talk about our journey from writing test with callback (hell) to using Promises and finally achieving nirvana with the power of async/await in JavaScript.

This is a time travel of asynchronous programming and where does the future lie. The discussion will include:

  • Callbacks and their nested nature
  • Removing callbacks with Promises
  • And migrating to async/await

4 favorite thumb_down thumb_up 2 comments visibility_off  Remove from Watchlist visibility  Add to Watchlist

Outline/Structure of the Talk

The session will cover the following aspects:

  • Efficient way to write functional tests for asynchronous applications
  • How to manage asynchronous operations in your tests
  • How to handle errors in asynchronous operations
  • Writing and debugging tests using async/await

Learning Outcome

Learning from my experiments (what worked, or didn’t):

  • Understanding problems with callbacks and how to handle nested callbacks
  • Better way to manage callbacks
  • Approach to migrate to async/await

Though not directly intended, but we will also share some practices to make your automation code more readable.

Target Audience

Developers, Testers, Test Managers

schedule Submitted 1 year ago

Public Feedback

comment Suggest improvements to the Speaker
  • Pooja Shah
    By Pooja Shah  ~  1 year ago
    reply Reply

    Interesting "Async" word in itself brings a great possibility that a good set of people would want to attend this talk. Thanks, Smriti and Shirish for submitting this. 

    I'm invested to understand it more. What is the pre-knowledge required to attend this talk? People writing javascript tests or it's a common approach and can be plugged in with same tests written in any of selenium/protractor bindings?



    • Shirish Padalkar
      By Shirish Padalkar  ~  1 year ago
      reply Reply

      Hi Pooja,

      The primary audience is people who write tests using webdriver-js based frameworks because of examples would be in JavaScript.

      However, we think that the concepts of Promises and async/await very well translates to other languages and frameworks which have asynchronous drivers / bindings.

  • Liked Sanjay Kumar

    Sanjay Kumar - ChroPath - a smarter way to get locators and verify them.

    Sanjay Kumar
    Sanjay Kumar
    ChroPath Creator
    schedule 1 year ago
    Sold Out!
    20 Mins

    still writing relative xpath manually ?

    Do you want to save 20-30% time of automation script writing ?

    Feeling frustrated while writing unique locators ?

    looking for firepath replacement ?

  • Liked Smriti Tuteja

    Smriti Tuteja / Krunal Patel - Join the Night's Watch

    45 Mins

    As ReactJS is overpowering AngularJS as the go-to framework for front end development, testers tend to find the best tool which suits all of their needs in the javascript world.

    Join this talk to learn about "Why and How to use the Power of NightWatch" as compared to other existing popular automation frameworks in the testing industry today such as Protractor, CasperJS :

    • how NightWatch makes test code highly transparent and readable
    • how NightWatch adds layer of abstraction separating the HTML selectors from the page objects, thus, enabling reuse and promoting general tidiness in comparison to other testing tools
    • how running tests against specific browsers/environments in parallel is relatively easy with NightWatch
    • how it solves the problem of tests re-write (say login for use in multiple cases)
    • how you can extend/enhance your tests using custom commands, custom assertions and custom reporters
    • how you can automate mobile apps integrating NightWatch with Appium
  • Liked Smriti Tuteja

    Smriti Tuteja - Migrate to Headless Chrome with Protractor

    Smriti Tuteja
    Smriti Tuteja
    Sr. Consultant
    schedule 1 year ago
    Sold Out!
    20 Mins
    Experience Report

    In this era of automation where everyone is focused on Agile and DevOps, learn how you can migrate from xvfb (X virtual framebuffer which enabled you to run browser tests without a display on a CI server) to Headless Chrome while you use Protractor.
    Attend this talk to understand how I migrated to headless chrome and the pain points. The discussion will include:

    • things you can take care of when migrating
    • checking versions compatibility for migration
    • things you will need to fix