dequelabs / axe-devhub-action Goto Github PK
View Code? Open in Web Editor NEWLicense: Mozilla Public License 2.0
License: Mozilla Public License 2.0
Each github action within this repo needs to be checked to ensure it follows the timeout policy as described here: https://github.com/dequelabs/axe-api-team/blob/main/policies/github-actions.md#timeouts
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
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:
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 releasedIn 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)
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
Set up Dependabot to automatically update dependancies following the examples provided in https://github.com/dequelabs/axe-api-team/pull/400
Epic https://github.com/dequelabs/axe-api-team/issues/497
browser-driver-manager
in each repository CI configurationbrowser-driver-manager
should upgrade its version so that the repos can use the new chrome driver installation method.
chromedriver
Each repo that downloads chromedriver
will need to do it using browser-driver-manager
Please reference Usage guide
When using this chromedriver path in the tests, you can use the following code to get the path of the 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.
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
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"];
}
}
workflows/tests.yml
file (Change lines 25 and 37 to point to dev)Expected: In results, server URL should be pointed to updated env
Actual: It is still pointed to Prod
Label | Value |
---|---|
Server URL | https://axe.dequelabs.com/ |
Server version | 4.74.0 |
@axe-core/watcher version | 1.6.0-next.b02d5b2a |
Set up https://github.com/dequelabs/axe-api-team-public/blob/main/.github/actions/semantic-pr-footer-v1 so it will block a PR that does not have at least one of the following:
Rename to axe-devhub-action and publish so we have an @v1
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.