-2

Currently we have time for updating architecture in our test automation framework and we searching for the best solution to our needs.

We have this module architecture:

  1. tests-core

    core-api

    core-web

  2. tests-products

    tests-product1-api

    tests-product1-web

    tests-product2-api

    tests-product2-web

In core we have common functionality for all products: classes, pages, stepdefs. Yes, they are very similar.

In tests-products modules we have overridden implementations for the relevant products also unique functionality for this product.

Web modules are dependent on api modules.

Each tests-products module has tests only for this one product.

We use DI framework Guice for binding the appropriate class for product.

And the problem is that we can bind functionality only for one product at once. If we want to have crossproducts tests in new tests-products:tests-crossproducts-api/web then we must rebind all classes each time when we change product during one tests.

When this framework was created, there was no need to run such tests and this is reason why we want to change it.

And now we want to create and hold objects for two products at once in our crossproducts test. DI frameworks don't allow it.

Maybe someone has similar problems, how you resolve it?

Maybe someone know some design patterns which allow us to do such things? Currently considering such patterns as Decorator and Strategy, but as I see Strategy allow as to use one behavior at the same time. Decorator is something that might suit us but I didn't find a good example how we can do it.

Maybe we can create two context and use them use at the right time and there are some framework for this?

Maybe there is another way we can achieve our needs?

Thanks in advance for the proposed architecture, best practices, patterns, frameworks, etc.

4
  • Are you asking for unit test framework?
    – PDHide
    Apr 25 at 11:16
  • I am asking about some solution that can give me the ability to have something like two bindings at the same time or to have two contexts for two products at the same time
    – cheparsky
    Apr 25 at 11:22
  • what you want to test UI ? API? or units?
    – PDHide
    Apr 25 at 11:25
  • As I wrote above, we have modules for api and web
    – cheparsky
    Apr 25 at 11:32
0

If we want to manipulate two products in one framework and still use guice we can use @Provide methods. Examples are here and here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.