My Team is adding MFA as an SDET how is the best way to test?

What is the best way to test MFA in a WebdriverIO test? How can we get the code?

Curious to know if there is a suggested way to test MFA authentication, our app will ask the user if they want to enroll in MFA. Then okta will send them an email. I don’t want to test finding an email i want to test that the code will enroll the user in MFA.

And then once they are enrolled that they get the MFA login experience each time.

I would love any suggestions in how to do this.

Hello Angel!

It sounds like you are looking to set up an MFA Policy for your app in Okta that you have interfaced with WebdriverIO, is that correct? If so, you can use Authentication Policies set up for your app specifically Authentication policies | Okta - this will ensure MFA is enrolled and enforced for that specific app, and all you should have to do is log into the app to test it out.

1 Like


No, I am asking how does Okta suggest we do e2e testing with 2FA where we have Okta send a code in an email directly to the user who is logging in?
Also, how do eliminate test Users from having to do 2FA each test?