-
Notifications
You must be signed in to change notification settings - Fork 261
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
test: set up authentication #570
base: develop
Are you sure you want to change the base?
Conversation
I changed Playwright's base url to |
Hey @JeffreytheCoder , I have some questions in mind. I don't have much understanding in setting up these tests, but I want to learn more about it so that I can also contribute by writing e2e tests, as the central issue is huge. I was going through your changes, and I would like to ask a few questions. It would be great if you could spare some of your time answering them and help me understand. |
Hey @Spiral-Memory I was confused with whether the tests should run in development environment or in a dedicated testing environment in CI. I changed host to storybook and added environment variables so that each EC dev can run tests using his/her own server. However, if we only want to run tests during CI, I'll change it back to using |
Before this PR, EC was set to anonymous mode for CI tests. I was thinking we can just discard the authentication setup, but then I saw EC currently only allows anonymous read, not anonymous write. If this is a feature, not a bug, we then need a test account of the hosted server to sign in and test the messaging features. |
In my opinion, tests should run on CI to achieve an automated workflow. Additionally, the environment variables for login are fine; the repository owner can add those environment variables to enable automated login on Also, we have two modes in RC. One is anonymous mode, which allows us to read messages if the workspace owner has enabled it. So, there's no need to remove that. Let's check for the anonymous mode first. Once the test passes, we can proceed to login and test the other features which require write access accordingly. Also login is necessary to test other APIs that require auth, so we can't avoid login at all. anonymous mode is given by RC so that user can at least read messages without creating a account, and this is specific to workspace owner, they have the permission to enable / disable it and In EC, we need to test all scenarios, so testing both could be beneficial. Regarding the test user, I think Abhinav has hosted that server so he or siddarth will add the credentials himself for test with admin access. |
Also, once we refer to this, I think one is to start the EC, and the other part will go to that URL and test. So, keep it consistent, and it should be the same to successfully test things. Again, I'm not very sure how testing works, but this is what makes sense to me. Let's give it a try. Also, For testing in your local system, use your Rocket chat server URL instead of |
Hey @abhinavkrin @sidmohanty11 do you guys have the admin credentials to the test server chat.avitechlab.com? |
Obviously they will have ig 😂, for testing, btw you can create your own account on that (avitech) Rocket.Chat server for now. I just created one for me. (but not with admin access obviously) |
Ohh that's great. I thought we need to share a test account so that's why I asked haha |
It depends on Abhinav. Also, we might need to test some features with admin access, so I'm a little unsure if Abhinav will provide a test user with admin access. Haha... Maybe we can test non-admin related features with our own credentials on that server or using a common shared test user (without admin access / with admin access, depending on Abhinav's choice). But I think he is quite busy these days, so for now let's use our credentials to conduct testing on the local system (either with our local server (if admin access is required) or with the Avitechlab server). |
Yup ! Great thanks for sharing, but i think for CI, abhinav or siddarth will add an account with admin access in GitHub workflow credentials. |
Anyway, let's start working on it.. once the login is complete and once you make the required changes to this PR. Let me know, we will test together !! |
Added a new commit and the tests now work in CI :) |
@sidmohanty11 Could you once add credentials in GitHub workflow directly so that it can be fetched from. env rather than hardcoding a test user. |
Great but you have removed some tests, like seeing the messages and stuff from the example.spec.ts, once revert those as well. Also, after logging in, we need to check things like whether the input box is now enabled, whether the "Login successful" toast message is rendered, etc., to verify that the login has been successful, in my opinion. Please mark it as a draft for now, and once it's done, make it ready for review to avoid confusion. |
Let's wait until the meeting to verify these changes |
What this PR does
Acceptance Criteria fulfillment
login()
Fixes #546
Video/Screenshots