Skip to content
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

feat: generate simple auth tests #8709

Merged

Conversation

ntindle
Copy link
Member

@ntindle ntindle commented Nov 19, 2024

We want to start testing our UI so lets start with creating users!

Changes 🏗️

Adds a login fixture, adds a global fixture, adds a user generator, add user creation

Checklist 📋

For code changes:

  • I have clearly listed my changes in the PR description
  • I have made a test plan
  • I have tested my changes according to the test plan:
    • ...
Example test plan
  • Create from scratch and execute an agent with at least 3 blocks
  • Import an agent from file upload, and confirm it executes correctly
  • Upload agent to marketplace
  • Import an agent from marketplace and confirm it executes correctly
  • Edit an agent from monitor, and confirm it executes correctly

For configuration changes:

  • .env.example is updated or already compatible with my changes
  • docker-compose.yml is updated or already compatible with my changes
  • I have included a list of my configuration changes in the PR description (under Changes)
Examples of configuration changes
  • Changing ports
  • Adding new services that need to communicate with each other
  • Secrets or environment variable changes
  • New or infrastructure changes such as databases

this will always create a new user
@ntindle ntindle requested a review from a team as a code owner November 19, 2024 01:58
@ntindle ntindle requested review from Torantulino and Bentlybro and removed request for a team November 19, 2024 01:58
@github-actions github-actions bot added platform/frontend AutoGPT Platform - Front end platform/backend AutoGPT Platform - Back end labels Nov 19, 2024
Copy link

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 3 🔵🔵🔵⚪⚪
🧪 PR contains tests
🔒 Security concerns

Sensitive information exposure:
The login.page.ts file contains console.log statements that output email and password credentials (line 7). Even though these are test credentials, logging sensitive information should be avoided as logs might be captured in CI/CD systems or other logging infrastructure.

⚡ Recommended focus areas for review

Code Duplication
The login method contains duplicated code for filling email and password fields. The second set of fill operations (emailInput2, passwordInput2) appears to be a workaround and should be refactored.

Error Handling
The deleteTestUser function swallows errors and only logs warnings. Consider whether failed cleanup should be treated more strictly to prevent test user accumulation.

Debug Logging
Multiple console.log statements are left in the code, which should be removed or replaced with proper test logging mechanisms.

Copy link

netlify bot commented Nov 19, 2024

Deploy Preview for auto-gpt-docs canceled.

Name Link
🔨 Latest commit 0e4e1bc
🔍 Latest deploy log https://app.netlify.com/sites/auto-gpt-docs/deploys/673dfb805e36b80008e58f24

@ntindle ntindle requested a review from a team as a code owner November 19, 2024 02:18
@ntindle
Copy link
Member Author

ntindle commented Nov 19, 2024

(note that this will probably come next for the things that aren't explicitly login https://playwright.dev/docs/auth#multiple-signed-in-roles)

 You put your user in and shake their creds about, You do the auth flow pokey and you turn yourself about, That's what it's all about! 🔄  - Add user creation test
- Add initial login test
- Add logout flow test
- Verify re-login capabilities
@ntindle ntindle mentioned this pull request Nov 19, 2024
14 tasks
@ntindle ntindle enabled auto-merge (squash) November 19, 2024 14:07
@ntindle ntindle requested a review from aarushik93 November 19, 2024 14:07
@ntindle ntindle merged commit 92bfbfa into dev Nov 20, 2024
15 checks passed
@ntindle ntindle deleted the ntindle/open-1864-add-user-creationlogin-tests-and-utilites branch November 20, 2024 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform/backend AutoGPT Platform - Back end platform/frontend AutoGPT Platform - Front end Review effort [1-5]: 3 size/l
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants