-
Notifications
You must be signed in to change notification settings - Fork 141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do not clear localstorage on logout #1929
Do not clear localstorage on logout #1929
Conversation
Deleting identity numbers on logout is unexpected and destructive. A change was requested to no longer do that. Instead, we should give users a different way of managing the numbers shown on the landing page (to be solved as a separate PR). Note: 3 lines were changed in the production code. The rest is adapting the e2e tests to use the pick identity flow instead of entering it new.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why don't you clear the local storate between e2e tests?
I would differentiate e2e tests that require local storage filled and those that don't.
await browser.$("button[data-action='continue']").click(); | ||
const authenticateView = new AuthenticateView(browser); | ||
await authenticateView.waitForDisplay(); | ||
await authenticateView.pickAnchor(userNumber); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this e2e depend on logging in at some point before? Or at least on creating the anchor in the same machine without clearing the local storage?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, all tests that use the login
flow star from a different screen now.
@@ -32,16 +32,6 @@ export class WelcomeView extends View { | |||
await this.browser.$("#loginButton").click(); | |||
await this.browser.$("#addNewDeviceButton").click(); | |||
} | |||
|
|||
async recover(): Promise<void> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this move? Does it have something to do with clearing the local storage on logging out?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, see explanation here.
@@ -172,8 +165,8 @@ export const FLOWS = { | |||
browser: WebdriverIO.Browser, | |||
recoveryPhrase: string | |||
): Promise<void> => { | |||
const welcomeView = new WelcomeView(browser); | |||
await welcomeView.recover(); | |||
const authenticateView = new AuthenticateView(browser); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this change?
The user arrives at a different page if the storage is not cleared?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, see explanation here.
The local storage is cleared between each test. The reason why this has such a big impact on the e2e tests is because we have many variations of the initial landing screen:
There are more differences, but you get the idea. And now, having logout no longer clear the local storage, makes the e2e tests that use logout in the middle (i.e. create identity, logout, do some other action with sign-in / recovery) use a different screen. |
In the Flows, you have different names and methods depending on where the flow starts: Wouldn't it make sense to rename also the login parts as well to be clear where the flow starts? Does it make sense to add a login e2e test that checkts you can still login from the welcomeView after logging out? I have the feeling that the e2e now stop testing some functionality and test a different one. The flows that you are changings, could still be tested, right? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Discussed on slack. PR with more e2e will come later.
54d2dfa
to
04d8eda
Compare
Due to the change in #1929 the login flow with unknown user number was no longer tested. This reintroduces these tests for both webAuthn and PIN login.
Due to the change in #1929 the login flow with unknown user number was no longer tested. This reintroduces these tests for both webAuthn and PIN login.
Due to the change in #1929 the login flow with unknown user number was no longer tested. This reintroduces these tests for both webAuthn and PIN login.
Due to the change in #1929 the login flow with unknown user number was no longer tested. This reintroduces these tests for both webAuthn and PIN login.
See #1933. |
Due to the change in #1929 the login flow with unknown user number was no longer tested. This reintroduces these tests for both webAuthn and PIN login.
Due to the change in #1929 the login flow with unknown user number was no longer tested. This reintroduces these tests for both webAuthn and PIN login.
Deleting identity numbers on logout is unexpected and destructive. A change was requested to no longer do that.
Instead, we should give users a different way of managing the numbers shown on the landing page (to be solved as a separate PR).
Note: 3 lines were changed in the production code. The rest is adapting the e2e tests to use the pick identity flow instead of entering the identity number.