Skip to content

← All questions

How deep should page objects nest? We are four levels in and it hurts

Example threads. These questions and answers were written by the SDODS team to document real problems and how to fix them. The people named are illustrative, not real users. Questions asked on this site are marked new.

Our hierarchy is BasePage to AuthenticatedPage to DashboardPage to ReportsPage, and there is talk of a fifth level for the two report variants.

Nobody can say where a locator lives without opening four files. Is there a recommended depth, and does the folder layout under pages/ matter to the runner at all?

3 answers

Know the answer?

Wrap commands and output in triple backticks and they will render as a code block.

Checking whether you’re signed in…

Have a different question? Ask it.

Related