Skip to content

test(e2e): Playwright 인증 테스트 환경 구축#277

Merged
kubrickcode merged 1 commit intomainfrom
develop/shlee/276
Nov 29, 2025
Merged

test(e2e): Playwright 인증 테스트 환경 구축#277
kubrickcode merged 1 commit intomainfrom
develop/shlee/276

Conversation

@kubrickcode
Copy link
Owner

OAuth 기반 인증 환경에서 로그인이 필요한 기능을 E2E 테스트할 수 없는 문제 해결

  • 백엔드에 /auth/e2e-login 테스트 전용 엔드포인트 추가 (프로덕션 비활성화)
  • Playwright setup 프로젝트로 인증 상태 저장 후 재사용
  • chromium(로그인) / chromium-no-auth(비로그인) 프로젝트 분리

fix #276

@github-actions github-actions bot added the refactor Refactoring code label Nov 29, 2025
@gemini-code-assist
Copy link

Summary of Changes

Hello @kubrickcode, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

이 PR은 OAuth 기반 인증이 필요한 웹 애플리케이션의 엔드-투-엔드(E2E) 테스트 환경을 개선합니다. 백엔드에 테스트 전용 로그인 엔드포인트를 추가하고, Playwright에서 인증 상태를 효율적으로 관리하고 재사용할 수 있도록 설정하며, 로그인 및 비로그인 상태를 명확히 구분하여 테스트할 수 있도록 Playwright 프로젝트 구성을 업데이트합니다. 이를 통해 인증이 필요한 기능에 대한 테스트 커버리지를 확장하고 안정성을 높입니다.

Highlights

  • E2E 인증 테스트 환경 구축: OAuth 기반 인증 환경에서 로그인이 필요한 기능을 E2E 테스트할 수 없는 문제를 해결하기 위한 환경을 구축했습니다.
  • 백엔드 테스트 전용 엔드포인트 추가: E2E 테스트를 위해 백엔드에 /auth/e2e-login 테스트 전용 로그인 엔드포인트를 추가했습니다. 이 엔드포인트는 프로덕션 환경에서는 비활성화됩니다.
  • Playwright 인증 상태 관리 및 재사용: Playwright의 setup 프로젝트를 활용하여 인증 상태를 저장하고, 이후 테스트에서 이 상태를 재사용할 수 있도록 설정했습니다.
  • Playwright 프로젝트 분리: 로그인 상태를 테스트하는 chromium 프로젝트와 비로그인 상태를 테스트하는 chromium-no-auth 프로젝트를 분리하여 테스트 시나리오를 명확히 했습니다.
  • 새로운 인증 테스트 추가: 로그인 후 사용자 정보가 헤더에 표시되는지, 그리고 컨텐츠 상세 페이지에서 보상 수정 버튼이 활성화되는지 확인하는 새로운 테스트 케이스를 추가했습니다.
  • 기존 테스트 수정: 기존 home.spec.ts 테스트 파일이 항상 비로그인 상태로 실행되도록 수정하여 테스트의 독립성을 확보했습니다.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@github-actions github-actions bot added the environment Overall working environment label Nov 29, 2025
@kubrickcode
Copy link
Owner Author

/gemini review

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

Playwright를 사용하여 인증을 위한 E2E 테스트 환경을 효과적으로 구축한 PR입니다. 테스트 전용 로그인 엔드포인트를 추가하고, 인증/비인증 테스트 프로젝트를 분리하며, setup 프로젝트로 인증 상태를 관리하는 접근 방식이 잘 설계되었습니다. 코드의 유지보수성과 확장성을 높이기 위해 몇 가지 개선점을 제안합니다. 예를 들어, 중복되는 상수를 중앙에서 관리하고, 테스트 파일 명명 규칙을 도입하며, 더 견고한 엘리먼트 선택자를 사용하는 것이 좋겠습니다. 전반적으로 프로젝트의 테스트 기반을 강화하는 훌륭한 기여입니다.

@kubrickcode
Copy link
Owner Author

/gemini review

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

전반적으로 Playwright를 사용하여 인증 테스트 환경을 구축한 점이 훌륭합니다. 테스트 전용 엔드포인트를 만들고 프로덕션 환경에서는 비활성화하는 접근 방식은 안전하며, Playwright의 setup 프로젝트를 활용하여 인증 상태를 관리하는 구조도 효율적입니다. 코드의 유지보수성과 안정성을 더욱 높일 수 있는 몇 가지 제안 사항을 리뷰에 담았습니다.

OAuth 기반 인증 환경에서 로그인이 필요한 기능을 E2E 테스트할 수 없는 문제 해결

- 백엔드에 /auth/e2e-login 테스트 전용 엔드포인트 추가 (프로덕션 비활성화)
- Playwright setup 프로젝트로 인증 상태 저장 후 재사용
- chromium(로그인) / chromium-no-auth(비로그인) 프로젝트 분리

fix #276
@kubrickcode
Copy link
Owner Author

/gemini review

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

전반적으로 Playwright를 사용한 E2E 인증 테스트 환경 구축을 위한 변경 사항들이 잘 적용되었습니다. 인증이 필요한 기능과 필요하지 않은 기능을 별도의 프로젝트로 분리하여 테스트를 구성한 점이 인상적입니다. 코드의 유지보수성과 보안을 더욱 향상시키기 위해 몇 가지 개선 사항을 제안합니다. 주로 하드코딩된 값들을 상수로 추출하거나 환경 변수를 사용하도록 변경하는 것에 대한 내용입니다. 이는 저장소의 코딩 컨벤션을 따르는 데에도 도움이 될 것입니다.

@kubrickcode kubrickcode merged commit 51aa9d9 into main Nov 29, 2025
7 checks passed
@kubrickcode kubrickcode deleted the develop/shlee/276 branch November 29, 2025 13:28
@kubrickcode
Copy link
Owner Author

🎉 This PR is included in version 0.7.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

environment Overall working environment refactor Refactoring code released

Projects

None yet

Development

Successfully merging this pull request may close these issues.

로그인 인증 상태 테스트 환경 세팅

1 participant