Skip to content

Commit 301e5f8

Browse files
Merge pull request #190 from D3vPals/feat/#188
웹 접근성 테스트
2 parents 503e1d1 + 4e2bfac commit 301e5f8

File tree

15 files changed

+5353
-720
lines changed

15 files changed

+5353
-720
lines changed

.github/workflows/chromatic.yml

Lines changed: 0 additions & 25 deletions
This file was deleted.

.github/workflows/ui-test.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: 'UI-test'
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- develop
7+
8+
jobs:
9+
accessibility-test:
10+
timeout-minutes: 60
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
- uses: actions/setup-node@v4
15+
with:
16+
node-version-file: '.nvmrc'
17+
- name: Install dependencies
18+
run: yarn
19+
- name: Install Playwright
20+
run: npx playwright install --with-deps
21+
- name: Build Storybook
22+
run: yarn build-storybook --quiet
23+
- name: Serve Storybook and run tests
24+
run: npx concurrently -k -s first -n "SB,TEST" -c "magenta,blue" \
25+
"npx http-server storybook-static --port 6006 --silent" \
26+
"npx wait-on tcp:127.0.0.1:6006 && yarn test-storybook"
27+
chromatic:
28+
needs: accessibility-test
29+
name: Run Chromatic
30+
runs-on: ubuntu-latest
31+
steps:
32+
- name: Checkout code
33+
uses: actions/checkout@v4
34+
with:
35+
fetch-depth: 0
36+
- uses: actions/setup-node@v4
37+
with:
38+
node-version: 20
39+
- name: Install dependencies
40+
run: npm ci
41+
- name: Run Chromatic
42+
uses: chromaui/action@latest
43+
with:
44+
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
20.18.1

.storybook/main.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ const config: StorybookConfig = {
88
'@storybook/addon-essentials',
99
'@chromatic-com/storybook',
1010
'@storybook/addon-interactions',
11-
'@storybook/addon-mdx-gfm'
11+
'@storybook/addon-mdx-gfm',
12+
'@storybook/addon-a11y'
1213
],
1314

1415
framework: {

.storybook/preview.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import type { Preview } from '@storybook/react';
22
import { ThemeProvider } from 'styled-components';
33
import { defaultTheme } from '../src/style/theme';
4+
import { GlobalStyle } from '../src/style/global';
5+
46
import React from 'react';
57

68
const preview: Preview = {
@@ -18,6 +20,7 @@ const preview: Preview = {
1820
(Story) => {
1921
return (
2022
<ThemeProvider theme={defaultTheme}>
23+
<GlobalStyle />
2124
<Story />
2225
</ThemeProvider>
2326
);

.storybook/test-runner.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import type { TestRunnerConfig } from '@storybook/test-runner';
2+
import { injectAxe, checkA11y } from 'axe-playwright';
3+
4+
const config: TestRunnerConfig = {
5+
async preVisit(page) {
6+
await injectAxe(page);
7+
},
8+
9+
async postVisit(page) {
10+
await checkA11y(page, '#storybook-root', {
11+
detailedReport: true,
12+
detailedReportOptions: {
13+
html: true,
14+
},
15+
});
16+
},
17+
};
18+
19+
export default config;

0 commit comments

Comments
 (0)