def scope_within(locator)
      if locator
        # Use the selector_for method if it's defined. This may be provided
        # by features/support/selectors.rb, generated by cucumber-rails.
        if defined? selector_for
          kelp_within(*selector_for(locator)) { yield }
        # Otherwise, fall back on the Capybara locator syntax (CSS or XPath)
        else
          if locator =~ /\.?\//
            kelp_within(:xpath, locator) { yield }
          else
            kelp_within(:css, locator) { yield }
          end
        end
      else
        yield
      end
    end
def scope_within(locator)
      if locator
        # Use the selector_for method if it's defined. This may be provided
        # by features/support/selectors.rb, generated by cucumber-rails.
        if defined? selector_for
          kelp_within(*selector_for(locator)) { yield }
        # Otherwise, fall back on the Capybara locator syntax (CSS or XPath)
        else
          if locator =~ /\.?\//
            kelp_within(:xpath, locator) { yield }
          else
            kelp_within(:css, locator) { yield }
          end
        end
      else
        yield
      end
    end
Execute a block of code within a given scope. If `locator` begins with
 `/` or `./`, then it's assumed to be an XPath selector; otherwise, it's
 assumed to be a CSS selector.