Axe DevTools Node Logger APIリファレンス

This page is not available in the language you requested. You have been redirected to the English version of the page.
Link to this page copied to clipboard

@axe-devtools/loggerパッケージ用APIリファレンス

Not for use with personal data

このドキュメントでは、@axe-devtools/loggerパッケージ内のAxeDevToolsLoggerクラスによって実装されたメソッドについて説明します。

コンストラクタ

Axe DevToolsロガーを作成し、指定されたディレクトリにJSON結果ファイルを書き込むことができます。この結果ファイルからレポーターAPIを使用して、さまざまな形式でレポートを生成できます。

constructor(reportName: string, directory?: string)

使用例:

let logger = new AxeDevToolsLogger("Report Name", "directory-name");
note

AxeDevToolsReporterクラスはこのクラスから継承されているため、通常、AxeDevToolsReporterインスタンスを通じてAxeDevToolsLoggerクラスのメソッドを呼び出します。

パラメーター

名前 説明
reportName 文字列 レポートの名前で、出力結果ファイル名の最初の部分になります。
directory 文字列(オプション) ロガーAPIがJSON結果ファイルを書き込むディレクトリ

メソッド

名前 説明
getTestResults テスト結果の配列を返します。
logTestResult テスト結果をログに記録します。

getTestResults

Axe DevToolsテスト結果の配列を返します。結果はuserAgentでフィルタリングできます。

public getTestResults(userAgent?: string): AxeDevToolsResults[] 

パラメーター

名前 説明
userAgent 文字列(オプション) 結果をフィルタリングするためのuserAgentを指定します。userAgentが一致する結果のみがディスクに書き込まれます。

戻り値

AxeDevToolsResultsの配列

logTestResult

現在のアクセシビリティ結果をディスクにログ記録します。コード例についてはレポーターコード例を参照してください。

public logTestResult(
    id: string,
    finding: Findings,
    options?: LogTestResultOptions
  ): void

パラメーター

名前 説明
id 文字列 ユーザー指定の識別子です
検出結果 検出結果オブジェクト テストの実行から得られる検出結果オブジェクトで、通常はrun()またはanalyze()からの結果オブジェクトです
オプション LogTestResultsOptions オブジェクト(オプション) ログの設定オプション

戻り値

何も返されません