mwmcode / cypress-axe-core

Test accessibility with axe-core in Cypress.
MIT License
5 stars 0 forks source link

Webpack Compilation Error #11

Open vijar50 opened 3 years ago

vijar50 commented 3 years ago

Hi I am trying to upgrade my Cypress repo to the latest version. 6.6.0 -> 8.2.0 I've upgraded my dependencies and replaced cypress-axe with cypress-axe-core. However whenever I run my accessibility test I get: image

I followed the instructions on https://github.com/mcha-dev/cypress-axe-core

This error surfaces once I enable logging in plugins/index.js

mwmcode commented 3 years ago

May I ask what node version you're running?

vijar50 commented 3 years ago

Node v16.3.0 Npm v7.15.1

vijar50 commented 3 years ago

It seems that the key difference is updating plugins/index.js to support cypress tasks Additionally I am using .feature files specified through npm cypress-cucumber-preprocessor

mwmcode commented 3 years ago

Yes, that's what's happening here.

I'm not familiar with cypress-cucumber but if you can configure it to have a .js extension (i.e. .feature.js) it might solve your problem.

https://github.com/TheBrainFamily/cypress-cucumber-preprocessor#output

vijar50 commented 3 years ago

Hi this turned out to be an issue with the usage of cy.task and switching cypress-axe -> cypress-axe-core as well as updating plugins/index.js. Fortunately cypress-axe just pushed v 0.13.0 so I don't have to use cy.task and update the plugins/index.js file. My tests run/pass successfully.