Permalink
Browse files

Implement progressbar step.

  • Loading branch information...
1 parent c11e92b commit 74e02078fc457df68e83ba307f56157fce6dabc7 @jfirebaugh committed Oct 18, 2010
Showing with 27 additions and 1 deletion.
  1. +5 −0 features/step_definitions.feature
  2. +1 −1 lib/bermuda/cucumber.rb
  3. +6 −0 lib/bermuda/xpath.rb
  4. +15 −0 public/progressbar.html
@@ -25,6 +25,11 @@ Feature: Step definitions
When I close 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%
+ Then the progress bar should be at 37 percent
+
Scenario: Tabs steps
When I visit the tabs page
Then I should see the following tabs:
@@ -46,7 +46,7 @@
# Progress bar
Then /^the progress bar should be at (\d+)(?: percent|%)$/ do |value|
- pending
+ page.should have_xpath(Bermuda::XPath.progressbar(:value => value))
end
# Slider
@@ -47,6 +47,12 @@ 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]
+ xpath
+ end
+
def tab_header(title = nil, options = {})
xpath = descendant[attr(:class).includes('ui-tabs-nav')].child
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>Progress Bar</title>
+ <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js"></script>
+ <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() { $( "#progressbar" ).progressbar({value: 37}); });
+ </script>
+</head>
+<body>
+<div id="progressbar"></div>
+</body>
+</html>

0 comments on commit 74e0207

Please sign in to comment.