This is basically a matter of style. You can easily create a set of "default" commands in a helper function called by the test, and then a more explicit alternative version that installs them differently.
This helper can also have a function parameter for a given value to return from a specific layout.
Some people believe that each test should be completely independent of each other, except for a very common installation, and should do everything in itself. This makes it explicit with respect to what is happening (which is very clear and obvious what is happening), but at the potential cost of duplicating the code. It is your choice, however, if you prefer not to repeat too much.
source share