1 Matching Annotations
  1. Nov 2019
    1. I often wish for this. I don't understand why this hasn't been added.

      Ugly workaround for now:

      # Note, even though we don't need or use arguments passed to this selector, you *must* pass in an
      # argument to prevent it from matching the :id selector and giving a "Unable to find id :parent (Capybara::ElementNotFound)" error.
      # Example: el.first(:parent, 1)
      # You may also need match: first if el matches multiple elements to avoid Capybara::Ambiguous
      Capybara.add_selector(:parent) do
        xpath { ".//.." }
      end