-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(all): Sync with the master and update libraries (#1960)
* Update for Puppeteer 19 * Update imports for ESM * Fix object verification * Fix ACT runs * Throw out bounds differences within 2 * Update cypress package-lock * Split cypress test * Convert to absolute url for Windows * Update gulpfile * Split into cjs and mjs * Use modules for testing * Tests to mjs * Fix extension * More file extension changes * Fix require check * Fix file extension * Update file extensions * Fix testcase to work on Windows * Update meta hack for ACT test * chore(node,karma): Update selenium-webdriver (4.9.2) and add more error logs (#1414) * update package.json * update web driver version and fix related errors #1356 * replace setDefaultService function in chrome #1356 * add more exception handling #1356 * more changes on the errors #1356 * clean up the code #1356 * add more error logs #1356 * update the boilerplates selenium-driver version from 4.3.0 to 4.8.0 #1356 * Use latest Selenium --------- Co-authored-by: Tom Brunet <[email protected]> * chore(cypress): Update to latest Cypress (12.12.0) (#1451) * Update files to Cypress 12 * Use Node 18 for cypress * Update boilerplate * Put boilerplate dependency back * Update baseline * Run tests on Node 18 * Update test server packages * Update lock file * Try update ubuntu * Split server and run commands * Wrong command * Selenium refix * Wrong order * Add jest boilerplate, fix terser typeof issue (#1461) * Build failure * import problems * merge * Issues with imports * Import problems * Fix module imports * import problems * Deal with cjs vs mjs for __dirname * Fix filename * Don't support 14.x with the 4.x branch * Fix merge conflicts * update the puppeteer version * update the file * update the package.json files * update the comment * update configuration files * change from require to import * change require() to import * clean the code * update the config files * update the config * update the confi * upate files * update baselines * Create .npmrc * Update .npmrc * update conf file with node options * update the wdio test files and config * Update .npmrc * update the node options * update the code to use cjs * Update package.json * update the act conf * Create .npmrc * add node option in act test * Update package.json --------- Co-authored-by: Tom Brunet <[email protected]> Co-authored-by: ErickR <[email protected]>
- Loading branch information
1 parent
280d996
commit b2bedf8
Showing
80 changed files
with
1,412 additions
and
1,131 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,4 +8,5 @@ results | |
package-lock.json | ||
src/**/*.js | ||
src/**/*.map | ||
src/**/*.d.ts | ||
src/**/*.d.ts | ||
!src/bin/achecker.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
|
||
{ | ||
"extension": ["js", "cjs", "mjs"], | ||
"package": "./package.json", | ||
"node-option": ["experimental-specifier-resolution=node"] | ||
} |
14 changes: 7 additions & 7 deletions
14
accessibility-checker/boilerplates/cucumber-selenium/features/Demo.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
Feature: Cucumber Demo | ||
Demonstrate a basic usage of AAT | ||
|
||
Scenario: Check pages and fail when issues found | ||
Given I am at URL "http://www.altoromutual.com/" | ||
Then Page is accessible with label "DEMO1" | ||
When I click on ID "CatLink1" | ||
Then Page is accessible with label "DEMO1_Personal" | ||
# Scenario: Check pages and fail when issues found | ||
# Given I am at URL "https://altoromutual.12mc9fdq8fib.us-south.codeengine.appdomain.cloud/#" | ||
# Then Page is accessible with label "DEMO1" | ||
# When I click on ID "feedbackButton" | ||
# Then Page is accessible with label "DEMO1_Personal" | ||
|
||
Scenario: Check pages, but just record results when issues found | ||
Given I am at URL "http://www.altoromutual.com/" | ||
Given I am at URL "https://altoromutual.12mc9fdq8fib.us-south.codeengine.appdomain.cloud/#" | ||
Then Scan page for accessibility with label "DEMO2" | ||
When I click on ID "CatLink1" | ||
When I click on ID "feedbackButton" | ||
Then Scan page for accessibility with label "DEMO2_Personal" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
accessibility-checker/boilerplates/jest-puppeteer-ts/.gitignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
results |
52 changes: 52 additions & 0 deletions
52
accessibility-checker/boilerplates/jest-puppeteer-ts/achecker.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
module.exports = { | ||
// optional - Specify the rule archive | ||
// Default: latest | ||
// Run `npx aat archives` for a list of valid ruleArchive ids and policy ids | ||
ruleArchive: 'latest', | ||
|
||
// optional - Specify one or many policies to scan. | ||
// Run `npx aat archives` for a list of valid ruleArchive ids and policy ids | ||
policies: [ "IBM_Accessibility"], | ||
|
||
// optional - Specify one or many violation levels on which to fail the test | ||
// i.e. If specified violation then the testcase will only fail if | ||
// a violation is found during the scan. | ||
// i.e. failLevels: ["violation"] | ||
// i.e. failLevels: ["violation","potential violation"] or refer to below as a list | ||
// Default: ["violation","potential violation"] | ||
failLevels: [ "violation" ], | ||
|
||
// optional - Specify one or many violation levels which should be reported | ||
// i.e. If specified violation then in the report it would only contain | ||
// results which are level of violation. | ||
// i.e. reportLevels: ["violation"] | ||
// Valid values: violation, potentialviolation, recommendation, potentialrecommendation, manual | ||
// Default: ["violation","potential violation"] | ||
reportLevels: [ | ||
"violation", | ||
"potentialviolation", | ||
"recommendation", | ||
"potentialrecommendation", | ||
"manual" | ||
], | ||
|
||
// Optional - Which type should the results be outputted to | ||
// Valid values: json, csv | ||
// Default: json | ||
outputFormat: [ "json" ], | ||
|
||
// Optional - Specify labels that you would like associated to your scan | ||
// | ||
// i.e. | ||
// label: ["Firefox","master","V12","Linux"] | ||
// Default: N/A | ||
label: [], | ||
|
||
// optional - Where the scan results should be saved. | ||
// Default: results | ||
outputFolder: "results", | ||
|
||
// optional - Where the baseline results should be loaded from | ||
// Default: baselines | ||
baselineFolder: "baselines", | ||
} |
26 changes: 26 additions & 0 deletions
26
accessibility-checker/boilerplates/jest-puppeteer-ts/matchers/toBeAccessible.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/** | ||
* Copyright IBM Corp. 2019 | ||
* | ||
* This source code is licensed under the Apache-2.0 license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
'use strict'; | ||
|
||
import { assertCompliance, getCompliance, stringifyResults } from "accessibility-checker"; | ||
import { Page } from "puppeteer"; | ||
|
||
async function toBeAccessible(node: Page) { | ||
let results = await getCompliance(node, this.currentTestName.replace(/[ \\/]/g, "_")); | ||
if (assertCompliance(results.report) === 0) { | ||
return { | ||
pass: true | ||
} | ||
} else { | ||
return { | ||
pass:false, | ||
message: () => stringifyResults(results.report) | ||
} | ||
} | ||
} | ||
module.exports = toBeAccessible; |
29 changes: 29 additions & 0 deletions
29
accessibility-checker/boilerplates/jest-puppeteer-ts/package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{ | ||
"name": "@ibma/eac-jest-boilerplate", | ||
"version": "3.0.0", | ||
"description": "Example usage of IBM Equal Access Checker with Jest, Puppeteer, and Typescript", | ||
"scripts": { | ||
"test": "jest test-ts/*.test.ts" | ||
}, | ||
"engines": { | ||
"node": ">=18" | ||
}, | ||
"jest": { | ||
"preset": "ts-jest", | ||
"setupFilesAfterEnv": [ | ||
"./setupAfterEnv.ts" | ||
], | ||
"transformIgnorePatterns": [ | ||
"ace-node\\.js" | ||
] | ||
}, | ||
"devDependencies": { | ||
"@jest/globals": "^29.5.0", | ||
"@types/jest": "^29.5.1", | ||
"accessibility-checker": "*", | ||
"jest": "^29.5.0", | ||
"puppeteer": "^22.14.0", | ||
"ts-jest": "^29.1.0", | ||
"typescript": "^4.1.5" | ||
} | ||
} |
48 changes: 48 additions & 0 deletions
48
accessibility-checker/boilerplates/jest-puppeteer-ts/sample/Hello.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<!DOCTYPE html> | ||
<html ng-app="helloApp" ng-controller="helloCtrl" lang='{{locale}}'> | ||
|
||
<head> | ||
<title>Sample App</title> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/angular_material/1.1.0/angular-material.min.css"> | ||
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/angularjs/1.5.7/angular.min.js"></script> | ||
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/angularjs/1.5.7/angular-animate.min.js"></script> | ||
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/angularjs/1.5.7/angular-aria.min.js"></script> | ||
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angular_material/1.1.0/angular-material.min.js"></script> | ||
<script type="text/javascript" src="Hello.js"></script> | ||
</head> | ||
|
||
<body ng-cloak layout="column"> | ||
<md-toolbar layout="row" class="md-toolbar-tools" role="banner"> | ||
<h1>Sample App</h1> | ||
</md-toolbar> | ||
|
||
<div flex layout="row"> | ||
|
||
<md-sidenav md-is-locked-open="true" class="md-whiteframe-4dp" role="navigation"> | ||
Sidenav | ||
</md-sidenav> | ||
|
||
<md-content flex id="content" role="main"> | ||
<a id="clickMe" ng-click="showCard = !showCard">Click Me</a> | ||
<md-card ng-if="showCard"> | ||
<md-card-content> | ||
<h2>Card headline</h2> | ||
<p>Card content</p> | ||
<img src="hello.png" /> | ||
</md-card-content> | ||
<md-card-footer> | ||
Card footer | ||
</md-card-footer> | ||
</md-card> | ||
</md-content> | ||
|
||
|
||
</div> | ||
<div> | ||
|
||
</div> | ||
|
||
</body> | ||
|
||
</html> |
10 changes: 10 additions & 0 deletions
10
accessibility-checker/boilerplates/jest-puppeteer-ts/sample/Hello.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
var app = angular.module("helloApp", ["ngMaterial","ngAria"], function config($ariaProvider) { | ||
$ariaProvider.config({ | ||
bindRoleForClick: false | ||
}); | ||
}); | ||
|
||
app.controller("helloCtrl", function ($scope) { | ||
$scope.locale = "en-US"; | ||
$scope.test = 1+2; | ||
}); |
2 changes: 2 additions & 0 deletions
2
accessibility-checker/boilerplates/jest-puppeteer-ts/setupAfterEnv.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
const toBeAccessible = require('./matchers/toBeAccessible'); | ||
expect.extend({ toBeAccessible }); |
9 changes: 9 additions & 0 deletions
9
accessibility-checker/boilerplates/jest-puppeteer-ts/src/HelloWidget.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
var React = require("react"); | ||
|
||
var HelloWidget = React.createClass({ | ||
render: function () { | ||
return "<div>Hello {this.props.name}</div>"; | ||
} | ||
}); | ||
|
||
module.exports = HelloWidget; |
Oops, something went wrong.