Last active
December 28, 2015 23:19
-
-
Save ndrluis/7578001 to your computer and use it in GitHub Desktop.
Rukuli Spec 1
This file contains hidden or 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
| IMAGE_VIEWER: | |
| darwin: | |
| 'Preview' | |
| cygwin|mswin|mingw|bccwin|wince|emx: | |
| "Paint" | |
| FILE_EXPLORER: | |
| darwin: | |
| 'Finder' | |
| cygwin|mswin|mingw|bccwin|wince|emx: | |
| "Explorer" | |
| TEXT_EDIT: | |
| darwin|mac os: | |
| 'TextEdit' | |
| cygwin|mswin|mingw|bccwin|wince|emx: | |
| "Note Pad" |
This file contains hidden or 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
| require 'java' | |
| require 'yaml' | |
| require 'rspec' | |
| require 'rukuli' | |
| APPLICATIONS = YAML.load(File.open("#{Dir.pwd}/spec/support/applications.yml")) | |
| Rukuli::Config.logging = false | |
| def application(app) | |
| APPLICATIONS[app].select { |k, _| k =~ /#{RbConfig::CONFIG['host_os']}/ }.shift[1] | |
| end | |
| def setup_test_area | |
| Rukuli::Config.image_path = "#{Dir.pwd}/spec/support/images/" | |
| screen = Rukuli::Screen.new | |
| app = Rukuli::App.new(application "IMAGE_VIEWER") | |
| app.focus() | |
| center = screen.find("#{Dir.pwd}/spec/support/images/smiley_face.png") | |
| test_area = Rukuli::Region.new(center.x - 212, center.y - 212, 503, 503) | |
| test_area.highlight | |
| test_area | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment