Giter Site home page Giter Site logo

a11y-tests-web's People

Contributors

andymsuk avatar ankitjain0105 avatar anthonyec avatar beegodwin avatar ben-wormald avatar benjaminhobbs avatar cjewell47 avatar dineshraj avatar heathercorajebbc avatar henrywarne avatar jamesfranklin91 avatar jamestclark avatar jennyrobertsonbbc avatar krishs03 avatar mattgreenham avatar robtpaton avatar sbason avatar syke80 avatar usainbloot 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

Watchers

 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

a11y-tests-web's Issues

npm run coverage results in one error

Summary

npm run coverage results in a failing test on branch master

Expected Behaviour

Tests should pass

Current Behaviour

output from npm run coverage is:

  1) bbcA11y build() Paths and baseUrl and visit and options outputs the basic config for the paths, with the defined baseUrl, and with the visit function:
     AssertError: expected writeFileSync to be called with arguments
a11y.js


    page(
      "http://base.url/path/1",
      {
        visit: function (){/* Do something */cov_17hr8di7tb.f[0]++;},
        "some":"option"
      }
    )

    page(
      "http://base.url/path/2",
      {
        visit: function (){/* Do something */cov_17hr8di7tb.f[0]++;},
        "some":"option"
      }
    )


   match()
      at Object.fail (node_modules/sinon/lib/sinon/assert.js:96:21)
      at failAssertion (node_modules/sinon/lib/sinon/assert.js:55:16)
      at Object.assert.(anonymous function) [as calledWith] (node_modules/sinon/lib/sinon/assert.js:80:13)
      at Context.it (test/lib/bbcA11y.js:175:24)

Your Environment

  • version "5.1.0"`

Update dependencies to fix vulnerabilities

Running npm audit today gives found 62 vulnerabilities (24 low, 3 moderate, 33 high, 2 critical) in 1921 scanned packages. We should fix as many of these as possible.

`npm run start:lighthouse:junit-headless` sometimes hangs

Summary

npm run start:lighthouse:junit-headless sometimes hangs and doesn't exit

Expected Behaviour

npm run start:lighthouse:junit-headless will finish successfully or unsuccessfully and exit every time.

Current Behaviour

npm run start:lighthouse:junit-headless sometimes hangs and doesn't exit

Possible Solution

Might be fixed by #26

Environment

Seen on our Jenkins and on some Macbooks

visit option is not getting passed to bbc-a11y

Summary

The visit option in options does not work on in a11y-tests-web.
Assuming a minimal config where are not using signedInPaths:

module.exports = {
  options: {
    visit: function (frame) {
        /* code */
    },
    hide: [],
    skip: []
  },
  baseUrl: 'http://localhost:3000',
  paths: [ '/' ],
  signedInPaths: [ ]
};

Expected Behaviour

The visit option works in bbc-a11y but does not work in a11-tests-web. It would be great to have this because we would like to inject a script to wait for the page to fully render.

The output sent to bbc-a11y would ideally be like this:

page( "http://localhost:3000/", { "hide":[],"skip":[], "visit": function() { ... } })

Current Behaviour

The visit option is currently not getting passed to bbc-a11y. This is because a JSON.stringify is stripping out the function. The built-in behaviour of JSON.stringify is to remove functions:

If undefined, a Function, or a Symbol is encountered during conversion it is either omitted (when it is found in an object) or censored to null (when it is found in an array).

The output sent to bbc-a11y currently looks like:

page( "http://localhost:3000/", { "hide":[],"skip":[] })

Possible Solution

There's probably a nicer way, but this, for example, seems to fix the problem:

   return `
     page(
       "${baseUrl}${path}",
       {
         ${visitOptions}
+        visit: ${options.visit.toString()},
         ${JSON.stringify(options).slice(1, -1)}
       }
     )
   `;

We make a change to what pathToOutput returns โ€“ we explicitly take the function body of options.visit and convert it to a string, outside of the JSON.stringify.

Your Environment

  • Version used: 3.1.0
  • Operating System and version: macOS Sierra Version 10.12.6 (Google Chrome Version 66.0)
  • Link to your project: (testing a11y-tests-web locally for now)

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.