My page object file has grown to over 5000 lines. I have arranged the file into classes such as login_screen
, landing_screen
, profile_screen
, settings_screen
, and so on. I am considering splitting the file to into multiple files by moving each class into its own file. Is it possible to split the page objects files this way without having to import all the individual files (containing each class) but simply import a base page into the test files which makes all the the classes available. If yes, how can these be implemented? I welcome other suggestions. See an example of one of the classes in the page objects file below:
class login_screen(BasePage):
"""login screen"""
def __init__(self, driver):
super().__init__(driver)
def login_user(self, username, password):
"""Log in as an existing user"""