Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bundle helpers for with Element classes? #54

Open
lashd opened this issue Jan 10, 2016 · 0 comments
Open

Bundle helpers for with Element classes? #54

lashd opened this issue Jan 10, 2016 · 0 comments

Comments

@lashd
Copy link
Contributor

lashd commented Jan 10, 2016

Would it be useful to be able to bundle helpers with Element classes?.

E.g.

module GitHub
  class SearchField < PageMagic::Element
    bundled_helpers do 
      def search term
      end
    end
  end

  class HomePage
    include PageMagic
    url 'https://github.com'
    element SearchField
  end

  github = GitHub::HomePage.visit(browser: :chrome)
  github.search('page_magic') # using bundled helper here.
end

This could be tricky to implement but possibly useful?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant