Coder Social home page Coder Social logo

wpaccessibility / wp-theme-auditor Goto Github PK

View Code? Open in Web Editor NEW
57.0 2.0 5.0 2.85 MB

Accessibility auditing tools for WordPress themes.

License: GNU General Public License v2.0

JavaScript 98.45% HTML 1.55%
accessibility axe wordpress wp-theme-auditor

wp-theme-auditor's People

Contributors

dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

wp-theme-auditor's Issues

Package.json file in readme

Hi from WC EU!

Note from user: Would be nice to have in readme that there needs to be package.json file. You can do that by running npm init.

Also note that these commands needs to be run inside you theme root folder.

ELIFECYCLE errno 1 when running npm run test:axe

At the contributor day of WordCmap London we (@Netzberufler @GaryJones @rianrietveld) tested the auditor.

Test environment:
Local site http://one.wordpress.test/ running on VVV
Node: v10.15.1
Npm: 6.9.0
Installed the a11y-theme-unit-test
Used the twentynineteen theme

Followed the install instructions like in the readme.

We run into the following issue while running npm run test:axe:
The tests are run, relevant axe data is shown in the terminal but at the end the script crashes:

Test Suites: 53 failed, 53 total
Tests:       53 failed, 53 total
Snapshots:   0 total
Time:        78.189s
Ran all test suites.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] test:axe: `npx wp-scripts test-e2e`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] test:axe script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/rianrietveld/.npm/_logs/2019-04-05T11_54_33_198Z-debug.log

And in the /Users/rianrietveld/.npm/_logs/2019-04-05T11_54_33_198Z-debug.log

0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'run', 'test:axe' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'pretest:axe', 'test:axe', 'posttest:axe' ]
5 info lifecycle [email protected]~pretest:axe: [email protected]
6 info lifecycle [email protected]~test:axe: [email protected]
7 verbose lifecycle [email protected]~test:axe: unsafe-perm in lifecycle true
8 verbose lifecycle [email protected]~test:axe: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/$
9 verbose lifecycle [email protected]~test:axe: CWD: /Users/rianrietveld/vagrant-local/www/wordpress-one/public_html/wp-content$
10 silly lifecycle [email protected]~test:axe: Args: [ '-c', 'wp-scripts test-e2e' ]
11 silly lifecycle [email protected]~test:axe: Returned: code: 1  signal: null
12 info lifecycle [email protected]~test:axe: Failed to exec test:axe script
13 verbose stack Error: [email protected] test:axe: `wp-scripts test-e2e`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:301:16)
13 verbose stack     at EventEmitter.emit (events.js:189:13)
13 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:189:13)
13 verbose stack     at maybeClose (internal/child_process.js:970:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
14 verbose pkgid [email protected]
15 verbose cwd /Users/rianrietveld/vagrant-local/www/wordpress-one/public_html/wp-content/themes/twentynineteen
16 verbose Darwin 18.5.0
17 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "test:axe"
18 verbose node v10.15.1
19 verbose npm  v6.9.0
20 error code ELIFECYCLE
21 error errno 1
22 error [email protected] test:axe: `wp-scripts test-e2e`
22 error Exit status 1
23 error Failed at the [email protected] test:axe script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

Running the same with sudo gives the same result.

Running into error - shelljs requirement

When trying to create test cases this happened:

➜  dhg_tw git:(master) ✗ npm run create-test-cases

> create-test-cases
> create-test-cases

internal/modules/cjs/loader.js:905
  throw err;
  ^

Error: Cannot find module 'shelljs'
Require stack:
- /Users/eduwass/Sites/dhg/app/public/wp-content/themes/dhg_tw/node_modules/wp-theme-auditor/bin/create-test-cases.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)
    at Function.Module._load (internal/modules/cjs/loader.js:746:27)
    at Module.require (internal/modules/cjs/loader.js:974:19)
    at require (internal/modules/cjs/helpers.js:92:18)
    at Object.<anonymous> (/Users/eduwass/Sites/dhg/app/public/wp-content/themes/dhg_tw/node_modules/wp-theme-auditor/bin/create-test-cases.js:6:15)
    at Module._compile (internal/modules/cjs/loader.js:1085:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
    at Module.load (internal/modules/cjs/loader.js:950:32)
    at Function.Module._load (internal/modules/cjs/loader.js:790:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/Users/eduwass/Sites/dhg/app/public/wp-content/themes/dhg_tw/node_modules/wp-theme-auditor/bin/create-test-cases.js'
  ]
}

Was resolved after adding shelljs to the theme root with:
npm install shelljs --save-dev

Is this expected?

Add test cases for all theme unit test data

See: https://github.com/wpaccessibility/a11y-theme-unit-test/

Posts

  • template-sticky
  • column-blocks
  • block-cover
  • block-button
  • block-image
  • block-gallery
  • block-quotes
  • block-category-common
  • blocks-embeds
  • blocks-widgets
  • blocks-layout-elements
  • blocks-formatting
  • markup-html-tags-and-formatting
  • markup-image-alignment
  • markup-text-alignment
  • title-with-special-characters
  • markup-title-with-markup
  • template-featured-image-vertical
  • template-featured-image-horizontal
  • template-more-tag
  • template-excerpt-defined
  • template-excerpt-generated
  • template-paginated
  • template-password-protected
  • template-comments
  • template-comments-disabled
  • template-pingbacks-an-trackbacks
  • media-twitter-embeds
  • post-format-standard
  • post-format-gallery
  • post-format-image
  • post-format-image-caption
  • post-format-image-linked
  • post-format-video-youtube
  • post-format-aside
  • post-format-status
  • post-format-link
  • post-format-quote
  • post-format-chat
  • title-should-not-overflow-the-content-area
  • edge-case-no-title
  • edge-case-no-content
  • edge-case-many-categories
  • edge-case-many-tags
  • edge-case-nested-and-mixed-lists

Pages

  • page-markup-and-formatting
  • page-image-alignment
  • clearing-floats
  • about
  • blog
  • page-with-comments-disabled
  • page-with-comments
  • lorem-ipsum

Typo in README.md

The text
Then you'll need to add more test cases. You can do this interactively by running npm run create-test-case from your theme's root directory.

Should be
Then you'll need to add more test cases. You can do this interactively by running npm run create-test-cases from your theme's root directory.

With an s added to the case :-)

Running into error - jest-html-reporter

Also ran into this error:

➜  dhg_tw git:(master) ✗ npm run test

> test
> npm run -s test:axe

Error: Could not resolve a module for a custom reporter.
  Module name: ./node_modules/jest-html-reporter
    at /Users/eduwass/Sites/dhg/app/public/wp-content/themes/dhg_tw/node_modules/@wordpress/e2e-tests/node_modules/jest-config/build/normalize.js:567:15
    at Array.map (<anonymous>)
    at normalizeReporters (/Users/eduwass/Sites/dhg/app/public/wp-content/themes/dhg_tw/node_modules/@wordpress/e2e-tests/node_modules/jest-config/build/normalize.js:549:33)
    at normalize (/Users/eduwass/Sites/dhg/app/public/wp-content/themes/dhg_tw/node_modules/@wordpress/e2e-tests/node_modules/jest-config/build/normalize.js:642:5)
    at readConfig (/Users/eduwass/Sites/dhg/app/public/wp-content/themes/dhg_tw/node_modules/@wordpress/e2e-tests/node_modules/jest-config/build/index.js:220:68)
    at async readConfigs (/Users/eduwass/Sites/dhg/app/public/wp-content/themes/dhg_tw/node_modules/@wordpress/e2e-tests/node_modules/jest-config/build/index.js:401:26)
    at async runCLI (/Users/eduwass/Sites/dhg/app/public/wp-content/themes/dhg_tw/node_modules/@wordpress/e2e-tests/node_modules/@jest/core/build/cli/index.js:198:59)
    at async Object.run (/Users/eduwass/Sites/dhg/app/public/wp-content/themes/dhg_tw/node_modules/@wordpress/e2e-tests/node_modules/jest-cli/build/cli/index.js:173:37)

Fixed by adding the jest-html-reporter package to theme root, with:
npm install jest-html-reporter --save-dev

npm install fails to create bin/postinstall.js file

npm install fails to create bin/postinstall.js file. I'm using npm version 6.9.0

If the bin/postinstall.js file is run from node modules node node_modules/wp-theme-auditor/bin/postinstall.js it creates an folder named 'undefined'.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.