The question asked in The Test Chat community on 14th June 2025 22:42,
Hi All,
Has anyone implemented test automation for an application that uses a magic link for login?
If yes, could you please share the approach you followed?
Thanks in advance🙏🙏
My Analysis and Understanding
- The question asked is around automation.
- That is, how to automate to use the link (hypertext) generated for login.
- There are several ways to approach this, via
- GUI
- API
- Combination of GUI and API
- I prefer to use it in combination of GUI and API for first without using any email client services and app.
- Why?
- I want to keep it simple, quick and not to complicate the testing problems much more.
Solution and Approach
I see, it is not a complicated Test Engineering problem unless the project and floor do not support.
I understand, it is about using a link (hypertext) to login into a application via automation.
How do you get this hypertext?
- It should be generated somewhere within the system's boundary.
- Can you get that generated hypertext without using any mail client and its service points? How?
- Do you have an endpoint that generates this hypertext?
- If so, then this endpoint should also have some means to share the generated hypertext for login request?
- Pick this generated hypertext via an API request in your automation.
- This should work! Unless the test goal in the automation is not to open some configured mail client and read the received mail.
- But, how many times will you do this in automation, if the goal is to open configured mail client?
- Is this a good use of automation?
If there is an endpoint to GET that generated hypertext (POST), it is a fair simple task.
Say, there is no endpoint with GET request to give the generated hypertext. Then, look at the response payload of POST request that generates the login hypertext. Consume this hypertext now and use it in GUI automation to login. Say, there is no response payload in POST request. Ask your team to build a GET request to consume internally and maintain it securely so that no external access is allowed.
Let us keep the testing problems simple!
No comments:
Post a Comment
Please, do write your comment on the read information. Thank you.