As mentioned in the starting post. This section explaining Page object model with a scenario. Let's say you've got a Login and Registration page to automate. I've created an application with the help of the Python Flask framework and we can use it for explaining the scenario. The application has two pages, Login and Registration as shown below
Login page
Registration pageBase class - The base class contains common test methods like Wait_for_Element, Click_Element and Common methods, etc
Login and Registration class - Login and Registration classes are inherited from the Base class. It should contain the UI elements and methods required. Each class file should be independent and should not share any common code. Let's have an example with the Login class, it should contain the UI properties of the Username, Password, and Submit button and its methods are login(), invalid_username(), invalid_password() etc.