Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to set configuration options programmatically with Accessibility Checker API [Feature]: #2125

Open
jamalmazrui opened this issue Dec 10, 2024 · 3 comments
Labels
node-accessibility-checker Issues in the accessibility-checker component user-reported Issues identified outside of the core team

Comments

@jamalmazrui
Copy link

Project

accessibility-checker-engine, accessibility-checker for Node

Description

I have searched documentation and examples extensively but not found a way to set configuration options programmatically when using the Node Accessibility-checker API. The technique of using a .achecker.yml configuration file in the project root directory does work, but it is overly restrictive. It requires that directory to be the current directory when running the .js program. It requires desired output formats to be specified in advance, before the program is run. It does not allow flexibility in the names of the output files.

Please add to the API something like a checker.setConfiguration method for passing options at runtime. Please create separate methods for saving the various formats to disk, e.g., report.saveXlsx(sFilePath) for saving Excel output from the report object obtained from the getCompliance method. Similarly, there might be saveCsv, saveJson, and saveHtml methods. If the calling code awaits the return of such methods, that could be a way of ensuring they are fully flushed to disk (see other issue about this).

@tombrunet
Copy link
Member

Are you trying to change configuration options during the test? Note that there is a .js version of the configuration file that allows loading configuration via environment variables and such. Trying to better understand exactly how you're trying to use it.

@MHoov MHoov added node-accessibility-checker Issues in the accessibility-checker component user-reported Issues identified outside of the core team labels Dec 10, 2024
@jamalmazrui
Copy link
Author

I want my Node.js program, which requires accessibility-checker, to create a unique directory name to store test results, in multiple formats, for each page tested. The unique name for the output directory is determined at runtime, so I am hoping for a way that my program can set the value of the output directory just before calling the getCompliance method, in order that the output files (results.csv, results.json, results.html, and results.xlsx) are saved in that directory.

@jamalmazrui
Copy link
Author

I found a hack as a workaround. My program creates the configuration file at runtime and saves it in the current directory just before calling the getCompliance method. Here is the initial release of my program called TestPage:

https://github.com/jamalmazrui/testpage

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
node-accessibility-checker Issues in the accessibility-checker component user-reported Issues identified outside of the core team
Projects
None yet
Development

No branches or pull requests

3 participants