Are functions in page objects for big projects a good practice?

Z R's picture
Z R asked on November 6, 2018 - 9:19am | Replies (0).

So, I'm writing automation tests for a huge web platform. We have page objects folder with files for each web page which contain a great amount of selectors used in tests. Also, tests pertaining to one of the component/functionality are all grouped in one file. 


The main question is whether the functions used by multiple tests (and some will have assertions in them) should be written:

1. Functions w/o assertions in page object and those w/ assertions in helper file for that component/functionality

2. All functions in helper file

3. Functions w/o assertions in page object and write the rest of the commands with assertions in the specific tests even though they may repeat and make the file with tests huge.

Testing is done in javasctipt(more recent: typescript), selenium webdriver, protractor, jasmine.

I really hope someone can solve this conundrum since nobody in my office has enough experience to help me. Thank you!

p.s. Should we group tests in one file? or write wvery test in a separate one?  


No answers yet.

StickyMinds is a TechWell community.

Through conferences, training, consulting, and online resources, TechWell helps you develop and deliver great software every day.