Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Ensure dialog buttons can be pressed.

  • Loading branch information...
commit d5ae8be1e7acb0ab09bdca164653592c29759eed 1 parent 8f63e0a
@jfirebaugh authored
View
2  README.rdoc
@@ -33,7 +33,7 @@ Then add the following lines to your selectors.rb:
when /the "([^"]+)" accordion section/
[:xpath, Bermuda::XPath.accordion_content($1)]
when /the "([^"]+)" dialog/
- [:xpath, Bermuda::XPath.dialog_content($1)]
+ [:xpath, Bermuda::XPath.dialog($1)]
when /the "([^"]+)" tab/
[:xpath, Bermuda::XPath.tab_content($1)]
View
4 features/step_definitions.feature
@@ -42,6 +42,10 @@ Feature: Step definitions
When I close the "Basic dialog" dialog
Then I should not see the "Basic dialog" dialog
+ When I visit the dialog page
+ And I press "Ok" within the "Basic dialog" dialog
+ Then I should not see the "Basic dialog" dialog
+
Scenario: Progressbar steps
When I visit the progressbar page
Then the progress bar should be at 37%
View
4 features/step_definitions/web_steps.rb
@@ -25,6 +25,10 @@ def with_scope(locator)
page.should have_content(text)
end
+When /^I press "([^"]*)"$/ do |button|
+ click_button(button)
+end
+
When /^(?:|I )fill in "([^"]*)" with "([^"]*)"$/ do |field, value|
fill_in(field, :with => value)
end
View
9 features/support/public/dialog.html
@@ -6,7 +6,14 @@
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.5/jquery-ui.min.js"></script>
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.5/themes/base/jquery-ui.css">
<script>
- $(function() { $( "#dialog" ).dialog(); });
+ $(function() {
+ $( "#dialog" ).dialog({
+ buttons: [{
+ text: "Ok",
+ click: function() { $(this).dialog("close"); }
+ }]
+ });
+ });
</script>
</head>
<body>
View
2  features/support/selectors.rb
@@ -11,7 +11,7 @@ def selector_for(locator)
when /the "([^"]+)" accordion section/
[:xpath, Bermuda::XPath.accordion_content($1)]
when /the "([^"]+)" dialog/
- [:xpath, Bermuda::XPath.dialog_content($1)]
+ [:xpath, Bermuda::XPath.dialog($1)]
when /the "([^"]+)" tab/
[:xpath, Bermuda::XPath.tab_content($1)]
View
4 lib/bermuda/xpath.rb
@@ -50,10 +50,6 @@ def dialog(title = nil)
xpath
end
- def dialog_content(title = nil)
- dialog(title).descendant[attr(:class).includes('ui-dialog-content')]
- end
-
def progressbar(options = {})
xpath = descendant[attr(:class).includes('ui-progressbar')]
xpath = xpath[attr(:'aria-valuenow') == options[:value]] if options[:value]
Please sign in to comment.
Something went wrong with that request. Please try again.