Some teams end up with three copies of their test suite, one per environment. They drift apart over a year. A bug fix lands in the staging copy and never reaches the production one, and nobody notices until the same bug ships twice.
One suite, many environments, is the only version of this that survives.
The base of it you already know: baseUrl in config, overridden at run time.