README.md in nakal-0.0.7 vs README.md in nakal-0.1.0

- old
+ new

@@ -38,31 +38,32 @@ Now, execute your test by passing env variable NAKAL_MODE=build to build the baseline images. All baseline images will be stored in baseline_images folder in current directory once baseline is built, next execution onwards, start using environment variable NAKAL_MODE=compare to compare against baseline. any difference will be put in the same directory with image file named "current_screen_name_diff.png" -## Important +If You want to organize baseline nicely, you can even specify sub-paths in #nakal_execute like this: -* This works best when your tests are running against mocked data -* If test data keeps changing for each test, use diff_metric (output of nakal_execute method above) to determine if the change is acceptable. + diff_metric = nakal_execute("feature/sub_feature/current_screen_name") For setting custom directory, use: Nakal.directory= "<desired_directory>" Nakal.device_name = "nexus7" -For cropping the notification bar OR scroll bar, create a config/nakal.yml file in execution directory +For cropping the notification bar OR scroll bar, create a config/nakal.yml file in execution directory. eg: put these contents in your nakal.yml file inside config/nakal.yml samsung_galaxy_s3: top: 50 right: 18 left: 0 bottom: 0 + screen_name_to_be_masked: {mask_region: [66,424,340,478]} + feature/sub_feature/current_screen_name: {mask_region_1: [66,424,340,478],mask_region_2: [76,524,440,578]} nexus7: top: 74 right: 20 left: 0 @@ -70,13 +71,28 @@ iPhone_5s: top: 30 right: 6 left: 0 - bottom: 0 + bottom: 0 + screen_name_to_be_masked: {mask_region: [66,424,340,478]} + feature/sub_feature/current_screen_name: {mask_region_1: [66,424,340,478],mask_region_2: [76,524,440,578]} -## ToDo -1. Put a logic to wait for screen to load until it is matching the baseline. Timeout after certain time and fail. +## Note +1. There is implicit wait of 30 sec until current screen matches baseline. This timeout can be changed by setting: + + Nakal.timeout = new_timeout_value + + +2. you can specify the areas of a screen you want to mask/ignore while comparing in nakal.yml as below: + + samsung_galaxy_s3: + top: 50 + right: 18 + left: 0 + bottom: 0 + screen_name_to_be_masked: {mask_region_1: [66,424,340,478],mask_region_2: [76,524,440,578]} + ## Contributing 1. Fork it ( http://github.com/<my-github-username>/nakal/fork ) 2. Create your feature branch (`git checkout -b my-new-feature`)