Await and Async
Typescript and Javascript is asynchronous . This means in our test which has multiple steps there is no guarantee that they will be executed one after the other. Let us consider an example where we typically try to login to a website. Say, I want to book the book travel tickets. Below are the steps we follow manually. Step1: Go to the Travel website URL Step2: Provide Username and Password Step3: Click on Login button to get into the application If we can notice, all these steps are sequential in nature. if we try to miss step2 and with out credentials clicking on Login button would not take us to the application. Similarly, as we are trying to do automation ( web automation ), we should ensure all these steps are followed in sequence in above scenario. And we are relying on Typescript/Javascript to enable this automation. But we should understand that these are asynhronous. Meaning the steps can be executed in any order. So t...