Selenium now adds an attribute to each iframe called cd_frame_id which is some unique UUID. This is the first difference, as for runPartial we do not rely on Selenium to collect all of the frames thus no cd_frame_id attribute being added onto each iframe. This causes the equality check between results to fail. An HTML snippet captured by axe:
Doing only one navigation in the WebDriverJS test causes some of the remanence of the legacy run notably the cd_frame_id attribute and causes the aria-hidden-rule to only capture the body. Removing the additional navigation in the Java test causes the test to pass. On the other hand, adding the additional navigation in the Typescript test causes the test to fail.
Follow up that needs to happen:
Identify if having the separate navigations between runs is the correct way for this test to be constructed. If we conclude that it is, we need to follow up on why axe-core is only capturing the body element for legacy and everything inside body for normal run. Second, how we can do true equality checks when selenium adds cd_frame_id onto each iframe this fundamentally breaks our test
Amend the test accordingly from the outcomes of 1
(see below comments for full axe-results generated from each run)
runLegacy()
andrunPartial
/finishRun
do not produce the same results causing our test to fail as we assert that the axe-results generated are equal. Test in question: https://github.com/dequelabs/axe-core-maven-html/blob/3d13cc7662e7428c7217ba687e696a0622c9ac62/selenium/src/test/java/com/deque/html/axecore/selenium/Axe43xIntegrationTest.java#L257-L276There are few things happening here:
When legacy mode is enabled, selenium handles collecting all of the iframes for axe to inject: https://github.com/dequelabs/axe-core-maven-html/blob/3d13cc7662e7428c7217ba687e696a0622c9ac62/selenium/src/main/java/com/deque/html/axecore/extensions/WebDriverInjectorExtensions.java#L135-L171
Selenium now adds an attribute to each iframe called
cd_frame_id
which is some unique UUID. This is the first difference, as forrunPartial
we do not rely on Selenium to collect all of the frames thus nocd_frame_id
attribute being added onto each iframe. This causes the equality check between results to fail. An HTML snippet captured by axe:Moreover,
aria-hidden-body
rule appears to only capture thebody
element during a legacy run but everything including thebody
during a normal run:Legacy
```json { "id": "aria-hidden-body", "description": "Ensure aria-hidden=\"true\" is not present on the document body.", "help": "aria-hidden=\"true\" must not be present on the document body", "helpUrl": "https://dequeuniversity.com/rules/axe/4.10/aria-hidden-body?application=axeAPI", "impact": "", "tags": [ "cat.aria", "wcag2a", "wcag131", "wcag412", "EN-301-549", "EN-9.1.3.1", "EN-9.4.1.2" ], "nodes": [ { "html": "", "target": [ "body" ], "impact": null, "any": [ { "id": "aria-hidden-body", "impact": "critical", "message": "No aria-hidden attribute is present on document body", "data": null, "relatedNodes": [] } ], "all": [], "none": [], "failureSummary": null } ], "url": null, "createdDate": null } ```Normal
```json { "id": "aria-hidden-body", "description": "Ensure aria-hidden=\"true\" is not present on the document body.", "help": "aria-hidden=\"true\" must not be present on the document body", "helpUrl": "https://dequeuniversity.com/rules/axe/4.10/aria-hidden-body?application=axeAPI", "impact": "", "tags": [ "cat.aria", "wcag2a", "wcag131", "wcag412", "EN-301-549", "EN-9.1.3.1", "EN-9.4.1.2" ], "nodes": [ { "html": "\nThis page has nested frames!
\n \n \n \n \n", "target": [ "body" ], "impact": null, "any": [ { "id": "aria-hidden-body", "impact": "critical", "message": "No aria-hidden attribute is present on document body", "data": null, "relatedNodes": [] } ], "all": [], "none": [], "failureSummary": null } ], "url": null, "createdDate": null } ```This does not happen with our @axe-core/webdriverjs test. The difference between the Java and TypeScript test is the Java test navigates to the page again before running a normal run: https://github.com/dequelabs/axe-core-maven-html/blob/3d13cc7662e7428c7217ba687e696a0622c9ac62/selenium/src/test/java/com/deque/html/axecore/selenium/Axe43xIntegrationTest.java#L267
Doing only one navigation in the WebDriverJS test causes some of the remanence of the legacy run notably the
cd_frame_id
attribute and causes thearia-hidden-rule
to only capture the body. Removing the additional navigation in the Java test causes the test to pass. On the other hand, adding the additional navigation in the Typescript test causes the test to fail.Follow up that needs to happen:
body
element for legacy and everything insidebody
for normal run. Second, how we can do true equality checks when selenium addscd_frame_id
onto each iframe this fundamentally breaks our test(see below comments for full axe-results generated from each run)