コンテンツ ドリブン ウェブアプリ フロントエンドのテスト
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
テストは、コンテンツ主導のウェブ アプリケーションの機能、品質、ユーザー補助、セキュリティ、パフォーマンスを確保するために不可欠です。テストにより、ユーザー エクスペリエンスを評価し、さらなる開発が必要かどうかを判断できます。ウェブ アプリケーションは、品質基準を満たし、期待どおりに動作する必要があります。
これは、ウェブ アプリケーションを使いやすくし、使いやすいものにするための基本的なテスト ガイダンスです。
コンポーネント |
色のコントラスト |
読みやすくするためにコントラスト比を最適化します。さまざまな種類の色覚異常やユーザー定義の高コントラスト強制色について、チェックを行う必要があります。
|
タイポグラフィ |
アプリがさまざまなデバイスや設定に対応しているかどうかを判断します。相対フォントサイズと非線形スケーリングを使用することで、タイポグラフィを最大サイズで引き続き使用できます。 |
画像 |
画像の品質が高く、読み込みが早いことを確認します。ネットワークがない状態で、適切なフォールバックと、高解像度用に最適化されたアセットを確認することが重要です。 |
ナビゲーション |
ナビゲーションが明確で、マウス、タップ、キーボードによるナビゲーションを使用できるようにします。
履歴 API をチェックすると、戻ると進むナビゲーションが正しく保持されるようになります。
|
検索 |
URL クエリ パラメータと検索フィールドで、クエリへの応答時間が短いことを確認します。 |
フォーム |
すべてのフォームを、入力しやすく、送信しやすいものにします。デフォルトのフォーム送信をオーバーライドする場合は、適切なイベントをリッスンしてチェックし、フォームが適切にリセットされ、悪意のあるユーザー入力から保護されるようにする必要があります。 |
パフォーマンス |
アプリケーションの効率と応答性を高め、読み込みを高速化します。これも回帰テストの重要な部分です。
|
ウェブのユーザー補助機能をチェックできるツールは多数あります。さまざまなユーザー補助コンポーネントに対応するには、複数のメソッドを使用することが重要です。ARIA ラベル、DOM 要素の a11y、キーボード ナビゲーション、スクリーン リーダーの使用状況を必ず確認してください。
Jest、Vitest、Cypress、Mocha、Jasmine などのフロントエンド テスト フレームワークを使用すると、テストを効率的に作成し、動作ドリブンおよびテストドリブン開発がサポートされます。CI/CD パイプラインとの統合により、テストを自動化し、commit の回帰バグを防ぐこともできます。
Web Test Runner、Playwright、Web Driver、Node.js のテストランナーなどのランナー フレームワークを使用すると、これらのテストを効率的に実行し、複数の環境とプラットフォームでのテストがサポートされます。これは網羅的なリストではなく、使用しているフレームワークによっては、テストが組み込まれている場合があります。
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-07-25 UTC。
[null,null,["最終更新日 2025-07-25 UTC。"],[[["\u003cp\u003eTesting is essential for ensuring the functionality, quality, accessibility, security, and performance of your web application, ultimately enhancing user experience.\u003c/p\u003e\n"],["\u003cp\u003eKey components of web application testing include color contrast, typography, images, navigation, search, forms, and performance.\u003c/p\u003e\n"],["\u003cp\u003eUtilize a variety of accessibility testing tools and methods to cover a comprehensive range of components like ARIA labels, keyboard navigation, and screen reader compatibility.\u003c/p\u003e\n"],["\u003cp\u003eLeverage front-end testing frameworks such as Jest, Vitest, Cypress, Mocha, or Jasmine to efficiently write and automate tests, supporting both behavior-driven and test-driven development.\u003c/p\u003e\n"],["\u003cp\u003eEmploy runner frameworks like Web Test Runner, Playwright, Web Driver, or Node.js's Test Runner for executing tests across multiple environments and platforms.\u003c/p\u003e\n"]]],["Testing should evaluate web application accessibility, functionality, and performance. Key actions include checking color contrast for readability, ensuring relative typography scaling, and verifying image quality and load times. Navigation should be usable via mouse, touch, and keyboard. Search response times should be fast, and forms must be user-friendly with appropriate event handling. Performance, including fast load times, is vital. Multiple tools and front-end frameworks (e.g., Jest, Cypress) can aid in this process, and automation via CI/CD pipelines is recommended.\n"],null,["# Testing a content-driven web app frontend\n\nTesting is crucial to ensuring the functionality, quality, accessibility,\nsecurity, and performance of your content driven web application. Testing lets\nyou assess the user experience and determine if further development is\nnecessary. Your web application should meet quality standards and perform as\nexpected.\n\nThis provides basic testing guidance for you to consider to make your web\napplication accessible and user-friendly.\n\n| Components ||\n|----------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Color contrast | Ensures that the contrast ratio is optimized for readability. Checks need to be done for various types of color blindness and user defined high contrast forced colors. |\n| Typography | Determines if the application accommodates different devices and settings. By using relative font size and non linear scaling the typography can still be usable on the max size. |\n| Images | Ensures that the images are high quality and can load quickly. It is important to check for correct fallbacks with no network and optimized assets for higher resolutions. |\n| Navigation | Ensures that the navigation is clear and usable by mouse, touch and keyboard navigation. Checking the history api ensures the back and forward navigation is also preserved correctly. |\n| Search | Check for low latency in response times to queries in the URL query parameters and search field. |\n| Form | Ensures that all forms are user-friendly to complete and submit. If overriding the default form submission the correct events need to be listened to and checked for proper form reset and protection against malicious user input. |\n| Performance | Ensures that the application is efficient and responsive, with fast load times. This should be an important part of regression testing too. |\n\nThere are [many tools](https://www.w3.org/WAI/ER/tools/) you can\nuse to check web accessibility. It is important to use multiple methods in order\nto cover the range of accessibility components. Be sure to check for ARIA\nlabels, a11y on DOM elements, keyboard navigation, and screen reader use.\n\nFront end testing frameworks, such as [Jest](https://jestjs.io/),\n[Vitest](https://vitest.dev/),\n[Cypress](https://www.cypress.io/),\n[Mocha](https://mochajs.org/) or\n[Jasmine](https://jasmine.github.io/) help you write tests\nefficiently and support behavior-driven and test-driven development. With\nintegrations into CI/CD pipelines you can also automate your tests and help\nprevent regression bugs in commits.\n\nRunner frameworks, such as [Web Test\nRunner](https://modern-web.dev/docs/test-runner/overview/),\n[Playwright](https://playwright.dev/), [Web\nDriver](https://webdriver.io/) or the [Test Runner in\nNode.js](https://nodejs.org/api/test.html) let you execute these\ntests efficiently and support testing across multiple environments and\nplatforms. This is not an exhaustive list and depending on the framework you are\nusing there could be testing built-in."]]