Closed manlycode closed 7 years ago
Good call. That's because I don't know what to recommend yet.
I've thought:
▾ spec
▾ support
▾ ui
▾ pages
foo_page.rb
bar_page.rb
▾ elements
foo_table.rb
bar_form.rb
or maybe just:
▾ spec
▾ support
▾ ui
foo_page.rb
bar_page.rb
foo_table.rb
bar_form.rb
Thoughts?
I also like Domino's convention of namespacing the classes:
module UI
class FooPage < Capybara::UI
# TODO
end
class BarPage < Capybara::UI
# TODO
end
end
Support worked for me. But, convention over configuration. Amirite?
— Sent from Mailbox for iPhone
On Wed, Dec 25, 2013 at 3:16 PM, Steve Richert notifications@github.com wrote:
Good call. That's because I don't know what to recommend yet. I've thought:
▾ spec ▾ support ▾ ui ▾ pages foo_page.rb bar_page.rb ▾ elements foo_table.rb bar_form.rb
or maybe just:
▾ spec ▾ support ▾ ui foo_page.rb bar_page.rb foo_table.rb bar_form.rb
Thoughts?
Reply to this email directly or view it on GitHub: https://github.com/collectiveidea/capybara-ui/issues/4#issuecomment-31204691
I'm also wondering if pages should inherit from a more descriptive class than Capybara::UI
like Capybara::UI::Page
which has good symmetry with Capybara::UI::Element
.
Ultimately, it doesn't matter where you put them as long as you load them before you run your suite. By default (and in most cases), the spec/support
directory will be automatically loaded (as instructed by spec_helper.rb
) so anywhere inside spec/support
is a good candidate.
+1 to UI::
namespace, spec/support/{pages,elements}
, and Capybara::UI::Page
.
since we don't HAVE to reference the class thanks to page.ui
could namespace them under Capybara::UI
module Capybara::UI
class PeoplePage < Page
end
class Person < Element
end
end
This also lends itself nicely to your first proposal of
▾ spec
▾ support
▾ ui
▾ pages
foo_page.rb
bar_page.rb
▾ elements
foo_table.rb
bar_form.rb
Hi there! We're doing some open source maintenance work and closing old issues. If this issue is still applicable or you would still like it to be addressed, please re-open the issue by April 17, 2017. Thanks!
The README doesn't recommend where to place definitions in the spec directory.