We are all used to the fact that depending on the browser, the way our website is displayed may be slightly different. While much has been done in recent years to render HTML and CSS code the same on all browsers, we still need to keep our finger on the pulse.
Recently, I needed to test the functionality using as many browsers as possible. Most of the popular tools are limited to running tests in Chrome and Firefox. For me, the most important thing was the tests on their less popular competitors.
My choice fell on TestCafe – a tool with which we can write automatic tests using TypeScript, but the most interesting thing is that we can easily run the tests on almost all locally installed browsers.
TestCafe is a mature solution with well-written documentation and a large community.
After installing TestCafe:npm install -g testcafe
By running the command below:npx testcafe --list-browsers
We get a full list of locally detected browsers, in my case:chrome, firefox, ie, edge, edge-legacy, opera
Additionally, chrome and firefox can also be run with the headless flag.
Thanks to this, we are able to quickly write tests to verify functionality in multiple browsers.
We can also use available providers that allow integration with test services in the cloud, such as LambdaTest or Browserstack.
This opens up the possibility of running tests on over 2,000 devices, both emulated and physical.
This post is just a hooking piece, if you are interested in this topic then go to TestCafe documentation and see for yourself if it is worth using this tool in your case.