Skip to content

Bundle helpers for with Element classes? #54

@lashd

Description

@lashd

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions