End-to-end testing automation guide with two-step verification for Marketplace partners
Platform Notice: Cloud Only - This article only applies to Atlassian apps on the cloud platform.
Summary
This article covers app testing for Marketplace partners and how to handle challenges from triggered security features.
App testing and security
Marketplace partners have end-to-end (E2E) tests that allow them to log in to Atlassian programmatically to test their apps. During login, these test accounts may trigger Atlassian account security features such as an email one-time password (OTP) challenge. Since app vendors use automated tests, these tests can't run smoothly.
There is no way to bypass these security features. Please remember that these workarounds may stop working as the Atlassian account service continues to evolve and change.
Suggestions
Here are five suggestions that may help navigate challenges relating to E2E testing at the time of writing (December 2024).
Switch to API tokens instead: Manage API tokens for your Atlassian account. This is not an option if Selenium type/style tests need to be run.
Set up two-step verification(2SV), also known as multi-factor authentication(MFA), on the test account: Start the process to configure two-step verification and programmatically type the generated OTP code after authentication with a password as part of the automated test. For more information, please see the time-based one-time password (TOTP) section below.
Set up security keys and complete the security key challenge programmatically: Use a security key (similar process to above).
Log in with a third-party account provider. See Log in with a third-party account for more information.
Configure/enable SAML for the test account and log in with those credentials for the automated test. This will require an Atlassian Guard subscription + your identity provider (IdP) if you don't already have one. See Configure SAML single sign-on with an identity provider.
TOTP
Please see the instructions below on setting up two-step verification and an example of a Typescript code which you can use to generate TOTP codes programmatically.
Log in to the test account with a password at id.atlassian.com.
Start the two-step verification configuration process as per: Start the process to configure two-step verification
Set up TOTP:
Select the Authenticator app
Once presented with this page, select Can't see the code.
Copy the "Key"
Use the key to generate the current TOTP
Compute TOTP using the generated Key example
import base32 from 'thirty-two'; import * as notp from 'notp'; const totpSecret = base32.decode('<Key>'); const totpCode = notp.totp.gen(totpSecret, { time: 30 });
(TypeScript)
Alternative example: https://github.com/atlassian/1time- see under "Prover"
Was this helpful?