Skip to content

Commit

Permalink
feat: 특정 게시판 클릭 시 게시글 페이지로 이동하는 e2e 테스트 작성 (#62)
Browse files Browse the repository at this point in the history
  • Loading branch information
rbgksqkr committed Feb 5, 2024
1 parent 6700184 commit 3891d83
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/tester/boardTester.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { expect } from '@playwright/test';

export const boardRouterTester = async ({ page }) => {
// Given : 게시판 페이지로 이동해서
await page.goto('http://localhost:3000/boards');
await expect(page.getByText('게시판 목록')).toBeVisible();

// When : 특정 게시판을 클릭하면
const button = page.getByRole('link', { name: 'board_example2' });
await button.click();

// Then : 해당 게시판의 게시글 페이지로 이동한다
await expect(page.getByRole('heading', { name: '학생회 공지 게시판' })).toBeVisible();
};
2 changes: 2 additions & 0 deletions tests/tests.spec.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { test } from '@playwright/test';

import { boardRouterTester } from './tester/boardTester';
import { lockerRouterTester } from './tester/lockerTester';
import { settingRouterTester } from './tester/settingTester';
import { signinTester } from './tester/signinTester';

test.beforeEach(signinTester);
test('setting', settingRouterTester);
test('locker', lockerRouterTester);
test('board', boardRouterTester);

0 comments on commit 3891d83

Please sign in to comment.