-
Notifications
You must be signed in to change notification settings - Fork 6
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
[FE] playwright에 자동 로그인 기능과 탭과 질문 렌더링, 체크리스트 생성과 관련된 e2e 테스트를 추가한다. #849
Conversation
@@ -60,8 +60,10 @@ const useChecklistStore = create<ChecklistState>()( | |||
})), | |||
})); | |||
|
|||
set({ checklistCategoryQnA }); | |||
get().actions._parseCategory(); | |||
if (checklistCategoryQnA.length) { |
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.
이 부분은 서버에서 categories : []
로 올때 무한 렌더링을 방지하기 위해 추가한 코드입니다!
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.
이부분에서 한번 처리를 해줘서 위에 조건식에서 빠진걸까요?
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.
그거랑 별개긴 해요. 밑에다가 코멘트 달았습니다!
9add75f
to
9796379
Compare
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.
확인했습니다~! 코멘트 하나있는지 맞게 이해한건지 확인해주세요~!
@@ -12,7 +12,7 @@ const NewChecklistTab = () => { | |||
const { getTabsForChecklist } = useTabs(); | |||
|
|||
const categoryTabs = useMemo(() => { | |||
if (isFetched && checklist && checklistStore.length) { |
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.
checklistStore.length 조건을 빼신 이유가 있을까요?
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.
length 가 없는 경우 categories : []
로 오는 경우 탭이 아예 렌더링 되지 않는 경우를 방지 하기 위함입니다! 해당 조건이 불필요한 조건이라고 생각했는데, 혹시 문제가 있을까요?
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.
length 가 아예 없는 경우에 탭을 보여줘야 하는 이유가 뭘까요? 질문 하나도 없다면 기본 탭이 아니라 질문 추가를 유도하는 탭이 생성되어야 할거 같은데 리안은 어떻게 생각하시나요?
@@ -60,8 +60,10 @@ const useChecklistStore = create<ChecklistState>()( | |||
})), | |||
})); | |||
|
|||
set({ checklistCategoryQnA }); | |||
get().actions._parseCategory(); | |||
if (checklistCategoryQnA.length) { |
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.
이부분에서 한번 처리를 해줘서 위에 조건식에서 빠진걸까요?
|
.env.dev 추가된 내용이 어디있을까요? 노션에 반영이 안된거 같네요 확인 부탁드립니다~ |
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.
e2e 수고하셨습니다!
frontend/.eslintrc.json
Outdated
"ignorePatterns": ["dist", "webpack.*.js", "tsconfig.json", "public", "assets", "*.config.js"] | ||
"ignorePatterns": ["dist", "webpack.*.js", "tsconfig.json", "public", "assets", "*.config.js", "playwright/**"] |
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.
playwright/**
추가를 해야하는 이유가 있으신가요?
eslint에 의한 문법검사가 되어야 좋을거같습니다.
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.
같은 생각입니다. 하지만 import 문에 에러가 납니다. 아무래도 src
안에 import 문을 인식하지 못하는 것 같네요.
frontend/playwright.config.ts
Outdated
// dotenv.config({ path: path.resolve(__dirname, '.env') }); | ||
import dotenv from 'dotenv'; | ||
|
||
dotenv.config({ path: './.env.development' }); |
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.
가급적 __dirname은 유지해주세요
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.
dirname을 유지했을 떄 어떤 장점이 있는지 알려주실 수 있을까요? 약간 절대 경로같은 느낌일까요?
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.
그렇습니다
baseURL: 'http://localhost:3000', | ||
|
||
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */ | ||
trace: 'on-first-retry', | ||
actionTimeout: 5000, // await 타임아웃 : 5초로 설정 |
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.
여긴 지우신 이유가있나요?
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.
코드를 수정하는 과정에서 빠진 것 같아요 복구하겠습니다!!감사합니다
station: '강남', | ||
walkingTime: 10, |
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.
여기를 지우셨는데 checklistDetail
응답에도 station이 포함되지않나요?
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.
이건 에러가 발생해서 지운 것 같은데, 아마 제이드의 type 이 머지되고 수정되면 문제 없을 것 같습니다!
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.
그렇군요 주석쳐주시면 후속PR에서 보강 반영하겠습니다.
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.
해당 주석 반영이 안된거 같네요 당장 머지가 급하시면 제이드에게 노티가 필요할거 같습니다.
name: '주거환경', | ||
}, | ||
{ | ||
id: 6, | ||
name: '보안', | ||
}, | ||
{ | ||
id: 7, | ||
name: '경제적', | ||
}, |
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.
👍
@@ -47,7 +47,9 @@ const ChecklistDetailPage = () => { | |||
left={<Header.Backward onClick={handleClickBackward} />} | |||
right={ | |||
<FlexBox.Horizontal gap="1.5rem"> | |||
<Header.TextButton onClick={handleEditButton}>편집</Header.TextButton> | |||
<Header.TextButton onClick={handleEditButton} id="checklistEditButton"> |
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.
e2e 테스트를 위해 id를 하드코딩으로 다넣어주는게 맞는걸까요..
"편집"이라는 글자가 들어있는 버튼을 select하는 방법으로 식별할수있지않을까요
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.
저는 텍스트가 더욱 변화가능성이 크다고 생각했습니다(저희 텍스트가 자주 바뀌는 성격이라고 생각해요.) 또한 탐색하는 것도 id를 통해 찾는 것이 더 빠르다고 생각해서 넣어주었습니다. 실제로 dom 요소에 id 를 넣는 것은 정말 일반적인 방법이라고 생각합니다.
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.
이 사항은 급하지 않아 다음 test pr 에서 수정하겠습니다.
frontend/tsconfig.json
Outdated
"include": ["src/**/*", "*.ts"] | ||
"include": ["src/**/*", "*.ts", "playwright/**/*"], | ||
"exclude": ["playwright/**/*"] |
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.
include했다가 다시 exclude하는걸까요?
bfa1605
to
6c29ce4
Compare
frontend/package.json
Outdated
"e2e:mock": "playwright test --config=playwright.mock.config.ts", | ||
"e2e:ui-mock": "playwright test --config=playwright.mock.config.ts --ui", | ||
"e2e:api": "playwright test --config=playwright.api.config.ts", | ||
"e2e:api-mock": "playwright test --config=playwright.api.config.ts --ui", |
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.
ui-api의 오타인거같아요
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.
그렇네요! 수정하겠습니다:)
백엔드 db 문제로 업데이트가 늦었습니다 죄송해요 |
8230255
to
ea29f07
Compare
host: 'localhost', | ||
host: '0.0.0.0', |
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.
이건 무엇인가요?
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.
접근성을 위해서 외부에서도 접근할 수 있게 한 코드입니다. 접근성 pr 이 끝나면 수정해놓아도 괜찮을까요?
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.
코멘트 한번 확인해주시고 확인하시면 머지하셔도 될거 같습니다.
확인하신 사항은 이후 PR 에서 반영되어도 될거 같아요~!
station: '강남', | ||
walkingTime: 10, |
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.
해당 주석 반영이 안된거 같네요 당장 머지가 급하시면 제이드에게 노티가 필요할거 같습니다.
@@ -12,7 +12,7 @@ const NewChecklistTab = () => { | |||
const { getTabsForChecklist } = useTabs(); | |||
|
|||
const categoryTabs = useMemo(() => { | |||
if (isFetched && checklist && checklistStore.length) { |
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.
length 가 아예 없는 경우에 탭을 보여줘야 하는 이유가 뭘까요? 질문 하나도 없다면 기본 탭이 아니라 질문 추가를 유도하는 탭이 생성되어야 할거 같은데 리안은 어떻게 생각하시나요?
해당 주석 반영이 안된거 같네요 당장 머지가 급하시면 제이드에게 노티가 필요할거 같습니다. length 가 아예 없는 경우에 탭을 보여줘야 하는 이유가 뭘까요? 질문 하나도 없다면 기본 탭이 아니라 질문 추가를 유도하는 탭이 생성되어야 할거 같은데 리안은 어떻게 생각하시나요? |
|
❗ Issue
✨ 구현한 기능
테스트 전 자동 로그인 기능(auth) 추가
auth.setup.ts
의authenticatie
가 자동으로 로그인되는 테스트입니다. 모든 테스트들이 이 테스트를 거치고 실행됩니다.authenticatie
는 로그인 완료 후user.json
에 쿠키 정보를 저장하고, 이 인증정보를 요청에 사용하도록 해줍니다.src
에 있던e2e
폴더를src
밖에playwright
폴더로 이동하여 수정했습니다. 해당 폴더는 빌드 때 추가되지 않도록 할 수 있으며, 공식문서에서도 지향하는 방법이여서 적용했어요.localhost:3000
및 실제 api 를 사용하기 때문에 cd 가 불가능합니다. 그래서 아깝지만..playwright.yml
을 삭제했습니다. 즉, 이 e2e 테스트는 수동으로 돌려야 합니다.탭 렌더링 e2e 테스트 추가
skip
처리 해두었습니다. 나머지는 밑처럼 잘 통과합니다.체크리스트 작성 후 생성 테스트 추가
skip
처리 했으며, 제이드가 생성 페이지를 리팩토링하는 대로 실행해서 테스트 해주시면 될 것 같습니다!피드백 반영 =
playwright.config
분리api
,msw
환경에서 둘 다 테스트 하기 위해서 해당 config 를 분리해서 작업했습니다. package.json 안에 있는 명령어도 추가되었습니다. 이제는 cd 설정으로 인해msw
의 테스트만 자동으로 테스트되고,api
테스트는 필요시 pr 명령어를 수동으로 쳐서 테스트 할 수 있습니다.📢 논의하고 싶은 내용
⭐️ 중요
user.json
에는 민감한 쿠키 정보가 포함되어 있는 파일입니다..gitignore
에 해당 파일을 추가해서 올라가지 않아 개별적으로 다음과 같이playwright
에 폴더와 파일을 설정해주셔야 합니다..env.dev
의 내용이 추가되었으니(테스트 계정 정보) env 를 업데이트하시길 바래요! 이 또한 노션에 업데이트해놓겠습니다.🎸 기타