Usually, automated test independence means that the automated test should not depend on other tests being executed before it. When using TestNG, you should not use the dependsOnMethods, dependsOnGroups and priority attributes since they lead to dependent tests.
But is test independence only about tests running in any order?
There are a few other things that should be considered in my opinion:
application environment
The automated test should work the same in any application environment: dev, test and prod.
browser
The automated test should work the same in any modern browser (chrome, firefox, edge).
run location type
The automated test should run correctly
locally, using a local browser
remotely, in a virtual machine, using a browser installed on the virtual machine
head mode
The automated test should run correctly
in headed mode, locally
in headless mode, without the UI, locally
in headless mode, without the UI, in a docker container
site language
If the site supports multiple languages, the automated test should work correctly in all languages.
This means that the locator of the elements should not depend on the selected language.
Thanks for reading.
