Automation Testing: Why you need to consider migrating from nightwatch-api v3.0.1 to playwright?

Akarsh Seggemu, M.Sc.
3 min readMay 18, 2024

--

Nightwatch.js v1.7 did support TypeScript as it was meant for JavaScript. Igor Bari created nightwatch-api to support TypeScript. We should appreciate Igor Bari whole heartedly for creating nightwatch-api. Nightwatch.js v1.7 npm package offered for TypeScript developers a convenient way to control Nightwatch.js v1.7.

What is the relation between nightwatch-api and Nightwatch.js v1.7?

nightwatch-api is built as a wrapper to support TypeScript and it Nightwatch.js v1.7

How popular is Nightwatch.js v1.7?

Many developers have used nightwatch-api npm package in their Node.js projects. It is still being downloaded on a weekly basis.

npm package nightwatch-api

What happened after Nightwatch.js release v2.0?

With Nightwatch.js v2.0 release there is support for Cucumber.js. Nightwatch engineering blog has a detailed blogpost about Running Cucumber tests with Nightwatch.

This led in Mar 16, 2022, Igor Bari to update the README.md with the deprecation warning message.

nightwatch-api deprecation warning message

What happened to the Nightwatch v1.x to Nightwatch v2.x migration?

Nightwatch.js has created a migration guide to help with the migration from v1.x to v2.x. But this guide is not helpful for nightwatch-api npm package users as Nightwatch.js is only supporting cucumber.js when you are using JavaScript so TypeScript users are left out in the migration.

What would be the next steps?

  1. Someone has to fork the project nightwatch-api and create support for Nightwatch.js v2.0.
    Answer: No one has done forking of the project. I checked the Forks https://github.com/mucsi96/nightwatch-api/forks?include=active&page=1&period=&sort_by=stargazer_counts but I could not find a project where they worked on adding support for Nightwatch.js v2.0 or above.
  2. Move to a different testing framework where you can use cucumber.js and write tests in TypeScript. It should also support various features of Nightwatch.js v1.7 to support the migration to the new testing framework.
    Answer: We can check the comparison of Nightwatch.js with two leading testing frameworks. It is from Nightwatch.js and they were able to show which testing framework would be a good alternative.

Why you need to consider migrating from nightwatch-api v3.0.1 to playwright?

From my perspective after reading Nightwatch.js with two leading testing frameworks. I found playwright would be a good alternative.

Comparison of Nightwatch.js with two other testing frameworks

Considerations,

  1. Support for Running AUT before testing. Where users can start the AUT on specific ports before testing is started.
  2. It has integration with Visual Studio Code in the form of an extension.
  3. Support for multiple languages — Javascript, Typescript, Java, Python, .NET.

These three my considerations to migrate tests from Nightwatch.js v1.7 to Playwright.

If you like my articles, please follow me on Medium, you can also watch my videos on YouTube and you can also support me by buying me a coffee.

--

--

Akarsh Seggemu, M.Sc.

IT Team Lead | Post graduate Computer Science from TU Berlin | Telugu writings are found in this account https://medium.com/@akarshseggemu_telugu