-
Notifications
You must be signed in to change notification settings - Fork 590
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
chore: add e2e for user login/logout flow #13185
Conversation
@BrunoQuaresma Do you happen to know why an e2e test would succeed locally, but not remotely, especially if it doesn't have anything to do with enterprise features? |
Taking this out of review for the moment – I think I've realized what the problem is (not enough test isolation), and I'm going to tinker with this a bit more |
orgId: string, | ||
username: string = randomName(), | ||
password: string = "s3cure&password!", | ||
) => { |
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.
nit: instead of having the user params passed as an argument what about creating a param type that could merge/override the default values?
* JS-based runtime for the test environments to the Go-based runtime for the | ||
* production backend. | ||
*/ | ||
export async function assertNoUncaughtRenderError(page: Page): 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.
nit: maybe this function could have a more friendly name like assertNoUnexpectedUIError
. I think the word Uncaught
is not very common at least for me.
await setupNewUser(); | ||
|
||
await handleSignIn(); | ||
await handleSignOut(); |
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 the sign-in and sign-out tests are encapsulated into functions? I would expect each one to be a separate test.
@@ -19,6 +20,8 @@ export interface UserDropdownProps { | |||
onSignOut: () => void; | |||
} | |||
|
|||
export const accessibleDropdownLabel = "Open dropdown menu for user options"; |
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.
off: I'm always wondering how long labels should be. Imagining myself using an interface via audio... long texts could slow me down. Just a random thought.
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.
So far I think you are in the right direction.
Fully closes #13130 by filling in the gaps that #13137 and #13145 can't cover
Changes made
getByRole
selectorsNotes