Imagine that you have to automate tests of a web application that requires you to log in. Sometimes you want to ensure that multiple user roles can log in and do certains tasks. You can use the log in combo method and settings classes LoginForm1Step, LoginForm2Steps, and LoginCredentials to do this at scale.
Most websites process login in either one or two steps. This often means that the username and password fields are either on the same page or on separate pages.
Use LoginForm1Step when username and password are prompted on the same page.
Use LoginForm2Steps when username is prompted first, and then the option to input password appears later on the same or a separate page. The two-step variation is often to verify whether a user exists or not before password can be entered (or should be redirected to a registration page).
As LoginCredentials is independent of the login form, it works with both options.
Sometimes it's useful to let a flow be dependent of succesfull handling of the login form. This is possible by setting return_bool to True as parameter in the settings class and using a conditional if statement in combination with the login combo. For example:
Let's expand the example and imagine that a website can be personalised based on which user role is signed in. For instance, we want to ensure that only the admin role has visible access to an administration module.