UNPKG

accessibility-checker

Version:

An automated testing tools for accessibility testing using Puppeteer, Selenium, or Zombie

73 lines (69 loc) 3.14 kB
/****************************************************************************** Copyright:: 2020- IBM, Inc Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *****************************************************************************/ /******************************************************************************* * NAME: ACMetricsLogger.js * DESCRIPTION: Common Metrics logger object which can be shared between tools * to upload metrics of the tool to the metrics server. *******************************************************************************/ import { ILogger } from "../api/IChecker"; /** * This function is responsible for constructing the accessibility-checker Metrics object which contains all the function * that are needed to upload scan metrics to the metric server. * * @param {String} toolName - The name of the tool sending the metrics. * @param {String} logger - Logger object which can be used to log debug information. * @param {String} policies - Array of policies which will be sent to the metrics server. * * @return - N/A * * @memberOf this */ export declare class ACMetricsLogger { policies: string; metricsURLV2: string; log: ILogger; toolName: string; scanTimesV1: any[]; scanTimesV2: { [profile: string]: number[]; }; constructor(toolName: string, logger: ILogger, policies: string[]); /** * This function is responsible for profiling the testcases and adding the scan time to the global * array which will be sent to the metrics server to log the number of scans that were performed. * This function profiles scanTimes for the V2 metric server: * https://aat.w3ibm.mybluemix.net * * In the case that user provides any url that is https://aat* it will upload based on accountId * * @param {String} scanTime - Provide the time it took for the testcase to run * @param {String} profile - The type of profile the scan time is for: * i.e. browser information, features, etc... * * @return N/A - Global scanTimesV2 object is updated with the time * * @memberOf this */ profileV2(scanTime: number, profile: string): void; /** * This function is responsible for uploading scan results to the metrics server: * https://aat.w3ibm.mybluemix.net * * @param {Function} done - The browser on which the testcases were run on * * @return N/A - performs the upload of the metrics to the server * * @memberOf this */ sendLogsV2(done: any, rulePack: any): Promise<void>; }