I am doing some test automation. I create a scratch org and a user with a generated password. However, I am running a test script which opens up its own browser. I fill in the username and generated password but is always ask for the verification code. I would like the the test user to log in without verification. As this an automation and spins off a scratch org everytime, we cannot manually set the trusted IP range. So is there a way to do this in a settings file? or is there other ways to do what I'm trying to do? Seems this is very typical scenario for test automation.
1 Answer
I believe the correct metadata type for this is SecuritySettings
https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_securitysettings.htm - if DX can successfully push this to the scratch org before your test script opens the browser, it should bypass the verification code.
Searching seems to suggest DX supports this non-packageable metadata type.
-
That's exactly what I was going to say. You could even force:mdapi:deploy if you had to.– sfdcfoxFeb 14, 2018 at 3:29
sfdx force:org:open -u <username>
in your script?