Skip to content

Instantly share code, notes, and snippets.

@demetriusnunes
Created May 18, 2009 14:51
Show Gist options
  • Save demetriusnunes/113530 to your computer and use it in GitHub Desktop.
Save demetriusnunes/113530 to your computer and use it in GitHub Desktop.
Funcionalidade: Buttons locators and events
Cenario: Button clicking
Dado the frame "SwingSet" is a container
E the toolbar button "#1" is selected
E the tab "Button Demo" is a container
Quando eu clicar no botão "One"
Quando eu clicar no botão "Two"
Quando eu clicar no botão "Three!"
import org.netbeans.jemmy.operators.JButtonOperator
When t(/^I click the button "([^\"]*)"$/) do |name|
JButtonOperator.new(container, string_or_numeric_id(id)).do_click
end
require 'java'
$LOAD_PATH << File.expand_path(File.dirname(__FILE__)) + '/../../lib'
require 'yaml'
$steps_i18n = YAML.load_file(File.expand_path(File.dirname(__FILE__)) + '/step_definitions_i18n.yml')
$steps_i18n = $steps_i18n[Cucumber.lang]
def t(regex)
if $steps_i18n && match = $steps_i18n[regex.source]
Regexp.new(match)
else
regex
end
end
"pt":
'^I click the button "([^\"]*)"$': '^eu clicar no botão "([^\"]*)"$'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment