How to compare view?

How to compare view & decide the flow of testing?
For eg. My Login page is having multifactor authentication if user has enabled it. How can I write a generic code to test if MFA is present then test one flow, if not, then another flow?