From 3891d83515c5762109b5f8e11bc5de95bce81f5e Mon Sep 17 00:00:00 2001 From: rbgksqkr Date: Mon, 5 Feb 2024 15:56:56 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=ED=8A=B9=EC=A0=95=20=EA=B2=8C=EC=8B=9C?= =?UTF-8?q?=ED=8C=90=20=ED=81=B4=EB=A6=AD=20=EC=8B=9C=20=EA=B2=8C=EC=8B=9C?= =?UTF-8?q?=EA=B8=80=20=ED=8E=98=EC=9D=B4=EC=A7=80=EB=A1=9C=20=EC=9D=B4?= =?UTF-8?q?=EB=8F=99=ED=95=98=EB=8A=94=20e2e=20=ED=85=8C=EC=8A=A4=ED=8A=B8?= =?UTF-8?q?=20=EC=9E=91=EC=84=B1=20(#62)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/tester/boardTester.ts | 14 ++++++++++++++ tests/tests.spec.ts | 2 ++ 2 files changed, 16 insertions(+) create mode 100644 tests/tester/boardTester.ts diff --git a/tests/tester/boardTester.ts b/tests/tester/boardTester.ts new file mode 100644 index 00000000..4513523f --- /dev/null +++ b/tests/tester/boardTester.ts @@ -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(); +}; diff --git a/tests/tests.spec.ts b/tests/tests.spec.ts index 825f2450..b0d0dd3f 100644 --- a/tests/tests.spec.ts +++ b/tests/tests.spec.ts @@ -1,5 +1,6 @@ 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'; @@ -7,3 +8,4 @@ import { signinTester } from './tester/signinTester'; test.beforeEach(signinTester); test('setting', settingRouterTester); test('locker', lockerRouterTester); +test('board', boardRouterTester);