-
Notifications
You must be signed in to change notification settings - Fork 102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test(selenium): fix tests for handling lazy iframe #457
Conversation
…en-html into test/fix/unloaded
4ac3780
to
0a7b31f
Compare
@@ -37,19 +37,19 @@ | |||
import org.junit.BeforeClass; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
most of this was prettier
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was likely the precommit hook that was have https://github.com/dequelabs/axe-core-maven-html/blob/develop/scripts/pre-commit-hook.sh#L6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor thing - we can remove the new test-dep we already have all the info we need:
@@ -37,19 +37,19 @@ | |||
import org.junit.BeforeClass; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was likely the precommit hook that was have https://github.com/dequelabs/axe-core-maven-html/blob/develop/scripts/pre-commit-hook.sh#L6
selenium/src/test/java/com/deque/html/axecore/selenium/Axe43xIntegrationTest.java
Outdated
Show resolved
Hide resolved
AxeBuilder axeBuilder = new AxeBuilder() | ||
.withOnlyRules(Arrays.asList("label", "frame-tested")); | ||
Results axeResults = axeBuilder.analyze(webDriver); | ||
|
||
assertNotEquals(title, "Error"); | ||
assertEquals(axeResults.getIncomplete().size(), 1); | ||
assertEquals(axeResults.getIncomplete().get(0).getId(), "frame-tested"); | ||
assertEquals(axeResults.getIncomplete().get(0).getNodes().size(), 1); | ||
assertTargetEquals( | ||
String[] expected = new String[] { "#ifr-lazy", "#lazy-iframe" }; | ||
|
||
if (!axeResults.getIncomplete().isEmpty()) { | ||
assertEquals(axeResults.getIncomplete().size(), 1); | ||
assertEquals(axeResults.getIncomplete().get(0).getId(), "frame-tested"); | ||
assertEquals(axeResults.getIncomplete().get(0).getNodes().size(), 1); | ||
assertTargetEquals( | ||
axeResults.getIncomplete().get(0).getNodes().get(0).getTarget(), | ||
new String[] {"#ifr-lazy", "#lazy-iframe"}); | ||
assertEquals(axeResults.getViolations().size(), 2); | ||
assertEquals(axeResults.getViolations().get(1).getId(), "label"); | ||
assertEquals(axeResults.getViolations().get(1).getNodes().size(), 1); | ||
expected | ||
); | ||
} else { | ||
assertEquals(axeResults.getIncomplete().size(), 0); | ||
assertTargetEquals( | ||
axeResults.getPasses().get(0).getNodes().get(1).getTarget(), | ||
expected | ||
); | ||
} | ||
assertNotEquals(title, "Error"); | ||
assertEquals(axeResults.getViolations().size(), 1); | ||
assertEquals(axeResults.getViolations().get(0).getId(), "label"); | ||
assertEquals(axeResults.getViolations().get(0).getNodes().size(), 1); | ||
assertTargetEquals( | ||
axeResults.getViolations().get(1).getNodes().get(0).getTarget(), | ||
new String[] {"#ifr-lazy", "#lazy-baz", "input"}); | ||
axeResults.getViolations().get(0).getNodes().get(0).getTarget(), | ||
new String[] { "#ifr-lazy", "#lazy-baz", "input" } | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changes are here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
chrome v124 made it so we were able to test in unloaded iframes. This changes the test to handle lazy loaded iframes in chrome v124+
qa notes: test to make sure chrome v124+ test lazy loaded iframes while chrome <124 has it in incomplete