Learn how to write #Nightwatch.js automated tests and page objects using #TypeScript instead of JavaScript in this programming tutorial. This lesson will provide examples converting an existing JavaScript Nightwatch js test suite that uses the page object model to use TypeScript with the types from the DefinitelyTyped Nightwatch type definitions.
TypeScript has advantages over using JavaScript to write your Nightwatch tests because you get type checking and intellisense which helps reveal commands available in the API more easily as well as identify errors in your test code before you run the test.
You'll like using Nightwatch more than #Selenium if you haven't tried it before.
For the accompanying article see https://www.davidmello.com/using-nightwatch-with-typescript/
For the source code please visit https://github.com/reallymello/nightwatchTutorials/tree/master/pomTypeScriptExample
Chapters:
0:00 Advantages of using TypeScript
0:30 Nightwatch TypeScript test suite setup
4:54 Converting Nightwatch page object to TypeScript
7:48 Converting Nightwatch test to TypeScript
10:42 Running Nightwatch JS TypeScript tests