Authentication with email
In this case, when you connect to your app or website, you receive an OTP or a connection magic link on your email account. To be able to automate in GSDL test, you have to configure your account with a disposable email, we support mailsac. Then GDSL can use mailsac API to retrieve the sent OTP or magic link.
Your authentication mechanism should authorize the use of the disposable email mailsac. If not possible, you can put an automatic rules on your email service provider to send the received email for authentication to the disposable email mailsac. If not possible, you can sent manually the received email with the OTP inside to the email mailsac. If all these is not possible, please choose another case Authentication
Create and configure a mailsac account
Your need to create a mailsac account.
Click on create an account in mailsac
in mailsac dashboard, create an email, enter an email and press the botton
check the email!
(you can if you preferred create a random one by clickingMake a random inbox now )
In your new inbox, click on button
make this inbox private
.
Then validate by clicking on field ‘Optional note or label’ and click on the ‘Reserve and configure’ button. Validate API mailsac can now read, delete email of your inbox.
Create your own private API key by clicking on menu
API Keys & Users
and then click on buttonManage Keys
to generate your own private API key. Don't forget to save it in your PC.
You have your own disposable email with API key, you can use them in GDSL test.
GDSL examples
To use your new mailsac email in GDSL, please create an account on your site or app which log in with this email. The following are examples of using your mailsac email in GDSL
Example with OTP
# use OTP with mailsac, give the mailsac information (mail and api Key) to the GDSL test
# authInitMailsacOTP,[your_mailsac_email],[your_api_key] (you need to replace by your own email mailsac and your own api key)
authInitMailsacOTP,testotpgsu2@mailsac.com,k_SblR1fZz9bI6CDt43B26D05xxxxxxx
# Log into your app, for example a login / password form with a submit button
# you have to adapt to your own context
setTextById,mylogin,com.myapp:id/loginEditText
setTextById,mypassword,com.myapp:id/passwordEditText
waitUntilTextBeforeClick,submit
# At this time an OTP code should be sent to the mailsac email
# The sending can be automatic if the authentication mechanism sends directly to mailsac email
# or can be manual so you have to sent an email with the OTP inside to the mailsac email
# This method waits for an email during 10 minutes
authWaitAndStoreData
# Select the edit text of your app where to put OTP Code
# for example
clickByText,OTP code
# Then you can use this method to enter the OTP code in the edit text
authEnterStoredData
Example with Magic Link
# use magic link with mailsac, give the mailsac information (mail and api Key) to the GDSL test
# authInitMailsacMagicLink,[your_mailsac_email],[your_api_key] (you need to replace by your own email mailsac and your own api key)
authInitMailsacMagicLink,testotpgsu2@mailsac.com,k_SblR1fZz9bI6CDt43B26D05xxxxxxx
# Log into your app, for example a login / password form with a submit button
# you have to adapt to your own context
setTextById,mylogin,com.myapp:id/loginEditText
setTextById,mypassword,com.myapp:id/passwordEditText
waitUntilTextBeforeClick,submit
# At this time the magic link should be sent to your mailsac email
authWaitAndStoreData
# add the magic link to your opened browser in the device
browserGoToUrl,authEnterStoredData
pressEnter