Tandem Diabetes interview question

Write Python code to automate a testcase that logs-in and authenticates a user portal screen. Explain your reasoning at each step.