Reputation: 1392
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.
Upvotes: 0
Views: 13