admin管理员组文章数量:1278722
I want to create e2e tests using TestCafe for an web application that is build with Angular and uses an Authorization Code Flow with PKCE.
From my experience, the application must trigger the login in order to set required parameters like the state, nonce, redirect_uri among other things.
TestCafe offers the Role feature. From my point of understanding, it will not work with my flow, because TestCafe directly goes to the login page and tries to login, so it cannot set the required parameters.
Using some helper functions and the beforeEach
hook in a fixture, I can login myself, without using the Roles feature. However, since between each test, TestCafe clears the localStorage, sessionStorage etc. each test has to login each time. In this case, it would be good to share that login information (which a Role would do).
Since the whole application is protected, it will automatically redirect to the login page, which also needs to be handled by testcafe.
I'm looking for the correct approach to use TestCafe in an Authorization Code Flow scenario with the possibility of sharing the login data between multiple tests.
版权声明:本文标题:What is the correct approach to use TestCafe that tests a SPA using Authorization Code Flow? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741243902a2364508.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论