-
Notifications
You must be signed in to change notification settings - Fork 61
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: when pr, e2e test github actions ci #487
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: E2E Tests - Playwright | ||
on: | ||
pull_request: | ||
branches: [main, master] | ||
jobs: | ||
tests: | ||
timeout-minutes: 600 | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: ./packages/view | ||
steps: | ||
- uses: actions/checkout@v2 # v3 is not available as of my last update in January 2022 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18.16.0 | ||
|
||
# Add Playwright GitHub Action | ||
- name: Setup Playwright | ||
uses: microsoft/playwright-github-action@v1 | ||
|
||
- name: Install dependencies | ||
run: npm i | ||
|
||
- name: npx playwright install | ||
run: npx playwright install | ||
|
||
- name: Run Playwright tests | ||
run: npm run test:e2e |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,17 +8,4 @@ test.describe("home", () => { | |
test("has title", async ({ page }) => { | ||
await expect(page).toHaveTitle(/Githru/); | ||
}); | ||
|
||
test("check BranchSelector", async ({ page }) => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. 일주일 전 소원님이 작업하신 내용과 충돌이 발생했는데
그래서 동적으로 데이터를 가져오기 때문에 실제 e2e test에서 결과를 정적으로 체크함에 어려움이 있었습니다. 해결책으로 모킹을 여러 방면으로 고민해봤으나 e2e test에서 함수나 컴포넌트를 모킹하는 방식은 옳은 방법이 아닌 것 같아. 방법에 더 고민이 필요해 제거했습니다! 만약 CI가 이미 있었다면 소원님이 작업하시면서 해당 내용이 failed가 떠서 당시에 바로 의논해볼 수 있었을 것 같아. 'CI가 필요했었구나!' 라는 생각이 추가로 들었습니다! 참고로 소원님이 작업해주신 방향이 맞다고 생각하고 그에 맞게 대응할 수 있는 테스트를 고민해봐야할 것 같습니다!! |
||
await expect(page.getByText("Branches:")).toBeVisible(); | ||
|
||
const options = await page.locator("section").getByRole("combobox").locator("option"); | ||
const optionValues = await options.evaluateAll((elements) => | ||
elements.map((option) => (option as HTMLOptionElement).value) | ||
); | ||
|
||
expect(optionValues).toContain("dev"); | ||
expect(optionValues).toContain("feat"); | ||
expect(optionValues).toContain("edit"); | ||
}); | ||
}); |
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.
👍