-
Notifications
You must be signed in to change notification settings - Fork 44
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
cy.pa11y() fails with "Failed to fetch browser webSocket URL from http://localhost:65406/json/version" #172
Comments
I just pulled the project to my personal PC running Windows and it worked. I believe IT might be managing my work MacBook, maybe they've blocked something. Do you have any ideas what could cause the issue? I'll ask the IT guys if they know anything :) |
Is it possible to set which port Pa11y is using? I can see for lighthouse I can pass opts and configs when calling but I can't see any documentation to do the same for pa11y on cypress-audit Documentation |
I was facing this same issue. After adding logs I came to know that the issue was coming from this method call where the library is using puppeteer to connect to the browser. In my case, I was running the cypress server from a docker container and spawning the browser on the host machine. This means that there are two separate networks here. So for the code localhost was docker's network and not the host machine's network. We fixed it by changing the localhost as shown here. So please check if localhost is being resolved or not in your case.
Do you mean the remote debugging port? If yes then you can set the |
Thanks for the reply @pranavj1001, unfortunately it's not a localhost issue for me, I get the same issue on any site I try to use Pa11y on. It seems to be related to my work laptop, a few of us can run the code fine on our personal machines but not on our work assigned devices. I did try changing the remote debugging port but there's an open issue with Cypress that stops it working cypress-io/cypress#21167 |
Hey @MichaelRobsonSliide, by localhost issue I did not mean the site on which you're trying to use pa11y. By localhost, I meant the hardcoded URL that is written here. This URL is used to connect to the browser. |
I'm not sure what I would change that too, I tried my local IP address and some different ports instead of localhost but I still get the same. The app I'm trying to test is running locally on my laptop. If I use pa11y through command line it works fine it's just when I try to use it on this laptop through cypress-audit that I get the error. |
Hey @MichaelRobsonSliide and @mfrachet, I was facing the exact same issue and was really confused why this was no longer working, since it had already worked for me. As I was browsing through the issues I came across an older Issue that was closed, where someone mentioned that this problem might be caused when using Node.js 17+ (#136 (comment)). When it was working before, I was using a lower version and upgraded later on for some other tools. I think that is also the reason why you @mfrachet were not able to reproduce it and why you @MichaelRobsonSliide had the issue fixed somehow, when working on another machine. Therefore, I would suggest either stating somewhere that the Node.js version must be below 17 or fixing the issue. (Instead of downgrading the Version I used the same workaround presented by RJKeane2000 in that comment and @pranavj1001 in this discussion.) |
I am having the same issue `has no detectable a11y violations on load (pa11y)failed
|
What does not work?
When I try to run the cy.pa11y() command it always fails with
How to reproduce?
I followed the set up from https://mfrachet.github.io/cypress-audit/ I also pulled this repo and tried the examples but I get the same issue no matter what site I am trying to run pa11y against.
Expected behavior
Pa11y is run
Screenshots / Animated Gifs
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: