本文へ移動
cccskills
無料GitHub で公開

webapp-testing-jp

Simplified Japanese web application testing skill covering unit tests, E2E tests, integration tests, Japanese text validation, IME input testing, and naming conventions. Triggers on requests for Webテスト, テスト自動化, E2Eテスト, 日本語テスト, Japanese web testing.

インストール方法を見る

含まれるファイル(1)

  • SKILL.md5.5 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

Webアプリケーション テスト支援スキル

概要

Webアプリケーションのテスト設計・実装を支援するスキルです。日本語テキスト検証、IME入力テスト、全角・半角混在処理など、日本語Webアプリ特有のテスト観点をカバーします。

テストの種類

種類ツール対象
ユニットテストVitest, Jest関数、コンポーネント単体
統合テストVitest, Jest複数モジュールの連携
E2EテストPlaywrightブラウザ上のユーザー操作全体

日本語テキスト検証

全角・半角混在テスト

describe("全角・半角変換", () => {
  test("全角英数字を半角に変換できる", () => {
    expect(toHalfWidth("A B C123")).toBe("ABC123");
  });

  test("半角カタカナを全角に変換できる", () => {
    expect(toFullWidthKatakana("カタカナ")).toBe("カタカナ");
  });

  test("全角・半角混在文字列を正しく処理する", () => {
    expect(normalize("Testテスト123")).toBe("Testテスト123");
  });
});

文字コードテスト

describe("文字コード処理", () => {
  test("UTF-8の日本語文字列を正しく処理する", () => {
    const text = "日本語テスト文字列🎌";
    expect(processText(text)).toHaveLength(10);
  });

  test("Shift_JISからUTF-8への変換が正しい", () => {
    const sjisBuffer = encodeShiftJIS("日本語");
    expect(decodeToUTF8(sjisBuffer)).toBe("日本語");
  });

  test("サロゲートペア文字を正しく扱う", () => {
    const text = "𠮷野家"; // 𠮷はサロゲートペア
    expect([...text]).toHaveLength(3);
  });
});

日本語バリデーション

describe("日本語入力バリデーション", () => {
  test("電話番号の形式を検証する", () => {
    expect(isValidPhoneNumber("03-1234-5678")).toBe(true);
    expect(isValidPhoneNumber("090-1234-5678")).toBe(true);
    expect(isValidPhoneNumber("0120-123-456")).toBe(true);
    expect(isValidPhoneNumber("12345")).toBe(false);
  });

  test("郵便番号の形式を検証する", () => {
    expect(isValidPostalCode("123-4567")).toBe(true);
    expect(isValidPostalCode("1234567")).toBe(true);
    expect(isValidPostalCode("123-456")).toBe(false);
  });

  test("全角カタカナのみを許可する", () => {
    expect(isFullWidthKatakana("カタカナ")).toBe(true);
    expect(isFullWidthKatakana("カタカナ")).toBe(false);
    expect(isFullWidthKatakana("かたかな")).toBe(false);
  });
});

IME入力テスト

変換確定前後の挙動

describe("IME入力処理", () => {
  test("composition中はバリデーションを実行しない", async ({ page }) => {
    const input = page.locator("#name-input");

    // IME入力開始(compositionstart)
    await input.dispatchEvent("compositionstart");
    await input.fill("にほんご");
    // 変換確定前はエラー表示されないことを確認
    await expect(page.locator(".error-message")).not.toBeVisible();

    // IME変換確定(compositionend)
    await input.dispatchEvent("compositionend");
    // 確定後にバリデーションが走ることを確認
    await expect(input).toHaveValue("にほんご");
  });
});

Composition Events のテスト観点

イベントテスト内容
compositionstartバリデーションの一時停止
compositionupdate変換候補表示中の挙動
compositionend確定後のバリデーション実行
変換キャンセルEscキーによる入力取消の処理

ツール設定

Playwright(E2Eテスト)

// playwright.config.ts
export default defineConfig({
  use: {
    locale: "ja-JP",
    timezoneId: "Asia/Tokyo",
  },
});

Vitest(ユニット・統合テスト)

// vitest.config.ts
export default defineConfig({
  test: {
    globals: true,
    environment: "jsdom",
  },
});

テストケース日本語命名規則

命名のルール

// describe: 「テスト対象」を記述
describe("郵便番号入力フォーム", () => {

  // test: 「条件 → 期待結果」の形式
  test("正しい形式の郵便番号を入力すると住所が自動補完される", () => { });
  test("不正な形式の場合はエラーメッセージが表示される", () => { });
  test("ハイフンなしの7桁数字でも受け付ける", () => { });
});

命名のポイント

  • test() の説明文は「〜すると〜される」の形式で統一
  • 正常系・異常系・境界値を明確に区別する
  • テスト実行結果のログが日本語で読めるようにする

テスト設計時の確認事項

  1. 対象ブラウザ: テスト実行環境(Chromium / Firefox / WebKit)
  2. 入力パターン: 全角・半角・絵文字・サロゲートペア文字の考慮
  3. ロケール依存: 日付形式、通貨表示、ソート順の検証
  4. 文字数カウント: String.length と [...str].length の違いに注意

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

algorithmic-art-jp

無料日本語概要

Japanese algorithmic and generative art skill covering traditional pattern generation (wagara), calligraphy simulation, zen garden generators, and mathematical patterns from Japanese art. Triggers on requests for 和柄生成, ジェネラティブアート, アルゴリズミックアート, 伝統紋様パターン, Japanese generative art.

LinkX-Japan/ai-souken-workflows62026年3月12日 更新

article-writer-jp

無料日本語概要

Japanese tech article writer with non-duplicate H2/H3 structure design, content generation, and image TODO placeholders. Triggers on requests for 記事作成, 記事を作って, 記事を書いて, 〇〇の記事, テック記事, 解説記事, ブログ記事作成.

LinkX-Japan/ai-souken-workflows62026年3月12日 更新

canvas-design-jp

無料日本語概要

Japanese-inspired canvas and graphic design skill for HTML5 Canvas and SVG, covering traditional aesthetics (ma, wabi-sabi, yugen), calligraphy, washi textures, traditional patterns, and seasonal motifs. Triggers on requests for 和風デザイン, Canvas描画, SVGイラスト, 日本画風, Japanese-inspired graphics.

LinkX-Japan/ai-souken-workflows62026年3月12日 更新

doc-coauthoring-jp

無料日本語概要

Japanese document co-authoring and editing assistant with proofreading checklist, keigo adjustment, essay structure patterns (起承転結, PREP), and revision tracking. Triggers on requests for 文章推敲, 共同執筆, 文章校正, 敬語調整, 文体統一, レビュー依頼, ドキュメント編集.

LinkX-Japan/ai-souken-workflows62026年3月12日 更新

docx-jp

無料日本語概要

Generate Japanese Word documents (.docx) using python-docx with proper Japanese fonts, vertical writing (縦書き), ruby text (ふりがな), and business templates. Triggers on requests to create Word文書, 見積書docx, 請求書docx, 日本語Word, 縦書き文書, ビジネス文書Word.

LinkX-Japan/ai-souken-workflows62026年3月12日 更新

frontend-design-jp

無料日本語概要

Japanese frontend and web design skill covering typography, vertical writing, form handling, accessibility (JIS X 8341-3), and common Japanese UI patterns. Triggers on requests for 日本語Webデザイン, フロントエンド, 和文タイポグラフィ, Japanese web design.

LinkX-Japan/ai-souken-workflows62026年3月12日 更新

LinkX-Japan のスキルをすべて見る

このスキルの問題を報告する