component-driven / component-driven/cypress-axe

TypeError: Cannot read property 'run' of undefined at Context.eval

Open
#154 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
641
Forks
90
Avg merge
6h 8m
Merged PRs (30d)
1

Description

Hi Im following the documentation and I want a test that runs wcag2a and 2aa issue only but im getting a read property error im not sure why.

`// Define at the top of the spec file or just import it
function terminalLog(violations) {
    cy.task(
      'log',
      `${violations.length} accessibility violation${
        violations.length === 1 ? '' : 's'
      } ${violations.length === 1 ? 'was' : 'were'} detected`
    )
    // pluck specific keys to keep the table readable
    const violationData = violations.map(
      ({ id, impact, description, nodes }) => ({
        id,
        impact,
        description,
        nodes: nodes.length
      })
    )
  
    cy.task('table', violationData)
  }


describe('Womens T20 Cricket Test',() => {
    it('Has no detectable a11y violations on load (with custom parameters)', () => {
        cy.visit('https://www.skysports.com');
        cy.iframe('#sp_message_iframe_758392').find('.sp_message-accept-button').should('be.visible').click()
        cy.checkA11y(null, null, terminalLog, {
          runOnly: {
            type: 'tag',
            values: ['wcag2a', 'wcag2aa', 'wcag2aaa']
          }
        })
      })
    });`

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the documented Cypress spec usage around cy.checkA11y, cy.iframe, and the terminalLog callback, then reproduce the shown test against the reported error. Check the Cypress command setup and the exact point where the undefined value is accessed; done means identifying the cause of the TypeError and confirming the accessibility test runs with the requested tags.

Written by the indexing model from the issue text.

Assessment

Tech stack
cypress, javascript
Domain
accessibility, testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.