Suppose I've ordered my page objects files in the following folders:
pages
modals
modal-1.coffee
modal-2.coffee
panels
panel-1.coffee
panel-2.coffee
subpanels
subpanel-1.coffee
subpanel-2.coffee
mainPage.coffee
As of right now, I'm requiring each page object individually at the top of my spec files like thus:
{Modal1} = require <path to modal-1>
...
{MainPage} = require <path to mainPage>
However, I'd like to be able to just make one call, along the lines of:
Pages = require <path to pages dir>
I found this SA question and this blog post. But I'm getting an error where while the page objects are being read (confirmed with console.log statements in my index.coffee file), their member functions are inaccessible:
Pages.MainPage is not a function
Cannot read property 'getSomething' of undefined
So my question is - how do I access the member functions of the page objects when I've exported them as a single module Pages?
Any insights would be really appreciated!