Class: AMPReportingService

AMPReportingService

This class encapsulates all of functionality for submitting accessibility concerns identified using Continuum to AMP. Reporting test results from Continuum to AMP is accomplished through a kind of state machine, where you set the active AMP instance, organization, asset, report, and module to use; once these are set, they remain set for as long as they're not set again and for as long as Continuum is initialized. Depending on the report and module management strategies you decide to use—see ReportManagementStrategy and ModuleManagementStrategy, respectively—invoking AMPReportingService#submitAccessibilityConcernsToAMP will first create, overwrite, and/or delete reports and modules from AMP, then publish your test results to the active AMP module. You can set the active report and module management strategies using AMPReportingService#setActiveReportManagementStrategy and AMPReportingService#setActiveModuleManagementStrategy, respectively. Only once all of these active items are set should you invoke AMPReportingService#submitAccessibilityConcernsToAMP using the list of accessibility concerns you'd like to report. More on report and module management strategies: they are designed with two primary use cases in mind: continuous integration (CI) workflows (where you usually want to retain the results of previously published reports), and more manual workflows (e.g. when Continuum is run from a developer's local workstation, where you usually don't want to retain the results of previously published reports). Choosing the correct report and module management strategies to meet your business objectives is critical to using Continuum's AMP reporting functionality correctly, so please consult our support documentation for more information.
Source:
Returns:
Type
AMPReportingService

Members

activeModule

Gets the active module. This is null if setActiveModuleById or setActiveModuleByName hasn't been invoked to set an active module yet. Use this to access the active module's metadata, e.g. its ID in AMP, its name, etc.
Source:
See:

activeReport

Gets the active report. This is null if setActiveReportById or setActiveReportByName hasn't been invoked to set an active report yet. Use this to access the active report's metadata, e.g. its ID in AMP, its name, etc.
Source:
See:

Methods

(async) setActiveAsset(assetId)

Validates the specified ID of an existing asset in AMP, then sets it as the active asset in Continuum such that next time AMPReportingService#submitAccessibilityConcernsToAMP is invoked, test results will be submitted to this active asset. Make sure you first set the active organization for this asset prior to invoking this function using AMPReportingService#setActiveOrganization.
Parameters:
Name Type Description
assetId number the ID of the AMP asset to make active
Source:
Throws:

(async) setActiveModuleById(moduleId)

Validates the specified ID of an existing module in AMP, then sets it as the active module in Continuum such that next time AMPReportingService#submitAccessibilityConcernsToAMP is invoked, test results will be submitted to this active module. Make sure you first set the active organization, asset, and report for this module prior to invoking this function using AMPReportingService#setActiveOrganization, AMPReportingService#setActiveAsset, and AMPReportingService#setActiveReportById or AMPReportingService#setActiveReportByName, respectively. While using ReportManagementStrategy#OVERWRITE as your report management strategy, use AMPReportingService#setActiveModuleByName instead of this method; see the documentation for ReportManagementStrategy#OVERWRITE for details as to why.
Parameters:
Name Type Description
moduleId number the ID of the AMP module to make active
Source:
Throws:

(async) setActiveModuleByName(moduleName, moduleLocation) → {number}

Sets the active module in AMP to submit test results to next time AMPReportingService#submitAccessibilityConcernsToAMP is invoked. The module name specified is validated if the active report already exists in AMP, but unlike AMPReportingService#setActiveModuleById, this method will not throw an exception if the specified module does not yet exist in AMP; it will be created next time AMPReportingService#submitAccessibilityConcernsToAMP is invoked. Make sure you first set the active organization, asset, and report for this module prior to invoking this function using AMPReportingService#setActiveOrganization, AMPReportingService#setActiveAsset, and AMPReportingService#setActiveReportById or AMPReportingService#setActiveReportByName, respectively.
Parameters:
Name Type Description
moduleName string the name of the AMP module to make active
moduleLocation string the name of the location in the website or app being tested; this can be a fully qualified URL, or simply a page title like "Login Page"
Source:
Throws:
Returns:
the ID of the AMP module, if it already exists; null if the module does not yet exist in AMP
Type
number

setActiveModuleManagementStrategy(moduleManagementStrategy)

Sets the active module management strategy to use next time AMPReportingService#submitAccessibilityConcernsToAMP is invoked. Choosing the correct report and module management strategies to meet your business objectives is critical to using Continuum's AMP reporting functionality correctly, so please consult our support documentation for more information.
Parameters:
Name Type Description
moduleManagementStrategy ModuleManagementStrategy the preferred management strategy to use when creating and editing AMP modules
Source:

(async) setActiveOrganization(organizationId)

Validates the specified ID of an existing organization in AMP, then sets it as the active organization in Continuum such that next time AMPReportingService#submitAccessibilityConcernsToAMP is invoked, test results will be submitted to this active organization.
Parameters:
Name Type Description
organizationId number the ID of the AMP organization to make active
Source:
Throws:
  • if the specified organization ID is null
    Type
    IllegalArgumentException
  • if an error is encountered while attempting to connect to AMP to validate the specified organization ID
    Type
    HttpErrorException
  • if the specified organization may not exist in the active AMP instance or is otherwise not accessible
    Type
    NotFoundException

(async) setActiveReportById(reportId)

Validates the specified ID of an existing report in AMP, then sets it as the active report in Continuum such that next time AMPReportingService#submitAccessibilityConcernsToAMP is invoked, test results will be submitted to this active report. Make sure you first set the active organization and asset for this report prior to invoking this function using AMPReportingService#setActiveOrganization and AMPReportingService#setActiveAsset, respectively.
Parameters:
Name Type Description
reportId number the ID of the AMP report to make active
Source:
Throws:

(async) setActiveReportByName(reportName) → {number}

Sets the active report in AMP to submit test results to next time AMPReportingService#submitAccessibilityConcernsToAMP is invoked. The report name specified is validated, but unlike AMPReportingService#setActiveReportById, this method will not throw an exception if the specified report does not yet exist in AMP; it will be created next time AMPReportingService#submitAccessibilityConcernsToAMP is invoked. Make sure you first set the active organization and asset for this report prior to invoking this function using AMPReportingService#setActiveOrganization and AMPReportingService#setActiveAsset, respectively.
Parameters:
Name Type Description
reportName string the name of the AMP report to make active
Source:
Throws:
Returns:
the ID of the AMP report, if it already exists; null if the report does not yet exist in AMP
Type
number

setActiveReportManagementStrategy(reportManagementStrategy)

Sets the active report management strategy to use next time AMPReportingService#submitAccessibilityConcernsToAMP is invoked. Choosing the correct report and module management strategies to meet your business objectives is critical to using Continuum's AMP reporting functionality correctly, so please consult our support documentation for more information.
Parameters:
Name Type Description
reportManagementStrategy ReportManagementStrategy the preferred management strategy to use when creating and editing AMP reports
Source:

(async) submitAccessibilityConcernsToAMP(accessibilityConcerns) → {boolean}

Submits accessibility concerns to the active AMP instance, organization, asset, report, and module. Make sure to set the active AMP organization (via AMPReportingService#setActiveOrganization), asset (via AMPReportingService#setActiveAsset), report (via AMPReportingService#setActiveReportById or AMPReportingService#setActiveReportByName), and module (via AMPReportingService#setActiveModuleById or AMPReportingService#setActiveModuleByName) prior to invoking this function. The active instance, organization, and asset must all already exist in AMP prior to invoking this function, otherwise an exception will be thrown; reports and modules don't need to exist in AMP yet, as they will be created if necessary. Also, make sure to set your desired report and module management strategies prior to invoking this function using AMPReportingService#setActiveReportManagementStrategy and AMPReportingService#setActiveModuleManagementStrategy, respectively, according to your use case. Choosing the correct report and module management strategies to meet your business objectives is critical to using Continuum's AMP reporting functionality correctly, so please consult our support documentation for more information.
Parameters:
Name Type Description
accessibilityConcerns Array.<AccessibilityConcern> the list of accessibility concerns to submit to AMP
Source:
Throws:
  • if the active instance, organization, asset, report, or module is not set
    Type
    IllegalStateException
  • if an error is encountered while attempting to connect to AMP to validate the active organization, asset, report, or module
    Type
    HttpErrorException
  • if the active instance, organization, or asset may not exist in AMP as specified, or if an error occurs while attempting to create the necessary report or module in AMP (if applicable)
    Type
    NotFoundException
Returns:
true if uploading of the specified accessibility concerns to AMP succeeded; false if it did not
Type
boolean