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

[BUG]: Playwright getCompliance label with outputFilenameTimestamp true causes error #1755

Closed
EvilKarter opened this issue Nov 24, 2023 · 2 comments
Assignees
Labels
node-accessibility-checker Issues in the accessibility-checker component priority-1 (high) Ready for QA T55 Triage release 5.5 user-reported Issues identified outside of the core team

Comments

@EvilKarter
Copy link

EvilKarter commented Nov 24, 2023

Project

accessibility-checker for Node

Browser

Chrome

Operating system

Windows

Description

Hi I encountered a problem when I used playwright and the node accessibility-checker.

When I run my playwright script with getCompliance label with the configuration below (outputFilenameTimestamp:true) I always get the following error on the console:

Error: ENOENT: no such file or directory, open 'my\path\results\summary_2023-11-24T08:43:41.325Z.json'
    at Object.open (node:internal/fs/sync:78:18)
    at Object.openSync (node:fs:565:17)
    at writeFileSync (node:fs:2288:35)
    at MyFS.writeFileSync (my\path\node_modules\accessibility-checker\lib\ACHelper.js:88:32)
    at Function.<anonymous> (my\path\node_modules\accessibility-checker\lib\common\report\ReporterManager.js:354:48)
    at step (my\path\node_modules\accessibility-checker\lib\common\report\ReporterManager.js:59:23)
    at Object.next (my\path\node_modules\accessibility-checker\lib\common\report\ReporterManager.js:40:53)
    at fulfilled (my\path\node_modules\accessibility-checker\lib\common\report\ReporterManager.js:31:58)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  errno: -4058,
  code: 'ENOENT',
  syscall: 'open',
  path: 'my\\path\\results\\summary_2023-11-24T08:43:41.325Z.json'
}

It doesn't matter what I call the label.
As soon as I set outputFilenameTimestamp to true I get the error that it could not find the file summary+timestamp.

I also get the result file in the directory. But not with the name from the error, but with the name from the label.

Is this a bug or have I missed an obvious connection?

my used versions:
"accessibility-checker": "^3.1.64",
"playwright": "^1.40.0"

Steps to reproduce

my test script

const { chromium }  = await import('playwright');
const aChecker = await import('accessibility-checker');

(async () => {
  const browser = await chromium.launch();
  const context = await browser.newContext();
  const page = await context.newPage();

  await page.goto('https://github.com/IBMa/equal-access');
  // Adjust the configuration here

  // Check accessibility
  const report = await aChecker.getCompliance(page, 'myLabel');

  await browser.close();
})();

my .achecker.yml

ruleArchive: versioned
policies:
    - IBM_Accessibility
    - WCAG_2_2
failLevels:
    - violation
    - potentialviolation
reportLevels:
    - violation
    - potentialviolation
outputFormat: json
outputFolder: results
outputFilenameTimestamp: true

Call test script

node test.js
@shunguoy shunguoy added T55 Triage release 5.5 node-accessibility-checker Issues in the accessibility-checker component labels Nov 27, 2023
@tombrunet
Copy link
Member

I'm guessing a Windows issues with the :'s in the filename. We'll look.

@ErickRenteria
Copy link
Contributor

Merged

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 priority-1 (high) Ready for QA T55 Triage release 5.5 user-reported Issues identified outside of the core team
Projects
None yet
Development

No branches or pull requests

5 participants