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

Refactor: Test Code 생성 #11

Merged
merged 1 commit into from
Aug 23, 2024
Merged

Refactor: Test Code 생성 #11

merged 1 commit into from
Aug 23, 2024

Conversation

whoisrey
Copy link
Contributor

제목

Test Code 생성 (서버)

내용

Test Code를 생성했을 때, 완성된 코드를 서버에서 가공하여 클라이언트로 제공합니다.

항목

  • 완성된 Test Code 제공
const { chromium } = require('playwright');

(async() => { 
  try { 
  // 테스트 코드...
  
    await browser.close();
   } catch (error) { 
    console.error(error);
   } 
})();

주의 사항

  • PR 크기는 300~500줄로 하되 최대 1000줄 미만으로 합니다.
  • conflict를 모두 해결하고 PR을 올려주세요

PR 전 체크리스트

  • 가장 최신 브랜치를 pull 하였습니다
  • base 브랜치명을 확인하였습니다
  • 코드 컨벤션을 모두 확인하였습니다
  • 셀프 리뷰를 진행하였습니다.
  • 브랜치명을 확인하였습니다.
  • 작업 중 dependency 변경사항이 있는 경우 안내해주세요!

@whoisrey whoisrey added the enhancement New feature or request label Aug 23, 2024
@whoisrey whoisrey requested a review from choiOV August 23, 2024 05:48
Comment on lines +16 to +19
const startText =
"const { chromium } = require('playwright');\n(async() => { \n try { \n";
const endText =
"\n await browser.close(); } catch (error) { \n console.error(error); } \n})();";
Copy link
Collaborator

Choose a reason for hiding this comment

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

하드코딩된 이 부분 추후에 리팩토링하면 좋을 것 같아요 👍

Copy link
Contributor Author

@whoisrey whoisrey Aug 23, 2024

Choose a reason for hiding this comment

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

넵 용섭님 이 부분 issue 생성하겠습니다! #12

Copy link
Collaborator

Choose a reason for hiding this comment

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

클라이언트측에서 담당했던 부분을 서버측에서 처리하도록 해주셨네요! 생성되는 playwright 코드를 서버에서 모두 확인할 수 있어 가독성이 높아진 것 같아요!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

네~ 해당 부분도 하드 코딩으로 구현했지만 추후에 리팩토링 작업할 수 있도록 하겠습니다. 위 이슈 번호 참고해주세요 기연님~!

Copy link
Collaborator

@choiOV choiOV left a comment

Choose a reason for hiding this comment

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

이번 코드 작업도 수고 많으셨습니다!

@whoisrey whoisrey merged commit 12ce551 into main Aug 23, 2024
@whoisrey whoisrey deleted the Refactor/create-test-codes branch August 23, 2024 05:55
Copy link
Collaborator

@noeyigg noeyigg left a comment

Choose a reason for hiding this comment

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

Wit AI가 더 정확하게 자연어를 처리할 수 있도록 띄어쓰기까지 꼼꼼하게 정리하려 해주신 것 같아요! 그런데 block의 parameter를 비교해 매핑이 이루어지므로 서버측과 클라이언트 측의 코드가 일관되게 수정되었는지 확인이 필요해보입니다!

서버측과 클라이언트 측에서 나누어 처리하던 Test Code를 생성하는 로직을 서버측에서 한번에 처리하도록 개선해주셨네요! 수고하셨습니다!

Comment on lines +16 to +19
const startText =
"const { chromium } = require('playwright');\n(async() => { \n try { \n";
const endText =
"\n await browser.close(); } catch (error) { \n console.error(error); } \n})();";
Copy link
Collaborator

Choose a reason for hiding this comment

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

클라이언트측에서 담당했던 부분을 서버측에서 처리하도록 해주셨네요! 생성되는 playwright 코드를 서버에서 모두 확인할 수 있어 가독성이 높아진 것 같아요!

};

const formatNaturalLanguage = (blocks) => {
return blocks.reduce(
(blockContent, block) => {
if (block.parameter === "id (#)") {
if (block.parameter === "id(#)") {
Copy link
Collaborator

Choose a reason for hiding this comment

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

이 수정사항 때문에 코드 생성에 오류가 발생하는 것 같습니다! UI와 데이터베이스를 확인해보면 block의 parameter가 "id (#)"로 되어있는데, 모두 띄어쓰기를 없애거나 모두 띄어쓰기를 해서 일관되게 작성할 필요가 있어보입니다!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

확인했습니다! 기연님 말씀대로 모두 띄어쓰기를 해서 일관되게 작성할 필요가 있을 것 같아요~
추후 노션에도 공유하여 팀원들에게 공유하겠습니다.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants