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

cy.checkA11y() is accepting only 2 arguments I need to set skipFailures to 'True' #39

Open
Pawanesh1 opened this issue May 6, 2020 · 4 comments

Comments

@Pawanesh1
Copy link

Pawanesh1 commented May 6, 2020

I need to disables assertions based on violations and only logs violations to a report, so was trying to pass 4 arguments to cy.checka11y() as described by @avanslaars , but got an error

0-2 arguments expected, got 4

package.json
"devDependencies": {
"@type/cypress-axe":"0.4.0"
"cypress-axe": "^0.8.1"
}

#https://github.com/avanslaars/cypress-axe

@avanslaars
Copy link
Collaborator

avanslaars commented May 7, 2020

I would need some context to see where the error is coming from and what your actual test code looks like. Currently, cy.checkA11y() accepts 4 arguments, with skipFailures being the last. If you want to provide some code and more information about where you see that error, maybe we can get that sorted out.

https://github.com/avanslaars/cypress-axe/blob/master/src/index.js#L17-L21

@Pawanesh1
Copy link
Author

Pawanesh1 commented May 7, 2020

@avanslaars The problem starts with initial setup I suppose.
My cy.injectAxe() and cy.checka11y() commands are not recognized. Here is what I did

  1. I already had cypress in installed - "cypress": "^4.1.0"
  2. I ran the command npm i -D cypress-axe
    3 added import 'cypress-axe' to Cypress/support/index.js file
  3. update tests to include cy.injectAxe() in beforeall, after cy.visit()
    but it gave me error :
    "Property 'injectAxe' does not exist on type 'cy & EventEmmitter' "
    Then I ran the command: npm i @types/cypress-axe and the error was resolved, but now cy.checkA11y() accepts only 2 arguments.

@vasanthkumar258
Copy link

vasanthkumar258 commented Jun 28, 2020

@Pawanesh1.. see that @types file is having latest version "@types/cypress-axe": "^0.8.0" and cypress-axe: "^0.8.1"

@sapegin
Copy link
Member

sapegin commented Oct 26, 2020

Do you still have this problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants