Skip to content
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

fix: skip unloaded iframes #330

Merged
merged 7 commits into from
Oct 5, 2023
Merged

fix: skip unloaded iframes #330

merged 7 commits into from
Oct 5, 2023

Conversation

AdnoC
Copy link
Contributor

@AdnoC AdnoC commented Jul 6, 2023

Issue: #323

@AdnoC AdnoC force-pushed the fix-unloaded-iframe branch from fb3fff1 to 3105bc4 Compare July 12, 2023 15:05
@AdnoC AdnoC marked this pull request as ready for review July 12, 2023 15:06
@AdnoC AdnoC requested a review from a team as a code owner July 12, 2023 15:06
@AdnoC AdnoC force-pushed the fix-unloaded-iframe branch from 7f6cd95 to aba88c3 Compare August 8, 2023 15:42
@@ -18,9 +18,8 @@
},
"node_modules/ansi-styles": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
Copy link
Contributor

@straker straker Aug 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was this file changed so much? I don't think package-lock should be removing the resolved and integrity values?

webDriver.manage().timeouts().scriptTimeout(Duration.ofSeconds(timeout));
Duration pageTimeout = webDriver.manage().timeouts().getPageLoadTimeout();
try {
webDriver.manage().timeouts().pageLoadTimeout(FRAME_LOAD_TIMEOUT);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we only need to set the page load timeout if we're using analyzePost43x. Im not sure we want to change the legacy version to use a shorter page load timeout since it was only causing problems when trying to switchTo the iframe

try {
Object frameContext = AxeReporter.serialize(fc.getFrameContext());
Object frameSelector = AxeReporter.serialize(fc.getFrameSelector());
frameStack.push(frameSelector);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should only push to the frameStack when we've successfully switchTo the frame. Then you don't have to pop it later

Copy link
Contributor

@straker straker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also missing the test that verifies we reset page load timeout to user setting

AdnoC and others added 5 commits September 26, 2023 16:13
Co-authored-by: Stephen Mathieson <571265+stephenmathieson@users.noreply.github.com>
@AdnoC AdnoC force-pushed the fix-unloaded-iframe branch from aba88c3 to b658a5d Compare September 26, 2023 21:43
@AdnoC AdnoC dismissed straker’s stale review September 27, 2023 05:28

Made page load changes. Added test. Reverted package-lock change

ArrayList<String> morePartialResults =
runPartialRecursive(webDriver, options, frameContext, false);
partialResults.addAll(morePartialResults);
frameStack.pop();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't need this anymore, and in fact this would probably cause an issue since you're popping the parent frame before all children frame have been processed:

For example, if you had this as the frame stack ['ancestor', 'parent'] and are currently under parent frame. If parent frame had 2 subframes and the first one is unloaded, you would switch to the parent frame in the catch statement but then pop parent off the frame stack and would have a bad frame stack when trying to switch to the 2nd child.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The catch statement ends with a continue. The pop only occurs if we get to the end of the loop without exceptions

@AdnoC AdnoC dismissed straker’s stale review September 29, 2023 19:34

simplified page load

@AdnoC AdnoC merged commit 66ff5bd into develop Oct 5, 2023
6 checks passed
@AdnoC AdnoC deleted the fix-unloaded-iframe branch October 5, 2023 12:48
@github-actions github-actions bot mentioned this pull request Jan 9, 2024
michael-siek pushed a commit that referenced this pull request Feb 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants