Code Monkey home page Code Monkey logo

axe-devhub-action's People

Contributors

attest-team-ci avatar dependabot[bot] avatar dequejenn avatar enlarsen avatar github-actions[bot] avatar jclarkcisco avatar michael-siek avatar stephenmathieson avatar straker avatar zidious avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

axe-devhub-action's Issues

EPIC: gha comparison logic

When the GHA is ran, it is not taking into account the comparisons like it should. The below tickets will correct this logic error.

TODO - the above logic needs to be changed a bit to reflect comparing to the common ancestor commit of the base branch, NOT the default branch. In order to do this, we will need to be grabbing the base branch from the git info and saving that as well as default branch info per commit. These tickets are on hold until this is thought out a bit further and the corresponding tickets are modified** EDIT: we are only comparing to the last scan of the default branch. We are trying to answer the question "how does my commit affect the current accessibility of the default branch?" so comparing to the last commit is the correct way to answer thing. No need to find a common ancenstor

Tasks

  1. QA: hold for epic TYPE: task blocked jazzband

Update endpoint used by github action

BLOCKED: See epic for changes needed

Need to update the endpoint used by the github action to get the a11y threshold overage to use https://github.com/dequelabs/walnut/issues/7236. In addition, the github action should be updated to show those new fields:

In the PR comment:

  1. Add in axe DevHub found X accessibility violations over your a11y threshold. where X is the number returned by the new endpoint <-- verify if this was done and just not yet released
  2. Update the link to point to the URL returned by the new endpoint
    image

In the Action display:
3. Update the number of violations over a11y threshold with the number returned from the new endpoint (line 33 in example screenshot below)
4. Update URL with URL returned by the new endpoint (like 34 in the example screenshot below)
image

Update text shown to user if a11y threshold is enabled

If the configurable a11y threshold is enabled, then a run could show Found 5 accessibility violations but still pass because none of those met the a11y threshold rules. This could be very confusing to the user. We need to communicate more information so the output matches the expectation of being blocked or not.

When printing to user, instead of a single line it does today (Found X accessibility violations) it should print the following:

if a11y threshold is enabled:

Found X total accessibility violations
Found Y accessibility violations over your a11y threshold

if a11y threshold is NOT enabled:

Found X accessibility violations

Update how repo downloads Chromedriver

Epic https://github.com/dequelabs/axe-api-team/issues/497

Proposal: https://github.com/dequelabs/axe-api-team/blob/ac01e14fc119965e2ccb4bd834a5554cedb275dd/proposals/technical-requirements/chrome-driver-download-steps-in-central-place.md

Upgrade version of browser-driver-manager in each repository CI configuration

browser-driver-manager should upgrade its version so that the repos can use the new chrome driver installation method.

Update repos that downloads chromedriver

Each repo that downloads chromedriver will need to do it using browser-driver-manager

Please reference Usage guide

Usage

When using this chromedriver path in the tests, you can use the following code to get the path of the chromedriver:

Getting the path of chromedriver

To be able to get the path of where chromedriver exist in non-node libraries each library can read the .env file created by browser-driver-manager and get the path from there.

NPM based packages

const { config } = require('dotenv')
const os = require('os')
const path = require('path')

const HOME_DIR = os.homedir()
const BDM_CACHE_DIR = path.resolve(HOME_DIR, '.browser-driver-manager')

config({ path: path.resolve(BDM_CACHE_DIR, '.env') })

const { CHROMEDRIVER_TEST_PATH, CHROME_TEST_PATH } = process.env

Non-NPM based packages (Psuedo code)

from os import path
from dotenv import dotenv_values

env = dotenv_values(path.join(path.expanduser('~'), '.browser-driver-manager', '.env'))
chromedriver_path = env['CHROMEDRIVER_TEST_PATH']
chrome_path = env['CHROME_TEST_PATH']
require 'dotenv'

Dotenv.load(File.join(Dir.home, '.browser-driver-manager', '.env'))
chromedriver_path = ENV['CHROMEDRIVER_TEST_PATH']
chrome_path = ENV['CHROME_TEST_PATH']
import java.util.Map;
import java.util.HashMap;
import java.io.File;
import java.io.FileReader;
import java.io.BufferedReader;
import java.io.IOException;

public class GetChromePath {
  public static void main(String[] args) {
    Map<String, String> env = new HashMap<String, String>();
    try {
      BufferedReader reader = new BufferedReader(new FileReader(new File(System.getProperty("user.home") + "/.browser-driver-manager/.env")));
      String line;
      while ((line = reader.readLine()) != null) {
        String[] parts = line.split("=");
        env.put(parts[0], parts[1]);
      }
      reader.close();
    } catch (IOException e) {
      e.printStackTrace();
    }
    String chromedriverPath = env.get("CHROMEDRIVER_TEST_PATH");
    String chromePath = env.get("CHROME_TEST_PATH");
  }
}
using System;
using System.IO;
using System.Collections.Generic;

class GetChromePath
{
  static void Main()
  {
    Dictionary<string, string> env = new Dictionary<string, string>();
    using (StreamReader reader = new StreamReader(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".browser-driver-manager", ".env")))
    {
      string line;
      while ((line = reader.ReadLine()) != null)
      {
        string[] parts = line.Split("=");
        env.Add(parts[0], parts[1]);
      }
    }
    string chromedriverPath = env["CHROMEDRIVER_TEST_PATH"];
    string chromePath = env["CHROME_TEST_PATH"];
  }
}

BUG: Even after updating the server URL it is still pointed to Prod

Steps to reproduce:

  1. Clone the repo https://github.com/dequelabs/axe-watcher-action-demo
  2. Update the server url in workflows/tests.yml file (Change lines 25 and 37 to point to dev)
  3. Now run the test and push to origin

Expected: In results, server URL should be pointed to updated env
Actual: It is still pointed to Prod

Screenshots:

workflows/tests.yml file
image

image

Environment:

Label Value
Server URL https://axe.dequelabs.com/
Server version 4.74.0
@axe-core/watcher version 1.6.0-next.b02d5b2a

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.