Jun-19-2019, 01:16 PM
I have some automated test written in python. There is file named TestSteps.py that holds all the test methods. The file is getting too big holding too many methods. It looks like this
So how can I spread for example 'class Steps' into multiple files? Or how can I import all my test method from different files into a central files that would be 'TestSteps.py'?
#TestSteps.py import myModules class Steps: @staticmethod def test1(self): ... @staticmethod def test2(self): ... @staticmethod def testX(self):The file has now too many methods and I need to add more so I was thinking to split them into multiple files, for example TestSteps1, TestSteps2 etc. and inside TestSteps to import them like this:
#TestSteps.py import TestSteps1 reload(TestSteps1) from TestSteps1 import * ... import TestStepsX reload(TestStepsX) from TestStepsX import *I need to have all these test files 'stored' under TestSteps.py because of how everything is configured, how the test are executed etc. With the approach I've tried above only the tests from first file are executed, the rest are not found.
So how can I spread for example 'class Steps' into multiple files? Or how can I import all my test method from different files into a central files that would be 'TestSteps.py'?