简体   繁体   中英

Is Maven Multi-Module project a good solution for automated tests (Selenium, Appium, Karate)?

I have recently created a Java Maven project using Selenium to script web automated tests.

Now I have to script mobile automated tests, to do so I am going to use Appium.

Instead of creating another project quite similar, I wanted to convert my Maven project to a Maven Multi-Module in which a module will contain web automated tests, an other one will contain mobile automated tests and the last one will contain common logics (later another module will be used for API automated tests using Karate).

I want to know if it is a good idea to use a Maven Multi-Module to do it and if it is, I also want to know if sharing classes in the same project through modules is a good practice.

Thanks a lot for helping.

Yes. Multi-module projects are a great way to split up your project into logical components. But I would consider a few things, First? are your tests Junit or TestNG tests, If they are. I would probably just leave them in your main project under the src/test directory.

From the sound of it, it doesn't seem like these tests are 'unit' tests exactly, but you can still separate and group them. (TestNG has groups and I believe JUnit has something similar) When I have a project with 'unit' and 'integration' tests, I will make unit tests run during the normal build process. And make integration tests run using a maven profile. But if that sounds like too much work, yes, I think multi-modules is a fine way to go.

And yes, sharing classes between modules is definitely good practice. Just as long as you don't have any circular dependencies. That's really the only rule.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM