如何在cypress中实现MS Azure广告身份验证的自动化,我们必须在应用程序中实现基于用户的登录,因此我们需要使用不同的用户名和密码多次登录
最佳答案
[Note:Small suggestion is that it might not be a good practice to automate login , as that action might be detected as a bot and block it, causing your tests to break.]
- 在cypress代码中,可以使用自定义命令进行身份验证。这些 命令用于添加或覆盖其中的功能 Cypress 和 在 cypress/support/commands.js 文件中定义为 默认。
- 可以引用以下链接以获取有关 cypress 测试中 AD 身份验证的更多信息 https://mechanicalrock.github.io/2020/05/05/azure-ad-authentication-cypress.html
- https://learn.microsoft.com/en-us/azure/active-directory/develop/v2-oauth2-client-creds-grant-flow 是有关使用 Azure AD 进行身份验证的有用文章,专门针对 无需任何形式的用户交互的服务帐户。
关于azure-active-directory - Cypress AzureAD 身份验证自动化,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68001942/