-
Notifications
You must be signed in to change notification settings - Fork 43
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: Do not complain when endY is bigger than document height #54
Open
mehdivk
wants to merge
8
commits into
zinserjan:master
Choose a base branch
from
autopilothq:set-scroll-area-bug-fix
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 7 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
f0ab497
fix: do not complain when endY is bigger than document height
mehdivk 4d06626
integration tests for partially visible element
mehdivk d83e619
reference images for partially visible element
mehdivk 7d66a65
added reference images for IE
mehdivk 4740c31
updated endY issue example
mehdivk 09d8b02
temp tweak for scrolling element instead of html
mehdivk 2f81869
configure scroll target via options, default to html
mehdivk 385e17b
change scroll target to be different from element under the test
mehdivk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
---|---|---|
|
@@ -23,8 +23,6 @@ export default class BaseStrategy { | |
throw new Error('startY is out of range'); | ||
} else if (endX > documentWidth) { | ||
throw new Error('endX is out of range'); | ||
} else if (endY > documentHeight) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we are passing options, I would disabling this error should be in the option as well. By removing this, this is breaking expected behavior (though I think most people would be okay with it) |
||
throw new Error('endY is out of range'); | ||
} | ||
|
||
this.area = { | ||
|
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 |
---|---|---|
@@ -0,0 +1,125 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>wdio-screenshot responsive with scroll</title> | ||
<link rel="stylesheet" href="css/bootstrap.min.css"> | ||
<link rel="stylesheet" href="css/main.css"> | ||
<style> | ||
html { | ||
height: 100%; | ||
} | ||
|
||
body { | ||
overflow: hidden; | ||
min-height: 100%; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<div class="endY-absolute"> | ||
<div class="endY-absolute endY-scroll"> | ||
<div class="container responsive test-target"> | ||
<div class="row"> | ||
<div class="col-xs-4"> | ||
<div class="box red"></div> | ||
</div> | ||
<div class="col-xs-4"> | ||
<div class="box blue"></div> | ||
</div> | ||
<div class="col-xs-4"> | ||
<div class="box green"></div> | ||
</div> | ||
</div> | ||
<div class="row"> | ||
<div class="col-xs-4"> | ||
<div class="box pink"></div> | ||
</div> | ||
<div class="col-xs-4"> | ||
<div class="box orange"></div> | ||
</div> | ||
<div class="col-xs-4"> | ||
<div class="box white"></div> | ||
</div> | ||
</div> | ||
<div class="row"> | ||
<div class="col-xs-4"> | ||
<div class="box cyan"></div> | ||
</div> | ||
<div class="col-xs-4"> | ||
<div class="box chocolate"></div> | ||
</div> | ||
<div class="col-xs-4"> | ||
<div class="box gray"></div> | ||
</div> | ||
</div> | ||
<div class="row"> | ||
<div class="col-xs-4"> | ||
<div class="box indigo"></div> | ||
</div> | ||
<div class="col-xs-4"> | ||
<div class="box lime"></div> | ||
</div> | ||
<div class="col-xs-4"> | ||
<div class="box magenta"></div> | ||
</div> | ||
</div> | ||
<div class="row"> | ||
<div class="col-xs-4"> | ||
<div class="box maroon"></div> | ||
</div> | ||
<div class="col-xs-4"> | ||
<div class="box navy"></div> | ||
</div> | ||
<div class="col-xs-4"> | ||
<div class="box olive"></div> | ||
</div> | ||
</div> | ||
<div class="row"> | ||
<div class="col-xs-4"> | ||
<div class="box silver"></div> | ||
</div> | ||
<div class="col-xs-4"> | ||
<div class="box snow"></div> | ||
</div> | ||
<div class="col-xs-4"> | ||
<div class="box red"></div> | ||
</div> | ||
</div> | ||
<div class="row"> | ||
<div class="col-xs-4"> | ||
<div class="box tan"></div> | ||
</div> | ||
<div class="col-xs-4"> | ||
<div class="box tomato"></div> | ||
</div> | ||
<div class="col-xs-4"> | ||
<div class="box violet"></div> | ||
</div> | ||
</div> | ||
<div class="row"> | ||
<div class="col-xs-4"> | ||
<div class="box sienna"></div> | ||
</div> | ||
<div class="col-xs-4"> | ||
<div class="box purple"></div> | ||
</div> | ||
<div class="col-xs-4"> | ||
<div class="box moccasin"></div> | ||
</div> | ||
</div> | ||
<div class="row"> | ||
<div class="col-xs-4"> | ||
<div class="box khaki"></div> | ||
</div> | ||
<div class="col-xs-4"> | ||
<div class="box gold"></div> | ||
</div> | ||
<div class="col-xs-4"> | ||
<div class="box coral"></div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</body> | ||
</html> |
Binary file added
BIN
+6.37 KB
.../fixture/web/screenshots/desktop-responsive-scrolling-document-element-1600.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+2.7 KB
...xture/web/screenshots/desktop-responsive-scrolling-document-element-1600_ie.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+3.91 KB
test/fixture/web/screenshots/desktop-responsive-scrolling-document-element-480.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+2.03 KB
...ixture/web/screenshots/desktop-responsive-scrolling-document-element-480_ie.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
@zinserjan we can throw an error if selector doesn't match any element in DOM to help for debugging.
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.
IMO the query Selector should be configuration if we are adding a scroll option.
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.
Looks like the forked repo (autopilothq/wdio-screenshot) master branch has fixed this in a later commit. But those changes haven't been merged into the
autopilothq:set-scroll-area-bug-fix
branch, where this PR originated from.