You can create a code behind file for each test where you can implement coded steps and custom test classes.
There are two methods of creating a coded behind file for your test:
Add a Coded Step from the Step Builder.
Right click the test and select Add Code-Behind.
Select coding language.
Both actions create a code-behind file with an empty test method where you can implement your custom code. Each code behind file can contain multiple test methods.
See Coded Steps article which describes how to execute the code in the test method.
You can also implement multiple test classes in a single code behind file. If methods of the test class will be bound to coded steps the class must inherit IOSTestBase, AndroidTestBase or WebTestBase class depending on the type test you are using as shown below.
In order to use the methods from a particular class you should bind the test to that class. You can do this from the test's properties, select the test from the Project Explorer so its properties are shown in the Properties pane.