-
Notifications
You must be signed in to change notification settings - Fork 4
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
사용자 스토리를 기반으로 E2E 테스트 작성하기 #469
Open
geuntaek1013
wants to merge
34
commits into
dev
Choose a base branch
from
feat/436-cypress-e2e-test
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 40 commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
8f4c46a
Merge pull request #449 from woowacourse-teams/refactor/430-n+1
donghae-kim 5016eef
Merge pull request #447 from woowacourse-teams/refactor/442-imporve-i…
green-kong e4b630f
chore: cypress.config에 viewport 설정
geuntaek1013 3e5db89
feat: 스크롤 시 다음 카페 이미지가 나오는지에 대한 cypress test 작성
geuntaek1013 9bc7f6b
feat: 좋아요 버튼에 대한 cypress test 작성
geuntaek1013 c429a99
feat: 홈 화면 더보기 버튼을 클릭하면 카페 상세정보를 확인하는 cypress test
geuntaek1013 a595acf
feat: 공유 버튼 cypress test 작성
geuntaek1013 bb72d0f
refactor: 공유 버튼 cypress에 clipboard 설정 추가
geuntaek1013 7a78fb2
chore: 빌드 시 cypress test를 위한 data-testid 제거 플러그인
geuntaek1013 9d88842
feat: 메뉴 버튼 시트 창 닫기 cypress test 작성
geuntaek1013 3feaaef
feat: 이미지 host url 수정
solo5star e9a72a2
Merge pull request #463 from woowacourse-teams/feat/462-new-image-hos…
solo5star e1747bc
refactor: 정적 리소스 assets 폴더로 이동
solo5star becf8fd
Merge pull request #465 from woowacourse-teams/refactor/464-move-to-a…
solo5star abe2eed
chore: index.html에 잘못된 경로 수정
solo5star c324406
build: webpack 설정 최적화
solo5star 97d8667
feat: logo를 svg로 렌더링하여 최적화
solo5star 7024f25
refactor: Page postfix
solo5star 3dfd649
refactor: onClick을 a 태그로 교체
solo5star f8baee0
fix: 조건부 msw import
solo5star 3057440
refactor: 불필요한 Logo 컴포넌트 삭제
solo5star 3cbb378
feat: 라우트 단위의 lazy loading 적용
solo5star 27ad9ab
build: BundleAnalyzerPlugin 제외
solo5star 1775c47
Merge pull request #466 from woowacourse-teams/feat/439-bundle-size-o…
solo5star f4fdf90
feat: 카페 이미지 좌우 이미지 스크롤 cypress test 추가
geuntaek1013 bbe5afe
refactor: webpack에 react-remove-properties 제거
geuntaek1013 2ed6e2f
Merge branch 'main' into feat/436-cypress-e2e-test
solo5star 6557090
chore: package-lock.json 삭제
solo5star 62708b9
refactor: 웹팩 빌드 시 cypress 테스트를 위한 data id 제거 설정
geuntaek1013 305271d
feat: cypress test를 위한 각 컴포넌트 data-testid 설정
geuntaek1013 67705f7
chore: .DS_Store 파일 삭제
geuntaek1013 bcf99e6
refactor: cypress 불필요한 파일 삭제
geuntaek1013 c6c4eb1
refactor: cypress 실행에 필요한 support 폴더에 commands 추가
geuntaek1013 ab060cd
fix: pull main
geuntaek1013 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,3 +41,6 @@ server/.nb-gradle/ | |
server/.vscode/ | ||
|
||
.env | ||
|
||
### Mac OS ### | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/// <reference types="cypress" /> | ||
|
||
describe('CafeDetailBottomSheet test', () => { | ||
beforeEach(() => { | ||
cy.visit('/'); | ||
}); | ||
|
||
it('더보기 버튼을 클릭하면 카페 이름, 주소, 영업시간, 상세설명을 볼 수 있다.', () => { | ||
cy.contains('더보기').click({ force: true }); | ||
|
||
cy.get('[data-testid=cafe-name]').should('be.visible'); | ||
cy.get('[data-testid=cafe-address]').should('be.visible'); | ||
cy.get('[data-testid=cafe-openingHours]').should('be.visible'); | ||
cy.get('[data-testid=cafe-description]').should('be.visible'); | ||
}); | ||
|
||
it('바텀 시트에서 X 버튼이 보이고, X 버튼을 클릭하면 시트가 닫힌다.', () => { | ||
cy.wait(2000); | ||
cy.contains('더보기').click({ force: true }); | ||
|
||
cy.get('[data-testid=close-button]').should('be.visible'); | ||
|
||
cy.get('[data-testid=close-button]').click(); | ||
|
||
cy.get('Container').should('not.exist'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/// <reference types="cypress" /> | ||
describe('LikeButton', () => { | ||
beforeEach(() => { | ||
cy.visit('/'); | ||
}); | ||
|
||
it('좋아요 버튼을 누르면 좋아요 버튼이 활성화되고, 좋아요 카운트가 1 증가한다.', () => { | ||
cy.get('[data-testid="likeButton"]').click({ multiple: true, force: true }); | ||
|
||
cy.get('[data-testid="likeButton"]').should('have.css', 'color', 'rgb(255, 255, 255)'); | ||
cy.get('[aria-live="assertive"]').should('contain.text', '좋아요가 추가되었습니다.'); | ||
}); | ||
|
||
it('좋아요한 버튼을 다시 누르면 좋아요 버튼이 비활성화되고, 좋아요 카운트가 1 감소한다', () => { | ||
cy.get('[data-testid="likeButton"]').click({ multiple: true, force: true }); | ||
|
||
cy.get('[data-testid="likeButton"]').should('have.css', 'color', 'rgb(255, 255, 255)'); | ||
cy.get('[aria-live="assertive"]').should('contain.text', '좋아요 취소되었습니다.'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
describe('CafeMenuBottomSheet', () => { | ||
beforeEach(() => { | ||
cy.visit('/'); | ||
}); | ||
|
||
it('메뉴 버튼을 클릭하면 대표메뉴, 메뉴 아이템이 보인다.', () => { | ||
cy.contains('메뉴').click({ force: true }); | ||
|
||
cy.get('[data-testid="menuBottomSheet"]').should('be.visible'); | ||
|
||
cy.contains('대표 메뉴').should('be.visible'); | ||
cy.get('[data-testid="menu"]').should('be.visible'); | ||
cy.get('[data-testid="menuItem"]').should('have.length.greaterThan', 0); | ||
}); | ||
it('바텀 시트에서 X 버튼이 보이고, X 버튼을 클릭하면 시트가 닫힌다.', () => { | ||
cy.wait(2000); | ||
cy.contains('더보기').click({ force: true }); | ||
|
||
cy.get('[data-testid=close-button]').should('be.visible'); | ||
|
||
cy.get('[data-testid=close-button]').click(); | ||
|
||
cy.get('Container').should('not.exist'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/// <reference types="cypress" /> | ||
|
||
describe('ShareButton', () => { | ||
beforeEach(() => { | ||
cy.visit('/'); | ||
cy.window().then((window) => { | ||
cy.stub(window.navigator.clipboard, 'writeText').resolves('https://yozm.cafe/cafes/1'); | ||
}); | ||
}); | ||
|
||
it('공유하기 버튼을 클릭하면 해당 카페 URL이 복사되고, alert창을 띄운다.', () => { | ||
cy.contains('공유').click({ force: true }); | ||
|
||
cy.window().its('navigator.clipboard').invoke('readText'); | ||
cy.on('window:alert', (alertText) => { | ||
expect(alertText).to.equal('URL이 복사되었습니다!'); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,8 +10,8 @@ | |
"solo5star <[email protected]>" | ||
], | ||
"scripts": { | ||
"start": "cross-env NODE_ENV=development webpack serve", | ||
"build": "cross-env NODE_ENV=production webpack", | ||
"start": "cross-env NODE_ENV=development webpack serve --config webpack.development.js", | ||
"build": "cross-env NODE_ENV=production webpack --config webpack.production.js", | ||
"storybook": "cross-env NODE_ENV=development storybook dev -p 6006", | ||
"build:storybook": "cross-env NODE_ENV=production storybook build", | ||
"cypress:open": "cypress open --e2e --browser chrome", | ||
|
@@ -23,7 +23,7 @@ | |
"axios": "^1.4.0", | ||
"react": "^18.2.0", | ||
"react-dom": "^18.2.0", | ||
"react-icons": "^4.10.1", | ||
"react-icons": "^4.11.0", | ||
"react-router-dom": "^6.14.1", | ||
"styled-components": "^6.0.2" | ||
}, | ||
|
@@ -45,6 +45,7 @@ | |
"@typescript-eslint/eslint-plugin": "^5.61.0", | ||
"@typescript-eslint/parser": "^5.61.0", | ||
"babel-loader": "^9.1.2", | ||
"babel-plugin-react-remove-properties": "^0.3.0", | ||
"copy-webpack-plugin": "^11.0.0", | ||
"cross-env": "^7.0.3", | ||
"cypress": "^12.17.4", | ||
|
@@ -74,6 +75,7 @@ | |
"stylelint-order": "^6.0.3", | ||
"typescript": "^5.1.6", | ||
"webpack": "^5.88.1", | ||
"webpack-bundle-analyzer": "^4.9.1", | ||
"webpack-cli": "^5.1.4", | ||
"webpack-dev-server": "^4.15.1", | ||
"webpack-merge": "^5.9.0" | ||
|
File renamed without changes.
File renamed without changes
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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에 없는 거 같은딩...?!