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.injectAxe() is Causing Cypress Test Runner to Freeze #53

Open
todd-m-kemp opened this issue Aug 7, 2020 · 3 comments
Open

cy.injectAxe() is Causing Cypress Test Runner to Freeze #53

todd-m-kemp opened this issue Aug 7, 2020 · 3 comments

Comments

@todd-m-kemp
Copy link

todd-m-kemp commented Aug 7, 2020

Whenever I try to use cy.injectAxe() in a test, Cypress gets stuck at the step immediately prior. The Cypress test runner itself is locked and must be force-quit.

Here is code to reproduce the problem.

context('Problem with cy.injectAxe()', function () {

  beforeEach (function () {
    // These are not real credentials.
    // Please sign up (for free) at www.vidyard.com, verify your email address, then update these accordingly before running.
    const email = 'yourEmailAddress@fake.com'
    const password = 'password123!'

    cy.visit('https://secure.vidyard.com/user/sign_in')
    cy.get('#username').type(email)
    cy.get('#password').type(password)
    cy.get('#sign-in').click()
    cy.wait(10000) // Just to make sure the page is fully loaded.
  })

  it('Accessibility Test', function () {
    // When the lines below are commented out, there is no issue.
    // When the lines are let to run, the Cypress Test Runner gets stuck on the cy.wait step.
    // Cypress will be completely frozen and must be force quit.
    cy.injectAxe()
    cy.checkA11y()
  })
})

I am using Cypress version 4.12.1 and cypress-axe version 0.8.1 on macOS 10.14.6 with Chrome 84.0.4147.105 and Firefox 79.0.

@todd-m-kemp
Copy link
Author

I thought I would check this again after Cypress version 5.1.0 was released and regrettably this is still a problem. ☹️

@davidhousedev
Copy link

@todd-m-kemp I think I'm encountering this too. I found that it was only the combination of running both injectAxe and checkA11y functions for the same page that triggered the error. I could run either of them independently and there wasn't a problem.

Additionally, I am able to run everything just fine for most of my pages, except I added a new one (which happens to be the only one that is SSR'd by gatsby) and whatever conditions exist on that page cause this freeze to occur.

In case it helps:

    "cypress-axe": "^0.8.1",
    "cypress": "^5.3.0",

@cipivanov
Copy link

I managed to "fix" my Cypress runner freezing issue by bumping cypress-axe to 0.13.0.

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

3 participants