Is there a way to use Page and Step objects between multiple projects with namespaces?

114 views Asked by At

First and foremost, I'm using Codeception 2.1 RC1.

So, I'm bootstrapping multiple Codeception projects with namespaces as described here Codeception Customization

Lets say I have two dirs Frontend and Admin, with suites (acceptance) respectively bootstraped with Frontend and Admin namespaces.

Is there a way to use PageObjects created in the Admin project inside the Frontend project?

The problem is, that when I try to instantiate a new Page or Step it requires me to pass the AcceptanceTester object ($I).

Example: I created a Cept test inside the Frontend folder and in that script I want to use methods from the Admin Pages/Steps. However, as there are two separate AcceptanceTester objects in separate namespaces I can't do that in the current structure of the framework. I tried including them as files too but they are dependent on other files (classes) and I'm guessing including them all isn't the right way to do it.

I suppose it can be done in some way by using the new Autoloader or with more PHP knowledge than I have.

Any feedback and help is greatly appreciated.

0

There are 0 answers