NO.
I would not suggest doing so until you have a specific objective to be met by doing it.
In my opinion, its only worth the effort if you are working on large development project but for comparatively smaller UI automation projects with less than 1K tests, I would not suggest so.
Also, there are a lot of misconceptions about the advantages of moving from javaScript to TypeScript:
- Object-oriented Features:- Like types/classes, we may use many of these features natively from ES6 in javaScript and we can transpile down with Babel if required.
- Easier than JavaScript: It is not. It is still a superset of JavaScript, in fact, additional type noise particularly for UI test automation.
- Strong typing means error proof: Strong typing only safeguards a certain class of errors but not all the errors and at the cost of extraneous syntax which is an overkill for UI test automation.
As far as static type checking as a feature is concerned, it can also be achieved using Facebook’s Flow.