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?