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

Need scrolling API for visualTest #5

Open
vrozaev opened this issue Feb 18, 2017 · 2 comments
Open

Need scrolling API for visualTest #5

vrozaev opened this issue Feb 18, 2017 · 2 comments

Comments

@vrozaev
Copy link
Contributor

vrozaev commented Feb 18, 2017

Problem:
Right now visualTest didn't provide any API for page scroll. The only thing which you can do is open the page and take screenshot right after that.

visualTest({
    url: basicPageUrl,
    width: 640,
    height: 480,
    missingBaseline: 'snapshot'
}),

In other tests I can write this:

registerSuite({
	name: 'longPage',

	'footer': function () {
		return this.remote
			.get(longPageUrl)
			.setWindowSize(height, width)

			.touchScroll(null, null, offset)
			.takeScreenshot()
			.then(assertVisuals(this, {
				missingBaseline: 'snapshot'
			}));
         }
});

But the "touchScroll" didn't guarantee you that you scroll to the right position.
And seems that it's didn't wait for scroll complete.

Questions:

  1. How I should scroll page when I write test manually, without "visualTest"?
  2. Is it possible to provide API for making screenshot of specified part of the page?
@devpaul
Copy link
Contributor

devpaul commented Apr 4, 2017

How I should scroll page when I write test manually, without "visualTest"?

Scrolling doesn't have a consistent implementation across browsers. Even within Chrome, they have changed how the scroll coordinates are calculated (especially on mobile). I would use something like moveMouseTo if possible.

Is it possible to provide API for making screenshot of specified part of the page?

I'd like to see an API for making a screenshot of a specified part of the page. When we initially released this feature we wanted to keep it simple, but we had talked about the ability to screenshot a component by querySelector in the configuration-based visual test. What were you thinking regarding feature-set and what would the configuration look like?

@wuservices
Copy link

@devpaul being able to screenshot by selector seems like a great idea and a good way to isolate specific components on a page without having to make a ton of unique test pages in order to isolate testing for one specific component

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

No branches or pull requests

3 participants