Skip to content

Commit

Permalink
Merge branch 'master' into epic2
Browse files Browse the repository at this point in the history
  • Loading branch information
ErickRenteria authored Sep 10, 2024
2 parents f3617ba + 64121fb commit b18c163
Show file tree
Hide file tree
Showing 348 changed files with 106,916 additions and 682 deletions.
44 changes: 43 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -222,4 +222,46 @@ jobs:
BLUEMIX_USERID: apikey
BLUEMIX_PASS: ${{ secrets.BLUEMIX_PASS }}
CLOUD_PWD: ${{ secrets.CLOUD_PWD }}
TRAVIS_BRANCH: prod
TRAVIS_BRANCH: prod

java-accessibility-checker-deploy:
runs-on: ubuntu-22.04
permissions:
packages: write
strategy:
matrix:
node-version: [18.x]

steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v4
with:
distribution: 'semeru' # See 'Supported distributions' for available options
java-version: '17'
server-id: central
server-username: ${{ secrets.MVN_GITHUB_USER }}
server-password: ${{ secrets.MVN_GITHUB_TOKEN }}
- uses: s4u/[email protected]
with:
servers: |
[{
"id": "central",
"username": "${{ secrets.MVN_GITHUB_USER }}",
"password": "${{ secrets.MVN_GITHUB_TOKEN }}"
}]
- name: Configure GPG Key
run: echo "$GPG_SIGNING_KEY" >private.key
env:
GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }}
- name: Import GPG Key
run: gpg --pinentry-mode=loopback --passphrase "$GPG_SIGNING_KEY_PASS" --import private.key
env:
GPG_SIGNING_KEY_PASS: ${{ secrets.GPG_SIGNING_KEY_PASS }}
- name: Set version
run: sed -i'.old' -e 's/\<version\>3\.0\.0\<\/version\>/\<version\>'"${GITHUB_REF:10}"'\<\/version\>/g' ./pom.xml
working-directory: java-accessibility-checker
- name: Publish package
run: mvn --batch-mode deploy -DskipTests -Dgpg.passphrase=$GPG_SIGNING_KEY_PASS
working-directory: java-accessibility-checker
env:
GPG_SIGNING_KEY_PASS: ${{ secrets.GPG_SIGNING_KEY_PASS }}
71 changes: 71 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,77 @@ jobs:
- run: npm run wdio
working-directory: accessibility-checker/test/webdriverio

###############################################################################
# Java test
####
java-accessibility-checker-selenium-test:
runs-on: ubuntu-22.04

strategy:
matrix:
node-version: [18.x]

steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v4
with:
distribution: 'semeru' # See 'Supported distributions' for available options
java-version: '17'
- name: Latest Chrome
uses: browser-actions/setup-chrome@v1
with:
chrome-version: latest
install-chromedriver: true
id: setup-chrome
- run: npm install
working-directory: rule-server
- run: npm run build
working-directory: rule-server
- run: node main.js &
working-directory: rule-server/dist
- run: sleep 10
working-directory: rule-server/dist
- name: Test package
run: mvn --batch-mode test -Dtest="AccessibilityCheckerSeleniumTest"
working-directory: java-accessibility-checker
env:
chromedriverpath: ${{ steps.setup-chrome.outputs.chromedriver-path }}
chromebinpath: ${{ steps.setup-chrome.outputs.chrome-path }}

java-accessibility-checker-playwright-test:
runs-on: ubuntu-22.04

strategy:
matrix:
node-version: [18.x]

steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v4
with:
distribution: 'semeru' # See 'Supported distributions' for available options
java-version: '17'
- name: Latest Chrome
uses: browser-actions/setup-chrome@v1
with:
chrome-version: latest
install-chromedriver: true
id: setup-chrome
- run: npm install
working-directory: rule-server
- run: npm run build
working-directory: rule-server
- run: node main.js &
working-directory: rule-server/dist
- run: sleep 10
working-directory: rule-server/dist
- name: Test package
run: mvn --batch-mode test -Dtest="AccessibilityCheckerPlaywrightTest"
working-directory: java-accessibility-checker
env:
chromedriverpath: ${{ steps.setup-chrome.outputs.chromedriver-path }}
chromebinpath: ${{ steps.setup-chrome.outputs.chrome-path }}

###############################################################################
# Karma Tests
####
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ <h1 id="weather">Weather portlet</h1>
* [IBM 2.4.1 Bypass Blocks](https://www.ibm.com/able/requirements/requirements/#2_4_1)
* [ARIA6: aria-label to label objects](https://www.w3.org/WAI/WCAG22/Techniques/aria/ARIA6)
* [ARIA13: aria-labelledby to name regions and landmarks](https://www.w3.org/WAI/WCAG22/Techniques/aria/ARIA13)
* [ARIA specification - Application Role](https://www.w3.org/TR/wai-aria-1.2/#application)

### Who does this affect?

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ <h1 id="weather">Weather portlet</h1>

* [IBM 2.4.1 Bypass Blocks](https://www.ibm.com/able/requirements/requirements/#2_4_1)
* [ARIA practices - Accessible Names and Descriptions](https://www.w3.org/WAI/ARIA/apg/practices/names-and-descriptions/)
* [ARIA specification - Application Role](https://www.w3.org/TR/wai-aria-1.2/#application)

### Who does this affect?

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ <h1 id="t1">Stock Ticker Portlet</h1">
* [IBM 2.4.1 Bypass Blocks](https://www.ibm.com/able/requirements/requirements/#2_4_1)
* [ARIA6: aria-label to label objects](https://www.w3.org/WAI/WCAG22/Techniques/aria/ARIA6)
* [ARIA13: aria-labelledby to name regions and landmarks](https://www.w3.org/WAI/WCAG22/Techniques/aria/ARIA13)
* [ARIA specification - Article Role](https://www.w3.org/TR/wai-aria-1.2/#article)

### Who does this affect?

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ <h3 id="ruleMessage"></h3>

* [IBM 4.1.2 Name, Role, Value](https://www.ibm.com/able/requirements/requirements/#4_1_2)
* [ARIA practices guide](https://www.w3.org/WAI/ARIA/apg/)
* [ARIA specification](https://www.w3.org/TR/wai-aria-1.2/)]

### Who does this affect?

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ <h1 id="weather">Weather portlet</h1>
* [IBM 2.4.1 Bypass Blocks](https://www.ibm.com/able/requirements/requirements/#2_4_1)
* [ARIA6: aria-label to label objects](https://www.w3.org/WAI/WCAG22/Techniques/aria/ARIA6)
* [ARIA13: aria-labelledby to name regions and landmarks](https://www.w3.org/WAI/WCAG22/Techniques/aria/ARIA13)
* [ARIA specification - Banner Role](https://www.w3.org/TR/wai-aria-1.2/#banner)]

### Who does this affect?

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ <h3 id="ruleMessage"></h3>
### About this requirement

* [IBM 2.4.1 Bypass Blocks](https://www.ibm.com/able/requirements/requirements/#2_4_1)
* [ARIA practices - HTML Sectioning Elements](https://www.w3.org/WAI/ARIA/apg/practices/landmark-regions/#htmlsectioningelements)
* [ARIA practices - Landmark Regions](https://www.w3.org/WAI/ARIA/apg/practices/landmark-regions/)
* [ARIA specification - Banner Role](https://www.w3.org/TR/wai-aria-1.2/#banner)]

### Who does this affect?

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ <h2 id="weather">Weather portlet</h2>
* [IBM 2.4.1 Bypass Blocks](https://www.ibm.com/able/requirements/requirements/#2_4_1)
* [ARIA6: aria-label to label objects](https://www.w3.org/WAI/WCAG22/Techniques/aria/ARIA6)
* [ARIA13: aria-labelledby to name regions and landmarks](https://www.w3.org/WAI/WCAG22/Techniques/aria/ARIA13)
* [ARIA specification - Complementary Role](https://www.w3.org/TR/wai-aria-1.2/#complementary)

### Who does this affect?

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ <h1 id="weather">Weather portlet</h1>
* [IBM 2.4.1 Bypass Blocks](https://www.ibm.com/able/requirements/requirements/#2_4_1)
* [ARIA specification - complementary role](https://www.w3.org/TR/wai-aria-1.2/#complementary)
* [ARIA practices - Landmark Regions](https://www.w3.org/WAI/ARIA/apg/practices/landmark-regions/)
* [ARIA specification - Complementary Role](https://www.w3.org/TR/wai-aria-1.2/#complementary)

### Who does this affect?

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ <h3 id="ruleMessage"></h3>
<mark-down><script type="text/plain">

### Why is this important?
When there are multiple elements with a `"contentinfo"` role, they must have unique labels that clearly describe each region's content. This includes HTML `<footer>` elements when their context is a `<body>` element. These labels help people using assistive technologies to quickly find and navigate to each region.

When there are multiple elements with a `"contentinfo"` role, they must have unique labels that clearly describe each region's content.
This includes HTML `<footer>` elements when their context is a `<body>` element.
These labels help people using assistive technologies to quickly find and navigate to each region.
<!-- This is where the code snippet is injected -->
<div id="locSnippet"></div>
Expand Down Expand Up @@ -80,6 +83,7 @@ <h3 id="ruleMessage"></h3>
* [IBM 2.4.1 Bypass Blocks](https://www.ibm.com/able/requirements/requirements/#2_4_1)
* [ARIA6: aria-label to label objects](https://www.w3.org/WAI/WCAG22/Techniques/aria/ARIA6)
* [ARIA13: aria-labelledby to name regions and landmarks](https://www.w3.org/WAI/WCAG22/Techniques/aria/ARIA13)
* [ARIA specification - Contentinfo Role](https://www.w3.org/TR/wai-aria-1.2/#contentinfo)

### Who does this affect?

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ <h3 id="ruleMessage"></h3>
* [IBM 2.4.1 Bypass Blocks](https://www.ibm.com/able/requirements/requirements/#2_4_1)
* [ARIA6: aria-label to label objects](https://www.w3.org/WAI/WCAG22/Techniques/aria/ARIA6.html)
* [ARIA13: aria-labelledby to name regions and landmarks](https://www.w3.org/WAI/WCAG22/Techniques/aria/ARIA13)
* [ARIA specification - Document Role](https://www.w3.org/TR/wai-aria-1.2/#document)]

### Who does this affect?

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ <h2 id="na1"> New Account</h2>
* [IBM 2.4.1 Bypass Blocks](https://www.ibm.com/able/requirements/requirements/#2_4_1)
* [ARIA6: aria-label to label objects](https://www.w3.org/WAI/WCAG22/Techniques/aria/ARIA6)
* [ARIA13: aria-labelledby to name regions and landmarks](https://www.w3.org/WAI/WCAG22/Techniques/aria/ARIA13)
* [ARIA specification - Form Role](https://www.w3.org/TR/wai-aria-1.2/#form)

### Who does this affect?

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ <h3 id="ruleMessage"></h3>
* [IBM 1.3.1 Info and relationships](https://www.ibm.com/able/requirements/requirements/#1_3_1)
* [ARIA11: ARIA landmarks to identify regions of a page](https://www.w3.org/WAI/WCAG22/Techniques/aria/ARIA11)
* [ARIA13: aria-labelledby to name regions and landmarks](https://www.w3.org/WAI/WCAG22/Techniques/aria/ARIA13)
* [ARIA specification - Landmark Role](https://www.w3.org/TR/wai-aria-1.2/#landmark)

### Who does this affect?

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ <h1 id="title1"> Stock Ticker portlet </h1>
### About this requirement

* [IBM 2.4.1 Bypass Blocks](https://www.ibm.com/able/requirements/requirements/#2_4_1)
* [ARIA specification - Main](https://www.w3.org/TR/wai-aria-1.2/#main)
* [ARIA specification - Main Role](https://www.w3.org/TR/wai-aria-1.2/#main)
* [ARIA practices - Landmark Regions](https://www.w3.org/WAI/ARIA/apg/practices/landmark-regions/)

### Who does this affect?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ <h1 id="stocks">Stock ticker portlet</h1>
### About this requirement

* [IBM 2.4.1 Bypass Blocks](https://www.ibm.com/able/requirements/requirements/#2_4_1)
* [ARIA specification - Main Role](https://www.w3.org/TR/wai-aria-1.2/#main)

### Who does this affect?

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ <h2 id="weather">Weather portlet</h2>
* [IBM 2.4.1 Bypass Blocks](https://www.ibm.com/able/requirements/requirements/#2_4_1)
* [ARIA6: aria-label to label objects](https://www.w3.org/WAI/WCAG22/Techniques/aria/ARIA6)
* [ARIA13: aria-labelledby to name regions and landmarks](https://www.w3.org/WAI/WCAG22/Techniques/aria/ARIA13)
* [ARIA specification - Navigation Role](https://www.w3.org/TR/wai-aria-1.2/#navigation)

### Who does this affect?

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ <h3 id="ruleMessage"></h3>
* [IBM 2.4.1 Bypass Blocks](https://www.ibm.com/able/requirements/requirements/#2_4_1)
* [ARIA6: aria-label to label objects](https://www.w3.org/WAI/WCAG22/Techniques/aria/ARIA6)
* [ARIA13: aria-labelledby to name regions and landmarks](https://www.w3.org/WAI/WCAG22/Techniques/aria/ARIA13)
* [ARIA specification - Region Role](https://www.w3.org/TR/wai-aria-1.2/#region)

### Who does this affect?

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ <h3 id="log1">Real time log</h3>

* [IBM 2.4.1 Bypass Blocks](https://www.ibm.com/able/requirements/requirements/#2_4_1)
* [ARIA practices - Landmark Regions](https://www.w3.org/WAI/ARIA/apg/practices/landmark-regions/)
* [ARIA examples - Region Landmark](https://www.w3.org/WAI/ARIA/apg/patterns/landmarks/examples/region.html)
* [ARIA specification - Region Role](https://www.w3.org/TR/wai-aria-1.2/#region)


### Who does this affect?

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ <h3 id="ruleMessage"></h3>
* [IBM 2.4.1 Bypass Blocks](https://www.ibm.com/able/requirements/requirements/#2_4_1)
* [ARIA6: aria-label to label objects](https://www.w3.org/WAI/WCAG22/Techniques/aria/ARIA6)
* [ARIA13: aria-labelledby to name regions and landmarks](https://www.w3.org/WAI/WCAG22/Techniques/aria/ARIA13)
* [ARIA specification - Search Role](https://www.w3.org/TR/wai-aria-1.2/#search)

### Who does this affect?
* People using a screen reader, including blind, low vision, and neurodivergent people
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,9 @@ <h2 id="ct">Complex tools</h2>

### About this requirement

* [IBM 4.1.2 Name, Role, Value](https://www.ibm.com/able/requirements/requirements/#4_1_2)
* [IBM 2.4.1 Bypass Blocks](https://www.ibm.com/able/requirements/requirements/#2_4_1)
* [ARIA16: aria-labelledby to name user interface controls](https://www.w3.org/WAI/WCAG22/Techniques/aria/ARIA16)
* [ARIA specification - Toolbar Role](https://www.w3.org/TR/wai-aria-1.2/#toolbar)

### Who does this affect?

Expand Down
4 changes: 3 additions & 1 deletion accessibility-checker-engine/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@
// { pattern: 'test/v2/checker/accessibility/rules/WCAG20_Table_CapSummRedundant_ruleunit/*.html', watched: true },

// { pattern: 'test/v2/checker/accessibility/rules/Rpt_Aria_RequiredParent_Native_Host_Sematics_ruleunit/ACT_ff89c9_pass4.html', watched: true },
// { pattern: 'test/v2/checker/accessibility/rules/IBMA_Color_Contrast_WCAG2AA_ruleunit/Color-hidden.html', watched: true },
//{ pattern: 'test/v2/checker/accessibility/rules/label_name_visible_ruleunit/label_offscreen.html', watched: true },
//{ pattern: 'test/v2/checker/accessibility/rules/aria_role_valid_ruleunit/td_attribute_invalid_copy.html', watched: true },
//{ pattern: 'test/v2/checker/accessibility/rules/label_name_visible_ruleunit/label_multiple_offscreen.html', watched: true },


{ pattern: 'test/**/*_ruleunit/*.html', watched: true },
Expand Down
2 changes: 1 addition & 1 deletion accessibility-checker-engine/karmaaction.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ module.exports = (config) => {
customLaunchers: {
ChromeCustom: {
base: 'ChromeHeadless',
flags: ['--disable-web-security', '--no-sandbox']
flags: ['--disable-gpu', '--disable-web-security', '--no-sandbox']
}
},
preprocessors: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -637,6 +637,7 @@ export class RPTUtil {
}

public static normalizeSpacing(s) {
if (!s) return '';
return s.trim().replace(/\s+/g, ' ');
};

Expand Down Expand Up @@ -2686,6 +2687,39 @@ export class RPTUtil {
return retVal;
}

/**
* return onscreen innerText.
* This function should return the same result as innerText if no offscreen content exists
*
* @parm {element} node The node which should be checked it has inner text or not.
* @return {null | string} null if element has empty inner text, text otherwise
*
* @memberOf RPTUtil
*/
public static getOnScreenInnerText(element) {
if (!element) return null;
if (element.nodeType === 3) return element.nodeValue();

let text = "";
let nw = new NodeWalker(element);

// Loop over all the childrens of the element to get the text
while (nw.nextNode() && nw.node !== element && nw.node !== element.parentNode) {
if ((nw.node.nodeType === 1 && (VisUtil.hiddenByDefaultElements.includes(nw.node.nodeName.toLowerCase())) || !VisUtil.isNodeVisible(nw.node) || VisUtil.isElementOffscreen(nw.node))) {
if (nw.node.nextSibling) {
if (nw.node.nextSibling.nodeType === 3 && nw.node.nextSibling.nodeValue !== null)
text += nw.node.nextSibling.nodeValue;
nw.node = nw.node.nextSibling;
continue;
} else
break;
}
if (nw.node.nodeType === 3 && nw.node.nodeValue !== null)
text += nw.node.nodeValue;
}
return text.trim();
}

/** Return the text content of the given node
* this is different than innerText or textContent that return text content of a node and its descendants
*/
Expand Down
Loading

0 comments on commit b18c163

Please sign in to comment.