1

I have used siteprism in the following manner

  • Each page has a page object file

  • Sections that are unique to a given page are only found in that page object file

  • Sections that are shared across multiple pages are placed in a base page and other pages extend the base page to inherit those common sections.

What I have not done but encountered

  • There is also the approach where by sections are created and stored in a separate directory of files and then referenced within pages object files as needed.

I didn't want to have large number of small section files and would like to leverage inheritance more often than not but incorporate the section file approach above on an as needed basis.

Thoughts/Suggestions on best practices appreciated.

Thanks

mgraffx
  • 51
  • 4

1 Answers1

0

I would advise the following (And as the current maintainer, this is what I advise everywhere).

The load order of site_prism is critical, so as such all of your files should have a single loader file, that controls the order and loads them up accordingly.

I would load up all lowest level child sections first, in their own directory. Then the top level sections, again in their own directory Then the pages, again in their own directory.

This ensures no LoadErrors.

Luke - SitePrism Lead

Luke Hill
  • 460
  • 2
  • 10