Skip to content

Demo for Image Contrast

leonar edited this page Apr 18, 2013 · 5 revisions

This demo is to intriduce how to use image contrast for checking ui style.

Steps

Create demo such as:

package com.netease.demo;

import com.netease.checkuistyle.ImageProcessing;
import com.netease.dagger.BrowserEmulator;

public class CheckPageStyle {
    public static void main(String[] args) throws Exception {
        String githubUrl = "https://github.com/";
        String checkPoint = "topbar";
        String folderName = "github";	
        BrowserEmulator be = new BrowserEmulator();
        be.open(githubUrl);//change url to https://github.com/login for contrast, remember change ScreenShotType to 2 in type.properties
        ImageProcessing.process(be.getBrowserCore(), folderName, checkPoint, "//div[@class='container clearfix']");
        be.quit();
    }
}

That's all. And you can easily understand the story:

  1. Start Chrome
  2. Open Google
  3. Search 'github'
  4. Check result
  5. Quit Chrome

Clone this wiki locally